Gathering detailed insights and metrics for exegesis-passport
Gathering detailed insights and metrics for exegesis-passport
Gathering detailed insights and metrics for exegesis-passport
Gathering detailed insights and metrics for exegesis-passport
npm install exegesis-passport
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3 Stars
157 Commits
3 Watching
44 Branches
2 Contributors
Updated on 13 Dec 2021
TypeScript (97.17%)
JavaScript (2.83%)
Cumulative downloads
Total Downloads
Last day
-36.8%
12
Compared to previous day
Last week
-26%
74
Compared to previous week
Last month
52.6%
261
Compared to previous month
Last year
2%
1,746
Compared to previous year
This package lets you use passport to authenticate requests in Exegesis.
1import passport from "passport"; 2import * as exegesisExpress from "exegesis-express"; 3import exegesisPassport from "exegesis-passport"; 4import { BasicStrategy } from "passport-http"; 5 6passport.use( 7 "basic", 8 new BasicStrategy((username, password, done) => { 9 if (password === "secret") { 10 done(null, { user: username }); 11 } else { 12 done(null, false); 13 } 14 }) 15); 16 17async function createServer() { 18 const app = express(); 19 20 app.use(passport.initialize()); 21 22 app.use( 23 await exegesisExpress.middleware( 24 path.resolve(__dirname, "./openapi.yaml"), 25 { 26 // Other options go here... 27 authenticators: { 28 // Authenticate the "basicAuth" security scheme using passport's 'basic' strategy. 29 basicAuth: exegesisPassport("basic"), 30 // Uses Passport's build-in 'session' strategy. 31 sessionToken: exegesisPassport("session", { 32 isPresent: (context) => !!context.req.session, 33 }), 34 }, 35 } 36 ) 37 ); 38 39 const server = http.createServer(app); 40 server.listen(3000); 41}
Returns an Exegesis authenticator that will authenticate against the given strategyName. This will not set the user in the session.
options.converter
is a function(user, pluginContext)
which takes in the user
authenticated by passport and returns a {user, roles, scopes}
object for
Exegesis.
options.isPresent
is a function(pluginContext, authInfo)
which returns true
if the given security credentials are present, and false otherwise. Passport does
not distinguish between an authentication attempt which did provide credentials
and an authentication attempt which provided incorrect credentials, but
Exegesis does. If this option is missing, then exgesis-passport will attempt
to work out of the field is present, but in most cases this will end up with
exegesis-passport treating missing credentials the same as bad credentials.
If options.passportOptions
if provided, this will be passed to the passport
strategy when it is run.
You can pass a Passport strategy directly to Exegesis to use the strategy without even having Passport installed:
1const basicStrategy = new BasicStrategy((username, password, done) => { 2 if (password === "secret") { 3 done(null, { user: username }); 4 } else { 5 done(null, false); 6 } 7}); 8 9exegesisOptions.authenticators = { 10 basicAuth: exegesisPassport(basicStrategy), 11};
options
are the same as for exegesisPassport(passport, strategyName[, options])
.
Want to learn more about passport? API docs here.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More