Skip to content
This repository was archived by the owner on Jan 11, 2022. It is now read-only.

Commit 65f32d0

Browse files
committed
make jslint happy
1 parent 3e9ebbe commit 65f32d0

11 files changed

Lines changed: 628 additions & 584 deletions

File tree

lib/conjur/authn.js

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,36 @@
1818
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1919
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020
*/
21+
"use strict";
2122

22-
var g = require('../global')
23+
var g = require('../global');
2324

2425
module.exports = {
25-
connect: function(url) {
26-
return {
27-
casLogin: function(ticket, callback) {
28-
var path = g.format(url + '/users/login?ticket=%s', ticket);
29-
g.getURL(path, callback);
30-
},
31-
authenticate: function(username, apiKey, callback) {
32-
var path = g.format(url + '/users/%s/authenticate', g.escape(username));
33-
g.info(g.format("POST %s", path));
34-
g.rest.post(path, { data: apiKey }).on('complete', function(token, response) {
35-
if ( token instanceof Error)
36-
return callback(token);
37-
else if ( response.statusCode !== 200 )
38-
return callback(g.format("POST %s failed : %s", path, response.statusCode));
39-
40-
callback(null, token);
41-
})
42-
}
26+
connect: function (url) {
27+
return {
28+
casLogin: function (ticket, callback) {
29+
var path = g.format(url + '/users/login?ticket=%s', ticket);
30+
g.getURL(path, callback);
31+
},
32+
authenticate: function (username, apiKey, callback) {
33+
var path = g.format(url + '/users/%s/authenticate', g.escape(username));
34+
g.info(g.format("POST %s", path));
35+
g.rest.post(path, {data: apiKey}).on('complete', function (token, response) {
36+
if (token instanceof Error){
37+
return callback(token);
38+
}
39+
if (response.statusCode !== 200) {
40+
return callback(g.format("POST %s failed : %s", path, response.statusCode));
41+
}
42+
callback(null, token);
43+
});
44+
}
45+
};
46+
},
47+
username: function (token) {
48+
return g.username(token);
49+
},
50+
tokenHeader: function (token) {
51+
return g.format('Token token="%s"', new Buffer(JSON.stringify(token)).toString('base64'));
4352
}
44-
},
45-
username: function(token) {
46-
return g.username(token);
47-
},
48-
tokenHeader: function(token) {
49-
return g.format('Token token="%s"', new Buffer(JSON.stringify(token)).toString('base64'))
50-
}
51-
}
53+
};

0 commit comments

Comments
 (0)