Skip to content
Permalink
Browse files

Misc fixes for getting the ATH going (#10)

* [JENKINS-37671] Use Jenkins.getAuthentication() instead of User.impersonate()

* 0.0.9-beta1

* 0.0.9-beta2 - fix url normalization (removing slashes)

* NPM 0.0.9 and Maven 1.9 releases
  • Loading branch information...
tfennelly committed Sep 12, 2016
1 parent 6abf978 commit 3cbc124294084d3708fa7e8965d603d65cf576ef
Showing with 16 additions and 15 deletions.
  1. +4 −4 package.json
  2. +1 −1 src/main/java/org/jenkinsci/plugins/ssegateway/sse/EventDispatcher.java
  3. +11 −10 src/main/js/sse-client.js
@@ -1,6 +1,6 @@
{
"name": "@jenkins-cd/sse-gateway",
"version": "0.0.8",
"version": "0.0.9",
"description": "Client API for the Jenkins SSE Gateway plugin. Browser UI push events from Jenkins.",
"main": "src/main/js/index.js",
"files": [
@@ -26,15 +26,15 @@
},
"homepage": "https://github.com/jenkinsci/sse-gateway-plugin",
"devDependencies": {
"@jenkins-cd/js-builder": "0.0.39",
"@jenkins-cd/js-modules": "^0.0.7",
"@jenkins-cd/js-builder": "0.0.40",
"@jenkins-cd/js-modules": "0.0.8",
"@jenkins-cd/js-test": "^1.2.3",
"gulp": "^3.9.1",
"http-proxy": "^1.14.0",
"wait-until-promise": "^1.0.0"
},
"peerDependencies": {
"@jenkins-cd/js-modules": "^0.0.7"
"@jenkins-cd/js-modules": "^0.0.8"
},
"dependencies": {
"@jenkins-cd/diag": "0.0.2",
@@ -156,7 +156,7 @@ public boolean subscribe(@Nonnull EventFilter filter) {

User current = getUser();
if (current != null) {
authentication = current.impersonate();
authentication = Jenkins.getAuthentication();
} else {
authentication = Jenkins.ANONYMOUS;
}
@@ -71,16 +71,16 @@ function scheduleDoConfigure(delay) {
}
nextDoConfigureTimeout = setTimeout(doConfigure, timeoutDelay);
}
function discoverJenkinsUrl() {
jenkinsUrl = jsModules.getRootURL();
if (!jenkinsUrl) {
jenkinsUrl = '';
} else {
// only in tests, this is suffixed ...
while (jenkinsUrl.charAt(jenkinsUrl.length - 1) === '/') {
jenkinsUrl = jenkinsUrl.substring(0, jenkinsUrl.length - 1);
}
function normalizeUrl(url) {
if (!url) {
return '';
}
// remove trailing slashes
var newUrl = url;
while (newUrl.charAt(newUrl.length - 1) === '/') {
newUrl = newUrl.substring(0, newUrl.length - 1);
}
return newUrl;
}

exports.configure = function (config) {
@@ -128,8 +128,9 @@ exports.connect = function (clientId, onConnect) {
}

if (!jenkinsUrl) {
discoverJenkinsUrl();
jenkinsUrl = jsModules.getRootURL();
}
jenkinsUrl = normalizeUrl(jenkinsUrl);
exports.jenkinsUrl = jenkinsUrl;

if (typeof clientId !== 'string') {

0 comments on commit 3cbc124

Please sign in to comment.
You can’t perform that action at this time.