Skip to content

Commit

Permalink
docs: cleanup jsdoc for verify function
Browse files Browse the repository at this point in the history
  • Loading branch information
seng-siong committed Apr 26, 2023
1 parent 4c5341c commit 0f05162
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

### v1.0.0-beta4 (2023-04-26)

- fix: define Profile interface locally
- docs: clean up jsdoc for verify function

## v1.0.0-beta3 (2023-04-25)

### Changed
Expand Down
4 changes: 2 additions & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ declare namespace OpenIDConnectStrategy {
) => void)
| ((
issuer: string,
userInfoProfile: MergedProfile,
uiProfile: MergedProfile,
idProfile: Profile,
context: AuthContext,
idToken: JwtToken,
Expand Down Expand Up @@ -331,7 +331,7 @@ declare namespace OpenIDConnectStrategy {
| ((
req: Request,
issuer: string,
userInfoProfile: MergedProfile,
uiProfile: MergedProfile,
idProfile: Profile,
context: AuthContext,
idToken: JwtToken,
Expand Down
18 changes: 13 additions & 5 deletions lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ const passport = require("passport-strategy"),
*/

/**
* Function to process authenticated info and return a valid user profile.
* Function to process authenticated info and return a valid user profile via {@link VerifyCallback}
*
* @callback VerifyFunction
* @param {string} issuer - identifier of the OIDC provider issuing the token claims
* @param {Profile.Profile} profile - profile of the authenticated user
* @param {VerifyCallback} done - callback to return the a user instance, false or error.
* @typedef {{
* (issuer: string, profile: Profile.Profile, context: Context.AuthContext, done: VerifyCallback): void;
* (issuer: string, profile: Profile.Profile, context: Context.AuthContext, idToken: any, done: VerifyCallback): void;
* (issuer: string, profile: Profile.Profile, context: Context.AuthContext, idToken: any, accessToken: any, refreshToken: string, done: VerifyCallback): void;
* (issuer: string, profile: Profile.Profile, context: Context.AuthContext, idToken: any, accessToken: any, refreshToken: string, params: any, done: VerifyCallback): void;
* (issuer: string, uiProfile: Profile.MergedProfile, idProfile: Profile.Profile, context: Context.AuthContext, idToken: any, accessToken: any, refreshToken: string, params: any, done: VerifyCallback): void;
* (req: http.IncomingMessage, issuer: string, profile: Profile.Profile, context: Context.AuthContext, done: VerifyCallback): void;
* (req: http.IncomingMessage, issuer: string, profile: Profile.Profile, context: Context.AuthContext, idToken: any, done: VerifyCallback): void;
* (req: http.IncomingMessage, issuer: string, profile: Profile.Profile, context: Context.AuthContext, idToken: any, accessToken: any, refreshToken: string, done: VerifyCallback): void;
* (req: http.IncomingMessage, issuer: string, profile: Profile.Profile, context: Context.AuthContext, idToken: any, accessToken: any, refreshToken: string, params: any, done: VerifyCallback): void;
* (req: http.IncomingMessage, issuer: string, uiProfile: Profile.MergedProfile, idProfile: Profile.Profile, context: Context.AuthContext, idToken: any, accessToken: any, refreshToken: string, params: any, done: VerifyCallback): void;
* }} VerifyFunction
*/

/**
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@techpass/passport-openidconnect",
"version": "1.0.0-beta3",
"version": "1.0.0-beta4",
"description": "OpenID Connect authentication strategy for Passport.",
"keywords": [
"auth",
Expand All @@ -22,6 +22,9 @@
},
"license": "MIT",
"author": "Jared Hanson <[email protected]> (http://www.jaredhanson.net/)",
"contributors": [
"GovTechSG"
],
"main": "./lib",
"types": "./lib/index.d.ts",
"scripts": {
Expand Down

0 comments on commit 0f05162

Please sign in to comment.