Skip to content

Commit

Permalink
Merge 5f72acf into ad2948d
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerodonnell committed May 17, 2019
2 parents ad2948d + 5f72acf commit a343afb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
52 changes: 52 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
declare module '@articulate/authentic' {
interface VerifyOpts {
algorithms?: string[]
audience?: string | RegExp | Array<string | RegExp>
clockTimestamp?: number
clockTolerance?: number
issuer?: string | string[]
ignoreExpiration?: boolean
ignoreNotBefore?: boolean
jwtid?: string
subject?: string
maxAge?: string
}

interface JWKSOpts {
cache?: boolean,
rateLimit?: boolean
}

interface AuthenticOpts {
issWhitelist: string[],
jwks?: JWKSOpts,
verify?: VerifyOpts
}

interface Validator {
(token: string): Promise<Authentic.JWT>
}

function Authentic(opts: AuthenticOpts): Validator

namespace Authentic {
interface JWT {
// Standard JWT claims
aud: string,
cid?: number,
exp: number,
iat: number,
iss: string
jti?: number,
scp?: Array<String>
sub: string
uid?: number,

// Custom JWT claims
aid?: string,
staff?: boolean,
}
}

export = Authentic
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.0",
"description": "Proper validation of JWT's against JWK's",
"main": "index.js",
"types": "index.d.ts",
"repository": "git@github.com:articulate/authentic.git",
"author": "articulate",
"license": "MIT",
Expand Down

0 comments on commit a343afb

Please sign in to comment.