@relyper/sp-auth 0.1.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -69
- package/dist/client.d.ts +33 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +57 -4
- package/dist/client.js.map +1 -1
- package/dist/coins.d.ts +139 -0
- package/dist/coins.d.ts.map +1 -0
- package/dist/coins.js +210 -0
- package/dist/coins.js.map +1 -0
- package/dist/oidc/claims.d.ts +4 -0
- package/dist/oidc/claims.d.ts.map +1 -0
- package/dist/oidc/claims.js +50 -0
- package/dist/oidc/claims.js.map +1 -0
- package/dist/oidc/client.d.ts +44 -0
- package/dist/oidc/client.d.ts.map +1 -0
- package/dist/oidc/client.js +340 -0
- package/dist/oidc/client.js.map +1 -0
- package/dist/oidc/discovery.d.ts +15 -0
- package/dist/oidc/discovery.d.ts.map +1 -0
- package/dist/oidc/discovery.js +90 -0
- package/dist/oidc/discovery.js.map +1 -0
- package/dist/oidc/pkce.d.ts +6 -0
- package/dist/oidc/pkce.d.ts.map +1 -0
- package/dist/oidc/pkce.js +26 -0
- package/dist/oidc/pkce.js.map +1 -0
- package/dist/oidc/session.d.ts +47 -0
- package/dist/oidc/session.d.ts.map +1 -0
- package/dist/oidc/session.js +119 -0
- package/dist/oidc/session.js.map +1 -0
- package/dist/oidc/types.d.ts +130 -0
- package/dist/oidc/types.d.ts.map +1 -0
- package/dist/oidc/types.js +17 -0
- package/dist/oidc/types.js.map +1 -0
- package/dist/oidc-fastify.d.ts +123 -0
- package/dist/oidc-fastify.d.ts.map +1 -0
- package/dist/oidc-fastify.js +264 -0
- package/dist/oidc-fastify.js.map +1 -0
- package/dist/oidc.d.ts +15 -0
- package/dist/oidc.d.ts.map +1 -0
- package/dist/oidc.js +14 -0
- package/dist/oidc.js.map +1 -0
- package/dist/types.d.ts +13 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +25 -5
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { hkdfSync, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { EncryptJWT, jwtDecrypt } from 'jose';
|
|
3
|
+
/**
|
|
4
|
+
* Cookie-backed state for the OIDC flow, with no server-side store.
|
|
5
|
+
*
|
|
6
|
+
* Two cookies are involved and both are encrypted, not merely signed:
|
|
7
|
+
*
|
|
8
|
+
* - the login cookie, which lives for the seconds between the redirect out and
|
|
9
|
+
* the callback and carries `state`, `nonce` and the PKCE `code_verifier`;
|
|
10
|
+
* - the session cookie, which carries the identity after a successful login.
|
|
11
|
+
*
|
|
12
|
+
* Encryption (JWE, direct A256GCM) rather than a signature means the browser
|
|
13
|
+
* never sees the verifier or the user's claims, and A256GCM authenticates the
|
|
14
|
+
* ciphertext, so tampering fails to decrypt instead of yielding a forged value.
|
|
15
|
+
*
|
|
16
|
+
* Both keys are derived from one application secret through HKDF with distinct
|
|
17
|
+
* info labels, so the two cookies can never be swapped for one another.
|
|
18
|
+
*/
|
|
19
|
+
const MIN_SECRET_LENGTH = 32;
|
|
20
|
+
const HKDF_SALT = 'relyper-sp-auth/v1';
|
|
21
|
+
const SESSION_LABEL = 'session';
|
|
22
|
+
const LOGIN_LABEL = 'login-transaction';
|
|
23
|
+
/** Opaque, unguessable identifier for one login. */
|
|
24
|
+
export function createSessionId() {
|
|
25
|
+
return randomBytes(16).toString('base64url');
|
|
26
|
+
}
|
|
27
|
+
function deriveKey(secret, label) {
|
|
28
|
+
if (typeof secret !== 'string' || secret.length < MIN_SECRET_LENGTH) {
|
|
29
|
+
throw new TypeError('@relyper/sp-auth/oidc: the session secret must be at least ' + MIN_SECRET_LENGTH + ' characters.');
|
|
30
|
+
}
|
|
31
|
+
return new Uint8Array(hkdfSync('sha256', Buffer.from(secret, 'utf8'), HKDF_SALT, label, 32));
|
|
32
|
+
}
|
|
33
|
+
function createCodec(secret, label) {
|
|
34
|
+
const key = deriveKey(secret, label);
|
|
35
|
+
return {
|
|
36
|
+
async seal(value, ttlSeconds) {
|
|
37
|
+
return new EncryptJWT(value)
|
|
38
|
+
.setProtectedHeader({ alg: 'dir', enc: 'A256GCM' })
|
|
39
|
+
.setIssuedAt()
|
|
40
|
+
.setExpirationTime(Math.floor(Date.now() / 1000) + ttlSeconds)
|
|
41
|
+
.encrypt(key);
|
|
42
|
+
},
|
|
43
|
+
async open(token) {
|
|
44
|
+
if (!token)
|
|
45
|
+
return null;
|
|
46
|
+
try {
|
|
47
|
+
const { payload } = await jwtDecrypt(token, key, { clockTolerance: 5 });
|
|
48
|
+
return payload;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Expired, tampered with, or sealed by an older secret. All of these mean
|
|
52
|
+
// the same thing to the caller: there is no usable state here.
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function createSessionCodec(secret) {
|
|
59
|
+
return createCodec(secret, SESSION_LABEL);
|
|
60
|
+
}
|
|
61
|
+
export function createLoginCodec(secret) {
|
|
62
|
+
return createCodec(secret, LOGIN_LABEL);
|
|
63
|
+
}
|
|
64
|
+
/** Constant-time string comparison for CSRF-style tokens of equal expected length. */
|
|
65
|
+
export function safeEqual(a, b) {
|
|
66
|
+
const left = Buffer.from(String(a), 'utf8');
|
|
67
|
+
const right = Buffer.from(String(b), 'utf8');
|
|
68
|
+
if (left.length !== right.length)
|
|
69
|
+
return false;
|
|
70
|
+
return timingSafeEqual(left, right);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Minimal cookie serialisation, so consumers are not forced to install a cookie
|
|
74
|
+
* plugin just to use this package.
|
|
75
|
+
*/
|
|
76
|
+
export function serializeCookie(name, value, options = {}) {
|
|
77
|
+
const parts = [name + '=' + encodeURIComponent(value)];
|
|
78
|
+
parts.push('Path=' + (options.path ?? '/'));
|
|
79
|
+
if (options.domain)
|
|
80
|
+
parts.push('Domain=' + options.domain);
|
|
81
|
+
if (typeof options.maxAgeSeconds === 'number') {
|
|
82
|
+
parts.push('Max-Age=' + Math.max(0, Math.floor(options.maxAgeSeconds)));
|
|
83
|
+
// Expires alongside Max-Age for the benefit of clients that ignore the latter.
|
|
84
|
+
const expires = new Date(Date.now() + Math.max(0, options.maxAgeSeconds) * 1000);
|
|
85
|
+
parts.push('Expires=' + expires.toUTCString());
|
|
86
|
+
}
|
|
87
|
+
if (options.httpOnly !== false)
|
|
88
|
+
parts.push('HttpOnly');
|
|
89
|
+
if (options.secure)
|
|
90
|
+
parts.push('Secure');
|
|
91
|
+
parts.push('SameSite=' + (options.sameSite ?? 'Lax'));
|
|
92
|
+
return parts.join('; ');
|
|
93
|
+
}
|
|
94
|
+
/** Cookie header that deletes `name`. */
|
|
95
|
+
export function clearCookie(name, options = {}) {
|
|
96
|
+
return serializeCookie(name, '', { ...options, maxAgeSeconds: 0 });
|
|
97
|
+
}
|
|
98
|
+
export function parseCookies(header) {
|
|
99
|
+
const result = {};
|
|
100
|
+
if (!header)
|
|
101
|
+
return result;
|
|
102
|
+
for (const part of header.split(';')) {
|
|
103
|
+
const index = part.indexOf('=');
|
|
104
|
+
if (index < 1)
|
|
105
|
+
continue;
|
|
106
|
+
const name = part.slice(0, index).trim();
|
|
107
|
+
if (!name || name in result)
|
|
108
|
+
continue;
|
|
109
|
+
const raw = part.slice(index + 1).trim();
|
|
110
|
+
try {
|
|
111
|
+
result[name] = decodeURIComponent(raw);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
result[name] = raw;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/oidc/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE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,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,KAAK,GAAG,CAAC;YAAE,SAAS;QACxB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,MAAM;YAAE,SAAS;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { RelyperIdentity } from '../types.js';
|
|
2
|
+
/** Subset of the OIDC discovery document this client relies on. */
|
|
3
|
+
export type OidcDiscoveryDocument = {
|
|
4
|
+
issuer: string;
|
|
5
|
+
authorization_endpoint: string;
|
|
6
|
+
token_endpoint: string;
|
|
7
|
+
jwks_uri: string;
|
|
8
|
+
userinfo_endpoint?: string;
|
|
9
|
+
end_session_endpoint?: string;
|
|
10
|
+
code_challenge_methods_supported?: string[];
|
|
11
|
+
token_endpoint_auth_methods_supported?: string[];
|
|
12
|
+
scopes_supported?: string[];
|
|
13
|
+
};
|
|
14
|
+
export type TokenEndpointAuthMethod = 'client_secret_basic' | 'client_secret_post';
|
|
15
|
+
export type RelyperOidcOptions = {
|
|
16
|
+
/**
|
|
17
|
+
* Base URL of the Relyper IdP, exactly as it appears in the `iss` claim.
|
|
18
|
+
* Discovery is read from `<issuer>/.well-known/openid-configuration`.
|
|
19
|
+
*/
|
|
20
|
+
issuer: string;
|
|
21
|
+
/** Client ID registered at the IdP for this service provider. */
|
|
22
|
+
clientId: string;
|
|
23
|
+
/** Client secret generated at the IdP. Never ships to the browser. */
|
|
24
|
+
clientSecret: string;
|
|
25
|
+
/** Must match one of the redirect URIs registered for this client, byte for byte. */
|
|
26
|
+
redirectUri: string;
|
|
27
|
+
/** Default: `openid email profile roles tenant teams`. */
|
|
28
|
+
scope?: string;
|
|
29
|
+
/**
|
|
30
|
+
* How this client authenticates at the token endpoint. Default: whichever of
|
|
31
|
+
* the two the discovery document advertises, preferring `client_secret_basic`.
|
|
32
|
+
*/
|
|
33
|
+
tokenEndpointAuthMethod?: TokenEndpointAuthMethod;
|
|
34
|
+
/** Role(s) required for this service provider. Empty means: no role check. */
|
|
35
|
+
requiredRole?: string | string[];
|
|
36
|
+
/** With several required roles: one suffices ('any', default) or all are needed ('all'). */
|
|
37
|
+
roleMatch?: 'any' | 'all';
|
|
38
|
+
/** Default: true. Set to false if the IdP does not supply an e-mail address. */
|
|
39
|
+
requireEmail?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Also call the UserInfo endpoint after the token exchange. Default: false,
|
|
42
|
+
* because the Relyper IdP already puts every claim into the ID token. Turn it
|
|
43
|
+
* on if you need claims the ID token does not carry.
|
|
44
|
+
*/
|
|
45
|
+
useUserInfo?: boolean;
|
|
46
|
+
/** Leeway for `exp`/`iat`/`nbf` in seconds. Default: 60. */
|
|
47
|
+
clockToleranceSeconds?: number;
|
|
48
|
+
/** How long a discovery document is reused, in milliseconds. Default: 3600000 (1h). */
|
|
49
|
+
discoveryTtlMs?: number;
|
|
50
|
+
/** Timeout for every call to the IdP, in milliseconds. Default: 10000. */
|
|
51
|
+
requestTimeoutMs?: number;
|
|
52
|
+
/** Custom fetch implementation, e.g. for tests or a proxy-aware agent. */
|
|
53
|
+
fetch?: typeof globalThis.fetch;
|
|
54
|
+
/** Maps IdP claims onto the identity. Default: {@link defaultClaimsToIdentity}. */
|
|
55
|
+
mapClaims?: (claims: Record<string, unknown>) => RelyperIdentity;
|
|
56
|
+
};
|
|
57
|
+
export type ResolvedRelyperOidcOptions = {
|
|
58
|
+
issuer: string;
|
|
59
|
+
clientId: string;
|
|
60
|
+
clientSecret: string;
|
|
61
|
+
redirectUri: string;
|
|
62
|
+
scope: string;
|
|
63
|
+
tokenEndpointAuthMethod: TokenEndpointAuthMethod | null;
|
|
64
|
+
requiredRoles: string[];
|
|
65
|
+
roleMatch: 'any' | 'all';
|
|
66
|
+
requireEmail: boolean;
|
|
67
|
+
useUserInfo: boolean;
|
|
68
|
+
clockToleranceSeconds: number;
|
|
69
|
+
discoveryTtlMs: number;
|
|
70
|
+
requestTimeoutMs: number;
|
|
71
|
+
};
|
|
72
|
+
/** State this client must remember between the redirect out and the callback. */
|
|
73
|
+
export type RelyperLoginTransaction = {
|
|
74
|
+
state: string;
|
|
75
|
+
nonce: string;
|
|
76
|
+
codeVerifier: string;
|
|
77
|
+
/** Application path to return to after the login. Always a local path. */
|
|
78
|
+
returnTo: string;
|
|
79
|
+
};
|
|
80
|
+
export type RelyperAuthorizationRequest = {
|
|
81
|
+
/** The IdP URL the browser has to be redirected to. */
|
|
82
|
+
url: string;
|
|
83
|
+
transaction: RelyperLoginTransaction;
|
|
84
|
+
};
|
|
85
|
+
export type RelyperTokenSet = {
|
|
86
|
+
accessToken: string;
|
|
87
|
+
idToken: string;
|
|
88
|
+
tokenType: string;
|
|
89
|
+
expiresIn: number | null;
|
|
90
|
+
refreshToken: string | null;
|
|
91
|
+
scope: string | null;
|
|
92
|
+
};
|
|
93
|
+
export type RelyperLoginResult = {
|
|
94
|
+
identity: RelyperIdentity;
|
|
95
|
+
claims: Record<string, unknown>;
|
|
96
|
+
tokens: RelyperTokenSet;
|
|
97
|
+
};
|
|
98
|
+
export type RelyperOidcErrorCode =
|
|
99
|
+
/** The IdP redirected back with an `error` parameter. */
|
|
100
|
+
'idp_error'
|
|
101
|
+
/** `state` missing, unknown, or not the one this browser started with. */
|
|
102
|
+
| 'invalid_state'
|
|
103
|
+
/** No login transaction cookie -- expired, or a callback nobody started. */
|
|
104
|
+
| 'missing_transaction'
|
|
105
|
+
/** The IdP refused the code exchange. */
|
|
106
|
+
| 'token_exchange_failed'
|
|
107
|
+
/** The ID token failed signature, issuer, audience, nonce, or expiry checks. */
|
|
108
|
+
| 'invalid_id_token'
|
|
109
|
+
/** UserInfo could not be read. */
|
|
110
|
+
| 'userinfo_failed'
|
|
111
|
+
/** Discovery document or JWKS unreachable or malformed. */
|
|
112
|
+
| 'discovery_failed'
|
|
113
|
+
/** Authenticated, but without the role this service provider requires. */
|
|
114
|
+
| 'missing_role'
|
|
115
|
+
/** The IdP supplied no e-mail address although one is required. */
|
|
116
|
+
| 'missing_email';
|
|
117
|
+
export declare class RelyperOidcError extends Error {
|
|
118
|
+
readonly code: RelyperOidcErrorCode;
|
|
119
|
+
/** HTTP status an adapter should answer with. */
|
|
120
|
+
readonly status: number;
|
|
121
|
+
readonly cause?: unknown;
|
|
122
|
+
/** Safe to log: never contains tokens or the client secret. */
|
|
123
|
+
readonly detail?: string;
|
|
124
|
+
constructor(code: RelyperOidcErrorCode, message: string, options?: {
|
|
125
|
+
status?: number;
|
|
126
|
+
cause?: unknown;
|
|
127
|
+
detail?: string;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/oidc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,mEAAmE;AACnE,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,C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D;AACvD,WAAW;AACb,0EAA0E;GACxE,eAAe;AACjB,4EAA4E;GAC1E,qBAAqB;AACvB,yCAAyC;GACvC,uBAAuB;AACzB,gFAAgF;GAC9E,kBAAkB;AACpB,kCAAkC;GAChC,iBAAiB;AACnB,2DAA2D;GACzD,kBAAkB;AACpB,0EAA0E;GACxE,cAAc;AAChB,mEAAmE;GACjE,eAAe,CAAC;AAEpB,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,YACE,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,EAQpE;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class RelyperOidcError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
/** HTTP status an adapter should answer with. */
|
|
4
|
+
status;
|
|
5
|
+
cause;
|
|
6
|
+
/** Safe to log: never contains tokens or the client secret. */
|
|
7
|
+
detail;
|
|
8
|
+
constructor(code, message, options = {}) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = 'RelyperOidcError';
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.status = options.status ?? 502;
|
|
13
|
+
this.cause = options.cause;
|
|
14
|
+
this.detail = options.detail;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/oidc/types.ts"],"names":[],"mappings":"AAkIA,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,IAAI,CAAuB;IACpC,iDAAiD;IACxC,MAAM,CAAS;IACf,KAAK,CAAW;IACzB,+DAA+D;IACtD,MAAM,CAAU;IAEzB,YACE,IAA0B,EAC1B,OAAe,EACf,OAAO,GAA0D,EAAE;QAEnE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { FastifyInstance, FastifyRequest } from 'fastify';
|
|
2
|
+
import { type RelyperOidcClient } from './oidc/client.js';
|
|
3
|
+
import { type SessionPayload } from './oidc/session.js';
|
|
4
|
+
import { type RelyperLoginResult, type RelyperOidcOptions } from './oidc/types.js';
|
|
5
|
+
import type { RelyperIdentity } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Fastify adapter for the OIDC login against the Relyper IdP.
|
|
8
|
+
*
|
|
9
|
+
* Registers the three routes a browser-facing service provider needs -- start
|
|
10
|
+
* the login, receive the callback, end the session -- and guards the rest of the
|
|
11
|
+
* application with the resulting session cookie.
|
|
12
|
+
*/
|
|
13
|
+
declare module 'fastify' {
|
|
14
|
+
interface FastifyRequest {
|
|
15
|
+
/** Identity from the verified ID token. Set once a protected route has passed the guard. */
|
|
16
|
+
relyperIdentity: RelyperIdentity;
|
|
17
|
+
/** Raw session as it was sealed into the cookie. */
|
|
18
|
+
relyperSession: SessionPayload | null;
|
|
19
|
+
}
|
|
20
|
+
interface FastifyInstance {
|
|
21
|
+
relyperOidc: RelyperOidcClient;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export type RelyperOidcFastifyOptions = RelyperOidcOptions & {
|
|
25
|
+
/**
|
|
26
|
+
* Secret this application seals its cookies with, at least 32 characters.
|
|
27
|
+
* Unrelated to the client secret and never shared with the IdP. Rotating it
|
|
28
|
+
* invalidates every open session.
|
|
29
|
+
*/
|
|
30
|
+
sessionSecret: string;
|
|
31
|
+
/** Default: 'relyper_session'. */
|
|
32
|
+
sessionCookieName?: string;
|
|
33
|
+
/** Default: 'relyper_login'. */
|
|
34
|
+
loginCookieName?: string;
|
|
35
|
+
cookieDomain?: string;
|
|
36
|
+
cookiePath?: string;
|
|
37
|
+
/**
|
|
38
|
+
* `Secure` flag. Default: on, unless NODE_ENV is 'development' or 'test'.
|
|
39
|
+
* Leaving this on over plain HTTP means the browser silently drops the cookie.
|
|
40
|
+
*/
|
|
41
|
+
cookieSecure?: boolean;
|
|
42
|
+
/** Lifetime of a session in seconds. Default: 28800 (8 hours). */
|
|
43
|
+
sessionTtlSeconds?: number;
|
|
44
|
+
/** Lifetime of the login handshake in seconds. Default: 600 (10 minutes). */
|
|
45
|
+
loginTtlSeconds?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Re-issue the session cookie on activity so an active user is not logged out
|
|
48
|
+
* mid-session. Default: true. The IdP login time is preserved either way.
|
|
49
|
+
*/
|
|
50
|
+
rollingSession?: boolean;
|
|
51
|
+
/** Absolute lifetime in seconds a session can reach through rolling renewal. Default: 86400 (24h). */
|
|
52
|
+
sessionAbsoluteTtlSeconds?: number;
|
|
53
|
+
/** Keep the ID token in the session so RP-initiated logout can pass it. Default: false. */
|
|
54
|
+
keepIdToken?: boolean;
|
|
55
|
+
/** Default: '/auth/login'. */
|
|
56
|
+
loginPath?: string;
|
|
57
|
+
/** Default: '/auth/callback'. Must match the redirect URI registered at the IdP. */
|
|
58
|
+
callbackPath?: string;
|
|
59
|
+
/** Default: '/auth/logout'. Registered for both GET and POST. */
|
|
60
|
+
logoutPath?: string;
|
|
61
|
+
/** Local path to land on after logout. Default: '/'. */
|
|
62
|
+
postLogoutRedirect?: string;
|
|
63
|
+
/** Local path the callback redirects to when the login fails. Default: none, a JSON error is sent. */
|
|
64
|
+
loginErrorRedirect?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Decides which requests the session guard covers. Default: everything except
|
|
67
|
+
* the login, callback and logout routes.
|
|
68
|
+
*/
|
|
69
|
+
protect?: (request: FastifyRequest) => boolean;
|
|
70
|
+
/** Hook the guard runs in. Default: 'onRequest'. */
|
|
71
|
+
hook?: 'onRequest' | 'preHandler';
|
|
72
|
+
/**
|
|
73
|
+
* Translates the IdP identity into the application's own user object, usually
|
|
74
|
+
* an upsert into its database. Runs on every guarded request.
|
|
75
|
+
*/
|
|
76
|
+
resolveUser?: (identity: RelyperIdentity, request: FastifyRequest) => unknown | Promise<unknown>;
|
|
77
|
+
/** Request property holding the result of `resolveUser`. Default: 'principal'. */
|
|
78
|
+
principalKey?: string;
|
|
79
|
+
/** Path for a /me route. Default: false. */
|
|
80
|
+
meRoute?: string | false;
|
|
81
|
+
/** Response of the /me route. Default: `{ user: request[principalKey] }`. */
|
|
82
|
+
meResponse?: (request: FastifyRequest) => unknown;
|
|
83
|
+
/**
|
|
84
|
+
* Whether an unauthenticated request is answered with a redirect to the login
|
|
85
|
+
* instead of a 401. Default: redirect for top-level HTML navigation, 401 for
|
|
86
|
+
* everything else, which is what a single-page app wants.
|
|
87
|
+
*/
|
|
88
|
+
redirectUnauthenticated?: boolean | ((request: FastifyRequest) => boolean);
|
|
89
|
+
/** Body of a 401/403. Default: `{ error, code, loginUrl }`. */
|
|
90
|
+
errorBody?: (failure: RelyperAuthFailureInfo, request: FastifyRequest) => unknown;
|
|
91
|
+
/** Audit hook for rejected requests and failed logins. */
|
|
92
|
+
onAuthFailure?: (failure: RelyperAuthFailureInfo, request: FastifyRequest) => void | Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Called after a successful login, before the redirect. Receives the session id
|
|
95
|
+
* that identifies this login, so an application keeping a revocation list can
|
|
96
|
+
* record it here.
|
|
97
|
+
*/
|
|
98
|
+
onLogin?: (result: RelyperLoginResult, request: FastifyRequest, sessionId: string) => void | Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Called when a session ends, with the id from {@link RelyperOidcFastifyOptions.onLogin}.
|
|
101
|
+
* Implement this together with `isSessionRevoked` to make logout binding: the
|
|
102
|
+
* session cookie itself is stateless, so clearing it only affects the browser
|
|
103
|
+
* that asked. Recording the id here and rejecting it afterwards also stops a
|
|
104
|
+
* cookie that was copied before the logout.
|
|
105
|
+
*/
|
|
106
|
+
onLogout?: (sessionId: string, session: SessionPayload, request: FastifyRequest) => void | Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Consulted on every guarded request. Return true to refuse a session whose id
|
|
109
|
+
* has been revoked. Default: no revocation list, sessions live until they expire.
|
|
110
|
+
*/
|
|
111
|
+
isSessionRevoked?: (sessionId: string, request: FastifyRequest) => boolean | Promise<boolean>;
|
|
112
|
+
};
|
|
113
|
+
export type RelyperAuthFailureInfo = {
|
|
114
|
+
status: number;
|
|
115
|
+
code: string;
|
|
116
|
+
message: string;
|
|
117
|
+
/** Safe to log; never contains tokens or secrets. */
|
|
118
|
+
detail?: string;
|
|
119
|
+
};
|
|
120
|
+
declare function plugin(app: FastifyInstance, options: RelyperOidcFastifyOptions): Promise<void>;
|
|
121
|
+
export declare const relyperOidcAuth: typeof plugin;
|
|
122
|
+
export default relyperOidcAuth;
|
|
123
|
+
//# sourceMappingURL=oidc-fastify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc-fastify.d.ts","sourceRoot":"","sources":["../src/oidc-fastify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAgB,cAAc,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAQL,KA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