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
Typescript
Module System
Min. Node Version
Node Version
NPM Version
69.9
Supply Chain
96.2
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (97.17%)
JavaScript (2.83%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
157 Commits
2 Watchers
44 Branches
2 Contributors
Updated on Dec 13, 2021
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
exegesis-passport@2.0.1
Unpacked Size
21.19 kB
Size
5.83 kB
File Count
5
NPM Version
6.11.1
Node Version
10.16.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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('basic', new BasicStrategy((username, password, done) => { 7 if(password === 'secret') { 8 done(null, {user: username}); 9 } else { 10 done(null, false); 11 } 12})); 13 14async function createServer() { 15 const app = express(); 16 17 app.use(passport.initialize()); 18 19 app.use(await exegesisExpress.middleware( 20 path.resolve(__dirname, './openapi.yaml'), 21 { 22 // Other options go here... 23 authenticators: { 24 // Authenticate the "basicAuth" security scheme using passport's 'basic' strategy. 25 basicAuth: exegesisPassport('basic'), 26 // Uses Passport's build-in 'session' strategy. 27 sessionToken: exegesisPassport('session', { 28 isPresent: (context) => !!context.req.session 29 }) 30 } 31 } 32 )); 33 34 const server = http.createServer(app); 35 server.listen(3000); 36}
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 dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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 2025-06-30
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