Hapi auth plugin for the Screwdriver API
const Hapi = require('hapi');
const server = new Hapi.Server();
const authPlugin = require('./');
server.connection({ port: 3000 });
server.register({
register: authPlugin,
options: {}
}, () => {
server.start((err) => {
if (err) {
throw err;
}
console.log('Server running at:', server.info.uri);
});
});
GET /auth/login
(for backward compatibility) or GET /auth/login/{scmContext}
or POST /auth/login/{scmContext}
GET /auth/token
(with OAuth) or GET /auth/token?api_token=YOUR_API_TOKEN
(with API token)
GET /auth/key
POST /auth/logout
GET /auth/contexts