-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.js
30 lines (25 loc) · 989 Bytes
/
manifest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const BearerStrategy = require('passport-http-bearer').Strategy;
const authService = require('./services/authServices');
const load = function() {
passport.use(new LocalStrategy({ passReqToCallback: true }, authService.authenticateLocal));
passport.use(new BearerStrategy({ passReqToCallback: true }, authService.authenticateToken));
};
module.exports = {
version: '1.2.0',
init: function (pluginContext) {
authService.init(pluginContext);
pluginContext.registerPolicy(require('./policies/'));
pluginContext.registerCondition(require('./conditions/url-match'));
pluginContext.registerGatewayRoute(require('./routes/'));
pluginContext.eventBus.on('http-ready', function ({ httpServer }) {
load();
});
pluginContext.eventBus.on('https-ready', function ({ httpsServer }) {
load();
});
},
policies:['remote-login']
};