Skip to content

Commit

Permalink
Merge a163b24 into ad2948d
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerodonnell committed May 20, 2019
2 parents ad2948d + a163b24 commit 74456a2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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
[key: string]: any
}
}

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 74456a2

Please sign in to comment.