@maronn-openid-connect/experimental 0.0.5 → 0.0.7
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 +3 -5
- package/dist/ciba/backchannel-authentication-request.d.ts +31 -0
- package/dist/ciba/backchannel-authentication-request.d.ts.map +1 -0
- package/dist/ciba/backchannel-authentication-request.js +132 -0
- package/dist/ciba/backchannel-authentication-request.js.map +1 -0
- package/dist/ciba/ciba-grant.d.ts +17 -0
- package/dist/ciba/ciba-grant.d.ts.map +1 -0
- package/dist/ciba/ciba-grant.js +55 -0
- package/dist/ciba/ciba-grant.js.map +1 -0
- package/dist/ciba/errors.d.ts +19 -0
- package/dist/ciba/errors.d.ts.map +1 -0
- package/dist/ciba/errors.js +38 -0
- package/dist/ciba/errors.js.map +1 -0
- package/dist/ciba/index.d.ts +10 -0
- package/dist/ciba/index.d.ts.map +1 -0
- package/dist/ciba/index.js +6 -0
- package/dist/ciba/index.js.map +1 -0
- package/dist/ciba/store.d.ts +44 -0
- package/dist/ciba/store.d.ts.map +1 -0
- package/dist/ciba/store.js +73 -0
- package/dist/ciba/store.js.map +1 -0
- package/dist/ciba/verification.d.ts +37 -0
- package/dist/ciba/verification.d.ts.map +1 -0
- package/dist/ciba/verification.js +105 -0
- package/dist/ciba/verification.js.map +1 -0
- package/dist/device-authorization-grant/device-code-grant.js.map +1 -1
- package/dist/device-authorization-grant/errors.d.ts.map +1 -1
- package/dist/device-authorization-grant/verification.d.ts.map +1 -1
- package/dist/device-authorization-grant/verification.js.map +1 -1
- package/dist/id-jag/errors.d.ts +11 -0
- package/dist/id-jag/errors.d.ts.map +1 -0
- package/dist/id-jag/errors.js +19 -0
- package/dist/id-jag/errors.js.map +1 -0
- package/dist/id-jag/index.d.ts +4 -0
- package/dist/id-jag/index.d.ts.map +1 -0
- package/dist/id-jag/index.js +4 -0
- package/dist/id-jag/index.js.map +1 -0
- package/dist/id-jag/issue-id-jag.d.ts +138 -0
- package/dist/id-jag/issue-id-jag.d.ts.map +1 -0
- package/dist/id-jag/issue-id-jag.js +359 -0
- package/dist/id-jag/issue-id-jag.js.map +1 -0
- package/dist/id-jag/redeem-id-jag.d.ts +65 -0
- package/dist/id-jag/redeem-id-jag.d.ts.map +1 -0
- package/dist/id-jag/redeem-id-jag.js +305 -0
- package/dist/id-jag/redeem-id-jag.js.map +1 -0
- package/dist/jarm/response-mode.d.ts +1 -1
- package/dist/jarm/response-mode.d.ts.map +1 -1
- package/dist/jwt-introspection-response/accept.d.ts +3 -0
- package/dist/jwt-introspection-response/accept.d.ts.map +1 -0
- package/dist/jwt-introspection-response/accept.js +11 -0
- package/dist/jwt-introspection-response/accept.js.map +1 -0
- package/dist/jwt-introspection-response/audience.d.ts +3 -0
- package/dist/jwt-introspection-response/audience.d.ts.map +1 -0
- package/dist/jwt-introspection-response/audience.js +17 -0
- package/dist/jwt-introspection-response/audience.js.map +1 -0
- package/dist/jwt-introspection-response/index.d.ts +4 -0
- package/dist/jwt-introspection-response/index.d.ts.map +1 -0
- package/dist/jwt-introspection-response/index.js +4 -0
- package/dist/jwt-introspection-response/index.js.map +1 -0
- package/dist/jwt-introspection-response/response-jwt.d.ts +10 -0
- package/dist/jwt-introspection-response/response-jwt.d.ts.map +1 -0
- package/dist/jwt-introspection-response/response-jwt.js +32 -0
- package/dist/jwt-introspection-response/response-jwt.js.map +1 -0
- package/dist/par/par-request.d.ts.map +1 -1
- package/dist/par/par-request.js.map +1 -1
- package/dist/par/resolve-request-uri.d.ts.map +1 -1
- package/dist/token-exchange/token-exchange-request.d.ts.map +1 -1
- package/package.json +18 -6
package/README.md
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
| `token-exchange` | OAuth 2.0 Token Exchange (impersonation) | RFC 8693 | `@maronn-openid-connect/experimental/token-exchange` |
|
|
17
17
|
| `jarm` | JWT Secured Authorization Response Mode (signed `query.jwt` only) | JARM (OpenID Foundation Final, 2022-11-09) | `@maronn-openid-connect/experimental/jarm` |
|
|
18
18
|
| `device-authorization-grant` | OAuth 2.0 Device Authorization Grant | RFC 8628 | `@maronn-openid-connect/experimental/device-authorization-grant` |
|
|
19
|
+
| `id-jag` | Cross-App Access / Identity Assertion Authorization Grant(発行と受領の両側) | draft-ietf-oauth-identity-assertion-authz-grant-04 | `@maronn-openid-connect/experimental/id-jag` |
|
|
20
|
+
| `ciba` | Client-Initiated Backchannel Authentication(Poll モードのみ) | CIBA Core 1.0 (OpenID Foundation Final, 2021-09-01) | `@maronn-openid-connect/experimental/ciba` |
|
|
21
|
+
| `jwt-introspection-response` | JWT Response for OAuth Token Introspection(署名付き応答のみ・RS256 固定) | RFC 9701 | `@maronn-openid-connect/experimental/jwt-introspection-response` |
|
|
19
22
|
|
|
20
23
|
機能ごとに subpath export で提供します。ルート (`.`) からの再エクスポートは提供しません。機能間でコードを共有しないことで、昇格・削除時に他機能へ影響しない構造を保っています。
|
|
21
24
|
|
|
@@ -65,8 +68,3 @@ Experimental 機能が core へ昇格する目安は次のとおりです。
|
|
|
65
68
|
## 利用者ドキュメント
|
|
66
69
|
|
|
67
70
|
`docs/library-document` の Experimental セクションを参照してください。
|
|
68
|
-
|
|
69
|
-
## 実装解説
|
|
70
|
-
|
|
71
|
-
各機能を「何を・どう実装したか」をコード全文つきで説明する解説(日本語・英語)を
|
|
72
|
-
`docs/implementation-guides/experimental/` に置いています。実装の内側を読むときはこちらを参照してください。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type TokenClientInfo } from '@maronn-openid-connect/core';
|
|
2
|
+
import { type CibaAuthenticationRequestStore } from './store.js';
|
|
3
|
+
export declare const BINDING_MESSAGE_MAX_LENGTH = 100;
|
|
4
|
+
export type CibaClientInfo = TokenClientInfo & {
|
|
5
|
+
backchannelTokenDeliveryMode?: 'poll' | 'ping' | 'push';
|
|
6
|
+
};
|
|
7
|
+
export type CibaUserResolver = (loginHint: string) => Promise<{
|
|
8
|
+
subject: string;
|
|
9
|
+
} | null> | {
|
|
10
|
+
subject: string;
|
|
11
|
+
} | null;
|
|
12
|
+
export interface CibaConfig {
|
|
13
|
+
authReqIdExpiresIn: number;
|
|
14
|
+
pollingInterval: number;
|
|
15
|
+
maxPendingPerSubject: number;
|
|
16
|
+
}
|
|
17
|
+
export interface BackchannelAuthenticationResponse {
|
|
18
|
+
auth_req_id: string;
|
|
19
|
+
expires_in: number;
|
|
20
|
+
interval: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function processBackchannelAuthenticationRequest(input: {
|
|
23
|
+
params: Record<string, string>;
|
|
24
|
+
client: CibaClientInfo;
|
|
25
|
+
store: CibaAuthenticationRequestStore;
|
|
26
|
+
config: CibaConfig;
|
|
27
|
+
refreshTokenFeatureEnabled: boolean;
|
|
28
|
+
resolveUser: CibaUserResolver;
|
|
29
|
+
now?: Date;
|
|
30
|
+
}): Promise<BackchannelAuthenticationResponse>;
|
|
31
|
+
//# sourceMappingURL=backchannel-authentication-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backchannel-authentication-request.d.ts","sourceRoot":"","sources":["../../src/ciba/backchannel-authentication-request.ts"],"names":[],"mappings":"AAYA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEzF,OAAO,EAGL,KAAK,8BAA8B,EACpC,MAAM,YAAY,CAAC;AAUpB,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAkB9C,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG;IAC7C,4BAA4B,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACzD,CAAC;AASF,MAAM,MAAM,gBAAgB,GAAG,CAC7B,SAAS,EAAE,MAAM,KACd,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC;AAGtE,MAAM,WAAW,UAAU;IAEzB,kBAAkB,EAAE,MAAM,CAAC;IAE3B,eAAe,EAAE,MAAM,CAAC;IAExB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAGD,MAAM,WAAW,iCAAiC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAYD,wBAAsB,uCAAuC,CAAC,KAAK,EAAE;IACnE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/B,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,8BAA8B,CAAC;IACtC,MAAM,EAAE,UAAU,CAAC;IAEnB,0BAA0B,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE,gBAAgB,CAAC;IAE9B,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAsD7C"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { generateRandomString } from '@maronn-openid-connect/core';
|
|
2
|
+
import { BackchannelAuthenticationError } from './errors.js';
|
|
3
|
+
import { CIBA_GRANT_TYPE, } from './store.js';
|
|
4
|
+
const AUTH_REQ_ID_BYTE_LENGTH = 32;
|
|
5
|
+
export const BINDING_MESSAGE_MAX_LENGTH = 100;
|
|
6
|
+
const REQUESTED_EXPIRY_MIN = 30;
|
|
7
|
+
const UNKNOWN_USER_MESSAGE = 'The login_hint could not be matched to a user';
|
|
8
|
+
export async function processBackchannelAuthenticationRequest(input) {
|
|
9
|
+
const { params, client, store, config } = input;
|
|
10
|
+
validateCibaClient(client);
|
|
11
|
+
rejectSignedRequest(params);
|
|
12
|
+
const loginHint = extractLoginHint(params);
|
|
13
|
+
const scope = applyOfflineAccessPolicy(validateCibaScope(params['scope']), {
|
|
14
|
+
client,
|
|
15
|
+
refreshTokenFeatureEnabled: input.refreshTokenFeatureEnabled,
|
|
16
|
+
});
|
|
17
|
+
const bindingMessage = validateBindingMessage(params['binding_message']);
|
|
18
|
+
const expiresIn = resolveExpiresIn(params['requested_expiry'], config);
|
|
19
|
+
const subject = await resolveSubject(loginHint, input.resolveUser);
|
|
20
|
+
const pending = await store.listPendingBySubject(subject);
|
|
21
|
+
if (pending.length >= config.maxPendingPerSubject) {
|
|
22
|
+
throw new BackchannelAuthenticationError('invalid_request', 'Too many pending authentication requests for this user');
|
|
23
|
+
}
|
|
24
|
+
const createdAt = input.now ?? new Date();
|
|
25
|
+
const record = {
|
|
26
|
+
authReqId: generateRandomString(AUTH_REQ_ID_BYTE_LENGTH),
|
|
27
|
+
clientId: client.clientId,
|
|
28
|
+
subject,
|
|
29
|
+
scope,
|
|
30
|
+
status: 'pending',
|
|
31
|
+
createdAt,
|
|
32
|
+
expiresAt: new Date(createdAt.getTime() + expiresIn * 1000),
|
|
33
|
+
interval: config.pollingInterval,
|
|
34
|
+
lastPolledAt: null,
|
|
35
|
+
csrfToken: null,
|
|
36
|
+
};
|
|
37
|
+
if (bindingMessage !== undefined) {
|
|
38
|
+
record.bindingMessage = bindingMessage;
|
|
39
|
+
}
|
|
40
|
+
const acrValues = params['acr_values'];
|
|
41
|
+
if (acrValues !== undefined && acrValues !== '') {
|
|
42
|
+
record.acrValues = acrValues;
|
|
43
|
+
}
|
|
44
|
+
await store.save(record);
|
|
45
|
+
return {
|
|
46
|
+
auth_req_id: record.authReqId,
|
|
47
|
+
expires_in: expiresIn,
|
|
48
|
+
interval: config.pollingInterval,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function validateCibaClient(client) {
|
|
52
|
+
if (client.tokenEndpointAuthMethod === 'none') {
|
|
53
|
+
throw new BackchannelAuthenticationError('unauthorized_client', 'Public clients are not allowed to use the CIBA grant type');
|
|
54
|
+
}
|
|
55
|
+
if (!(client.grantTypes ?? []).includes(CIBA_GRANT_TYPE)) {
|
|
56
|
+
throw new BackchannelAuthenticationError('unauthorized_client', 'The client is not authorized to use the CIBA grant');
|
|
57
|
+
}
|
|
58
|
+
const deliveryMode = client.backchannelTokenDeliveryMode ?? 'poll';
|
|
59
|
+
if (deliveryMode !== 'poll') {
|
|
60
|
+
throw new BackchannelAuthenticationError('unauthorized_client', 'This provider only supports the poll token delivery mode');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function rejectSignedRequest(params) {
|
|
64
|
+
if (params['request'] !== undefined) {
|
|
65
|
+
throw new BackchannelAuthenticationError('invalid_request', 'Signed authentication requests are not supported');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function extractLoginHint(params) {
|
|
69
|
+
const presented = ['login_hint', 'id_token_hint', 'login_hint_token'].filter((name) => params[name] !== undefined && params[name] !== '');
|
|
70
|
+
if (presented.length !== 1) {
|
|
71
|
+
throw new BackchannelAuthenticationError('invalid_request', 'Exactly one of login_hint, id_token_hint or login_hint_token is required');
|
|
72
|
+
}
|
|
73
|
+
if (presented[0] !== 'login_hint') {
|
|
74
|
+
throw new BackchannelAuthenticationError('invalid_request', 'Only login_hint is supported by this provider');
|
|
75
|
+
}
|
|
76
|
+
return params['login_hint'];
|
|
77
|
+
}
|
|
78
|
+
function validateCibaScope(scope) {
|
|
79
|
+
if (scope === undefined || scope.trim() === '') {
|
|
80
|
+
throw new BackchannelAuthenticationError('invalid_request', 'Missing required parameter: scope');
|
|
81
|
+
}
|
|
82
|
+
const values = [...new Set(scope.trim().split(/\s+/).filter((value) => value.length > 0))];
|
|
83
|
+
if (!values.includes('openid')) {
|
|
84
|
+
throw new BackchannelAuthenticationError('invalid_scope', 'The openid scope is required');
|
|
85
|
+
}
|
|
86
|
+
return values;
|
|
87
|
+
}
|
|
88
|
+
function applyOfflineAccessPolicy(scope, options) {
|
|
89
|
+
const clientAllowsRefresh = (options.client.grantTypes ?? []).includes('refresh_token');
|
|
90
|
+
if (options.refreshTokenFeatureEnabled && clientAllowsRefresh) {
|
|
91
|
+
return scope;
|
|
92
|
+
}
|
|
93
|
+
return scope.filter((value) => value !== 'offline_access');
|
|
94
|
+
}
|
|
95
|
+
function validateBindingMessage(bindingMessage) {
|
|
96
|
+
if (bindingMessage === undefined)
|
|
97
|
+
return undefined;
|
|
98
|
+
const hasControlCharacter = [...bindingMessage].some((char) => {
|
|
99
|
+
const code = char.codePointAt(0) ?? 0;
|
|
100
|
+
return code < 0x20 || code === 0x7f;
|
|
101
|
+
});
|
|
102
|
+
if (bindingMessage.length < 1 ||
|
|
103
|
+
bindingMessage.length > BINDING_MESSAGE_MAX_LENGTH ||
|
|
104
|
+
hasControlCharacter) {
|
|
105
|
+
throw new BackchannelAuthenticationError('invalid_binding_message', 'binding_message must be 1 to 100 characters without control characters');
|
|
106
|
+
}
|
|
107
|
+
return bindingMessage;
|
|
108
|
+
}
|
|
109
|
+
function resolveExpiresIn(requestedExpiry, config) {
|
|
110
|
+
if (requestedExpiry === undefined) {
|
|
111
|
+
return config.authReqIdExpiresIn;
|
|
112
|
+
}
|
|
113
|
+
if (!/^[0-9]+$/.test(requestedExpiry) || Number(requestedExpiry) < 1) {
|
|
114
|
+
throw new BackchannelAuthenticationError('invalid_request', 'requested_expiry must be a positive integer');
|
|
115
|
+
}
|
|
116
|
+
const requested = Number(requestedExpiry);
|
|
117
|
+
return Math.min(Math.max(requested, REQUESTED_EXPIRY_MIN), config.authReqIdExpiresIn);
|
|
118
|
+
}
|
|
119
|
+
async function resolveSubject(loginHint, resolveUser) {
|
|
120
|
+
let resolved;
|
|
121
|
+
try {
|
|
122
|
+
resolved = await resolveUser(loginHint);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
resolved = null;
|
|
126
|
+
}
|
|
127
|
+
if (resolved === null) {
|
|
128
|
+
throw new BackchannelAuthenticationError('unknown_user_id', UNKNOWN_USER_MESSAGE);
|
|
129
|
+
}
|
|
130
|
+
return resolved.subject;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=backchannel-authentication-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backchannel-authentication-request.js","sourceRoot":"","sources":["../../src/ciba/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,CAAC;IACJ,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAWD,SAAS,gBAAgB,CAAC,eAAmC,EAAE,MAAkB;IAC/E,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,kBAAkB,CAAC;IACnC,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,8BAA8B,CACtC,iBAAiB,EACjB,6CAA6C,CAC9C,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACxF,CAAC;AASD,KAAK,UAAU,cAAc,CAAC,SAAiB,EAAE,WAA6B;IAC5E,IAAI,QAAoC,CAAC;IACzC,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;IACD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,8BAA8B,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TokenClientInfo } from '@maronn-openid-connect/core';
|
|
2
|
+
import type { CibaAuthenticationRequestStore } from './store.js';
|
|
3
|
+
export declare const SLOW_DOWN_INTERVAL_INCREMENT = 5;
|
|
4
|
+
export interface CibaGrantResult {
|
|
5
|
+
subject: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
scope: string[];
|
|
8
|
+
authTime: number;
|
|
9
|
+
grantId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function processCibaGrant(input: {
|
|
12
|
+
params: Record<string, string>;
|
|
13
|
+
client: TokenClientInfo;
|
|
14
|
+
store: CibaAuthenticationRequestStore;
|
|
15
|
+
now?: Date;
|
|
16
|
+
}): Promise<CibaGrantResult>;
|
|
17
|
+
//# sourceMappingURL=ciba-grant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ciba-grant.d.ts","sourceRoot":"","sources":["../../src/ciba/ciba-grant.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,KAAK,EAEV,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAa9C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAyBD,wBAAsB,gBAAgB,CAAC,KAAK,EAAE;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,8BAA8B,CAAC;IACtC,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,OAAO,CAAC,eAAe,CAAC,CAG3B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CibaGrantError } from './errors.js';
|
|
2
|
+
export const SLOW_DOWN_INTERVAL_INCREMENT = 5;
|
|
3
|
+
const INVALID_AUTH_REQ_ID_MESSAGE = 'The auth_req_id is invalid, expired, or was issued to another client';
|
|
4
|
+
export async function processCibaGrant(input) {
|
|
5
|
+
const record = await resolveCibaRecord(input.params, input.client, input.store);
|
|
6
|
+
return evaluateCibaState(record, input.store, input.now ?? new Date());
|
|
7
|
+
}
|
|
8
|
+
async function resolveCibaRecord(params, client, store) {
|
|
9
|
+
const authReqId = params['auth_req_id'];
|
|
10
|
+
if (authReqId === undefined || authReqId === '') {
|
|
11
|
+
throw new CibaGrantError('invalid_request', 'Missing required parameter: auth_req_id');
|
|
12
|
+
}
|
|
13
|
+
const record = await store.findByAuthReqId(authReqId);
|
|
14
|
+
if (record === null || record.clientId !== client.clientId) {
|
|
15
|
+
throw new CibaGrantError('invalid_grant', INVALID_AUTH_REQ_ID_MESSAGE);
|
|
16
|
+
}
|
|
17
|
+
return record;
|
|
18
|
+
}
|
|
19
|
+
async function evaluateCibaState(record, store, now) {
|
|
20
|
+
if (now.getTime() >= record.expiresAt.getTime()) {
|
|
21
|
+
await store.delete(record.authReqId);
|
|
22
|
+
throw new CibaGrantError('expired_token', 'The auth_req_id has expired. Start a new backchannel authentication request.');
|
|
23
|
+
}
|
|
24
|
+
if (record.lastPolledAt !== null &&
|
|
25
|
+
now.getTime() - record.lastPolledAt.getTime() < record.interval * 1000) {
|
|
26
|
+
record.interval += SLOW_DOWN_INTERVAL_INCREMENT;
|
|
27
|
+
record.lastPolledAt = now;
|
|
28
|
+
await store.update(record);
|
|
29
|
+
throw new CibaGrantError('slow_down', 'Polling too frequently. Increase the interval by 5 seconds.');
|
|
30
|
+
}
|
|
31
|
+
if (record.status === 'pending') {
|
|
32
|
+
record.lastPolledAt = now;
|
|
33
|
+
await store.update(record);
|
|
34
|
+
throw new CibaGrantError('authorization_pending', 'The authentication request is still pending');
|
|
35
|
+
}
|
|
36
|
+
if (record.status === 'denied') {
|
|
37
|
+
await store.delete(record.authReqId);
|
|
38
|
+
throw new CibaGrantError('access_denied', 'The end-user denied the authentication request');
|
|
39
|
+
}
|
|
40
|
+
const consumed = await store.consume(record.authReqId);
|
|
41
|
+
if (consumed === null ||
|
|
42
|
+
consumed.status !== 'approved' ||
|
|
43
|
+
consumed.authTime === undefined ||
|
|
44
|
+
consumed.grantId === undefined) {
|
|
45
|
+
throw new CibaGrantError('invalid_grant', INVALID_AUTH_REQ_ID_MESSAGE);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
subject: consumed.subject,
|
|
49
|
+
clientId: consumed.clientId,
|
|
50
|
+
scope: consumed.approvedScope ?? consumed.scope,
|
|
51
|
+
authTime: consumed.authTime,
|
|
52
|
+
grantId: consumed.grantId,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=ciba-grant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ciba-grant.js","sourceRoot":"","sources":["../../src/ciba/ciba-grant.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAO7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAS9C,MAAM,2BAA2B,GAC/B,sEAAsE,CAAC;AAkCzE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAMtC;IACC,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAChF,OAAO,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;AACzE,CAAC;AAOD,KAAK,UAAU,iBAAiB,CAC9B,MAA8B,EAC9B,MAAuB,EACvB,KAAqC;IAErC,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IACxC,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,cAAc,CAAC,iBAAiB,EAAE,yCAAyC,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAC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rC,MAAM,IAAI,cAAc,CAAC,eAAe,EAAE,gDAAgD,CAAC,CAAC;IAC9F,CAAC;IAKD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvD,IACE,QAAQ,KAAK,IAAI;QACjB,QAAQ,CAAC,MAAM,KAAK,UAAU;QAC9B,QAAQ,CAAC,QAAQ,KAAK,SAAS;QAC/B,QAAQ,CAAC,OAAO,KAAK,SAAS,EAC9B,CAAC;QACD,MAAM,IAAI,cAAc,CAAC,eAAe,EAAE,2BAA2B,CAAC,CAAC;IACzE,CAAC;IAED,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,KAAK,EAAE,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,KAAK;QAC/C,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type BackchannelAuthenticationErrorCode = 'invalid_request' | 'invalid_scope' | 'unknown_user_id' | 'unauthorized_client' | 'invalid_binding_message';
|
|
2
|
+
export declare class BackchannelAuthenticationError extends Error {
|
|
3
|
+
readonly code: BackchannelAuthenticationErrorCode;
|
|
4
|
+
readonly errorDescription: string;
|
|
5
|
+
constructor(code: BackchannelAuthenticationErrorCode, errorDescription: string);
|
|
6
|
+
get statusCode(): 400;
|
|
7
|
+
}
|
|
8
|
+
export declare class CibaVerificationError extends Error {
|
|
9
|
+
readonly statusCode: 401 | 403;
|
|
10
|
+
constructor(message: string, statusCode: 401 | 403);
|
|
11
|
+
}
|
|
12
|
+
export type CibaGrantErrorCode = 'authorization_pending' | 'slow_down' | 'expired_token' | 'access_denied' | 'invalid_grant' | 'invalid_request';
|
|
13
|
+
export declare class CibaGrantError extends Error {
|
|
14
|
+
readonly code: CibaGrantErrorCode;
|
|
15
|
+
readonly errorDescription: string;
|
|
16
|
+
constructor(code: CibaGrantErrorCode, errorDescription: string);
|
|
17
|
+
get statusCode(): 400;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/ciba/errors.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,kCAAkC,GAC1C,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,qBAAqB,GACrB,yBAAyB,CAAC;AAW9B,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,QAAQ,CAAC,IAAI,EAAE,kCAAkC,CAAC;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC,YAAY,IAAI,EAAE,kCAAkC,EAAE,gBAAgB,EAAE,MAAM,EAO7E;IAGD,IAAI,UAAU,IAAI,GAAG,CAEpB;CACF;AAYD,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,UAAU,EAAE,GAAG,GAAG,GAAG,CAAC;IAE/B,YAAY,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,GAAG,EAIjD;CACF;AASD,MAAM,MAAM,kBAAkB,GAC1B,uBAAuB,GACvB,WAAW,GACX,eAAe,GACf,eAAe,GACf,eAAe,GACf,iBAAiB,CAAC;AAWtB,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC,YAAY,IAAI,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,EAO7D;IAGD,IAAI,UAAU,IAAI,GAAG,CAEpB;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { sanitizeErrorDescription } from '@maronn-openid-connect/core';
|
|
2
|
+
export class BackchannelAuthenticationError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
errorDescription;
|
|
5
|
+
constructor(code, errorDescription) {
|
|
6
|
+
const sanitized = sanitizeErrorDescription(errorDescription);
|
|
7
|
+
super(sanitized);
|
|
8
|
+
this.name = 'BackchannelAuthenticationError';
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.errorDescription = sanitized;
|
|
11
|
+
}
|
|
12
|
+
get statusCode() {
|
|
13
|
+
return 400;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export class CibaVerificationError extends Error {
|
|
17
|
+
statusCode;
|
|
18
|
+
constructor(message, statusCode) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = 'CibaVerificationError';
|
|
21
|
+
this.statusCode = statusCode;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class CibaGrantError extends Error {
|
|
25
|
+
code;
|
|
26
|
+
errorDescription;
|
|
27
|
+
constructor(code, errorDescription) {
|
|
28
|
+
const sanitized = sanitizeErrorDescription(errorDescription);
|
|
29
|
+
super(sanitized);
|
|
30
|
+
this.name = 'CibaGrantError';
|
|
31
|
+
this.code = code;
|
|
32
|
+
this.errorDescription = sanitized;
|
|
33
|
+
}
|
|
34
|
+
get statusCode() {
|
|
35
|
+
return 400;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/ciba/errors.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AA0BvE,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAC9C,IAAI,CAAqC;IACzC,gBAAgB,CAAS;IAElC,YAAY,IAAwC,EAAE,gBAAwB;QAE5E,MAAM,SAAS,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;QAC7D,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IACpC,CAAC;IAGD,IAAI,UAAU;QACZ,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAYD,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,UAAU,CAAY;IAE/B,YAAY,OAAe,EAAE,UAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AA0BD,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,IAAI,CAAqB;IACzB,gBAAgB,CAAS;IAElC,YAAY,IAAwB,EAAE,gBAAwB;QAE5D,MAAM,SAAS,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;QAC7D,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IACpC,CAAC;IAGD,IAAI,UAAU;QACZ,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CIBA_GRANT_TYPE, CIBA_LOGIN_TRANSACTION_TTL_SECONDS, createInMemoryCibaAuthenticationRequestStore, createInMemoryCibaLoginTransactionStore, } from './store.js';
|
|
2
|
+
export type { CibaAuthenticationRequestRecord, CibaAuthenticationRequestStore, CibaLoginTransactionRecord, CibaLoginTransactionStore, CibaStatus, } from './store.js';
|
|
3
|
+
export { BackchannelAuthenticationError, CibaGrantError, CibaVerificationError, } from './errors.js';
|
|
4
|
+
export type { BackchannelAuthenticationErrorCode, CibaGrantErrorCode, } from './errors.js';
|
|
5
|
+
export { BINDING_MESSAGE_MAX_LENGTH, processBackchannelAuthenticationRequest, } from './backchannel-authentication-request.js';
|
|
6
|
+
export type { BackchannelAuthenticationResponse, CibaClientInfo, CibaConfig, CibaUserResolver, } from './backchannel-authentication-request.js';
|
|
7
|
+
export { approveCibaRequest, createCibaLoginTransaction, denyCibaRequest, listPendingCibaRequests, recordCibaLoginFailure, validateCibaLoginSubmission, } from './verification.js';
|
|
8
|
+
export { SLOW_DOWN_INTERVAL_INCREMENT, processCibaGrant } from './ciba-grant.js';
|
|
9
|
+
export type { CibaGrantResult } from './ciba-grant.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ciba/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,eAAe,EACf,kCAAkC,EAClC,4CAA4C,EAC5C,uCAAuC,GACxC,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,0BAA0B,EAC1B,yBAAyB,EACzB,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,8BAA8B,EAC9B,cAAc,EACd,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,kCAAkC,EAClC,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,0BAA0B,EAC1B,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,iCAAiC,EACjC,cAAc,EACd,UAAU,EACV,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CIBA_GRANT_TYPE, CIBA_LOGIN_TRANSACTION_TTL_SECONDS, createInMemoryCibaAuthenticationRequestStore, createInMemoryCibaLoginTransactionStore, } from './store.js';
|
|
2
|
+
export { BackchannelAuthenticationError, CibaGrantError, CibaVerificationError, } from './errors.js';
|
|
3
|
+
export { BINDING_MESSAGE_MAX_LENGTH, processBackchannelAuthenticationRequest, } from './backchannel-authentication-request.js';
|
|
4
|
+
export { approveCibaRequest, createCibaLoginTransaction, denyCibaRequest, listPendingCibaRequests, recordCibaLoginFailure, validateCibaLoginSubmission, } from './verification.js';
|
|
5
|
+
export { SLOW_DOWN_INTERVAL_INCREMENT, processCibaGrant } from './ciba-grant.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ciba/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,eAAe,EACf,kCAAkC,EAClC,4CAA4C,EAC5C,uCAAuC,GACxC,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,8BAA8B,EAC9B,cAAc,EACd,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAMrB,OAAO,EACL,0BAA0B,EAC1B,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAQjD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const CIBA_GRANT_TYPE = "urn:openid:params:grant-type:ciba";
|
|
2
|
+
export declare const CIBA_LOGIN_TRANSACTION_TTL_SECONDS = 600;
|
|
3
|
+
export type CibaStatus = 'pending' | 'approved' | 'denied';
|
|
4
|
+
export interface CibaAuthenticationRequestRecord {
|
|
5
|
+
authReqId: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
subject: string;
|
|
8
|
+
scope: string[];
|
|
9
|
+
bindingMessage?: string;
|
|
10
|
+
acrValues?: string;
|
|
11
|
+
status: CibaStatus;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
expiresAt: Date;
|
|
14
|
+
interval: number;
|
|
15
|
+
lastPolledAt: Date | null;
|
|
16
|
+
csrfToken: string | null;
|
|
17
|
+
authTime?: number;
|
|
18
|
+
approvedScope?: string[];
|
|
19
|
+
grantId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CibaAuthenticationRequestStore {
|
|
22
|
+
save(record: CibaAuthenticationRequestRecord): Promise<void>;
|
|
23
|
+
findByAuthReqId(authReqId: string): Promise<CibaAuthenticationRequestRecord | null>;
|
|
24
|
+
listPendingBySubject(subject: string): Promise<CibaAuthenticationRequestRecord[]>;
|
|
25
|
+
update(record: CibaAuthenticationRequestRecord): Promise<void>;
|
|
26
|
+
delete(authReqId: string): Promise<void>;
|
|
27
|
+
consume(authReqId: string): Promise<CibaAuthenticationRequestRecord | null>;
|
|
28
|
+
}
|
|
29
|
+
export interface CibaLoginTransactionRecord {
|
|
30
|
+
id: string;
|
|
31
|
+
csrfToken: string;
|
|
32
|
+
bindingHash: string;
|
|
33
|
+
loginAttempts: number;
|
|
34
|
+
expiresAt: Date;
|
|
35
|
+
}
|
|
36
|
+
export interface CibaLoginTransactionStore {
|
|
37
|
+
save(record: CibaLoginTransactionRecord): Promise<void>;
|
|
38
|
+
findById(id: string): Promise<CibaLoginTransactionRecord | null>;
|
|
39
|
+
update(record: CibaLoginTransactionRecord): Promise<void>;
|
|
40
|
+
delete(id: string): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
export declare function createInMemoryCibaAuthenticationRequestStore(): CibaAuthenticationRequestStore;
|
|
43
|
+
export declare function createInMemoryCibaLoginTransactionStore(): CibaLoginTransactionStore;
|
|
44
|
+
//# sourceMappingURL=store.d.ts.map
|
|
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IAczC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,+BAA+B,GAAG,IAAI,CAAC,CAAC;CAC7E;AASD,MAAM,WAAW,0BAA0B;IAEzC,EAAE,EAAE,MAAM,CAAC;IAEX,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;IAEpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAQD,wBAAgB,4CAA4C,IAAI,8BAA8B,CAiD7F;AAOD,wBAAgB,uCAAuC,IAAI,yBAAyB,CAyBnF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const CIBA_GRANT_TYPE = 'urn:openid:params:grant-type:ciba';
|
|
2
|
+
export const CIBA_LOGIN_TRANSACTION_TTL_SECONDS = 600;
|
|
3
|
+
export function createInMemoryCibaAuthenticationRequestStore() {
|
|
4
|
+
const records = new Map();
|
|
5
|
+
const evictionGraceMs = 600 * 1000;
|
|
6
|
+
const evictExpired = () => {
|
|
7
|
+
const cutoff = Date.now() - evictionGraceMs;
|
|
8
|
+
for (const [authReqId, record] of records) {
|
|
9
|
+
if (record.expiresAt.getTime() < cutoff) {
|
|
10
|
+
records.delete(authReqId);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
async save(record) {
|
|
16
|
+
evictExpired();
|
|
17
|
+
records.set(record.authReqId, record);
|
|
18
|
+
},
|
|
19
|
+
async findByAuthReqId(authReqId) {
|
|
20
|
+
return records.get(authReqId) ?? null;
|
|
21
|
+
},
|
|
22
|
+
async listPendingBySubject(subject) {
|
|
23
|
+
const now = Date.now();
|
|
24
|
+
const pending = [];
|
|
25
|
+
for (const record of records.values()) {
|
|
26
|
+
if (record.subject === subject &&
|
|
27
|
+
record.status === 'pending' &&
|
|
28
|
+
record.expiresAt.getTime() > now) {
|
|
29
|
+
pending.push(record);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return pending;
|
|
33
|
+
},
|
|
34
|
+
async update(record) {
|
|
35
|
+
records.set(record.authReqId, record);
|
|
36
|
+
},
|
|
37
|
+
async delete(authReqId) {
|
|
38
|
+
records.delete(authReqId);
|
|
39
|
+
},
|
|
40
|
+
async consume(authReqId) {
|
|
41
|
+
const record = records.get(authReqId) ?? null;
|
|
42
|
+
records.delete(authReqId);
|
|
43
|
+
return record;
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function createInMemoryCibaLoginTransactionStore() {
|
|
48
|
+
const records = new Map();
|
|
49
|
+
const evictExpired = () => {
|
|
50
|
+
const now = Date.now();
|
|
51
|
+
for (const [id, record] of records) {
|
|
52
|
+
if (record.expiresAt.getTime() < now) {
|
|
53
|
+
records.delete(id);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
async save(record) {
|
|
59
|
+
evictExpired();
|
|
60
|
+
records.set(record.id, record);
|
|
61
|
+
},
|
|
62
|
+
async findById(id) {
|
|
63
|
+
return records.get(id) ?? null;
|
|
64
|
+
},
|
|
65
|
+
async update(record) {
|
|
66
|
+
records.set(record.id, record);
|
|
67
|
+
},
|
|
68
|
+
async delete(id) {
|
|
69
|
+
records.delete(id);
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +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,IAAI,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,MAAkC;YAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,EAAU;YACrB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type CibaAuthenticationRequestRecord, type CibaAuthenticationRequestStore, type CibaLoginTransactionRecord, type CibaLoginTransactionStore } from './store.js';
|
|
2
|
+
export declare function createCibaLoginTransaction(store: CibaLoginTransactionStore): Promise<{
|
|
3
|
+
record: CibaLoginTransactionRecord;
|
|
4
|
+
bindingSecret: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function validateCibaLoginSubmission(input: {
|
|
7
|
+
transactionId: string;
|
|
8
|
+
csrfToken: string;
|
|
9
|
+
bindingSecret: string | null | undefined;
|
|
10
|
+
store: CibaLoginTransactionStore;
|
|
11
|
+
now?: Date;
|
|
12
|
+
}): Promise<CibaLoginTransactionRecord>;
|
|
13
|
+
export declare function recordCibaLoginFailure(record: CibaLoginTransactionRecord, store: CibaLoginTransactionStore, maxLoginAttempts: number): Promise<{
|
|
14
|
+
canRetry: boolean;
|
|
15
|
+
remainingAttempts: number;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function listPendingCibaRequests(input: {
|
|
18
|
+
subject: string;
|
|
19
|
+
store: CibaAuthenticationRequestStore;
|
|
20
|
+
}): Promise<CibaAuthenticationRequestRecord[]>;
|
|
21
|
+
export declare function approveCibaRequest(input: {
|
|
22
|
+
authReqId: string;
|
|
23
|
+
subject: string;
|
|
24
|
+
csrfToken: string;
|
|
25
|
+
authTime: number;
|
|
26
|
+
grantId: string;
|
|
27
|
+
store: CibaAuthenticationRequestStore;
|
|
28
|
+
now?: Date;
|
|
29
|
+
}): Promise<CibaAuthenticationRequestRecord>;
|
|
30
|
+
export declare function denyCibaRequest(input: {
|
|
31
|
+
authReqId: string;
|
|
32
|
+
subject: string;
|
|
33
|
+
csrfToken: string;
|
|
34
|
+
store: CibaAuthenticationRequestStore;
|
|
35
|
+
now?: Date;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/ciba/verification.ts"],"names":[],"mappings":"AAgCA,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAC;AAwCpB,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC;IAAE,MAAM,EAAE,0BAA0B,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAWxE;AAWD,wBAAsB,2BAA2B,CAAC,KAAK,EAAE;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAElB,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,KAAK,EAAE,yBAAyB,CAAC;IACjC,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAetC;AAWD,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,0BAA0B,EAClC,KAAK,EAAE,yBAAyB,EAChC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAY3D;AASD,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,8BAA8B,CAAC;CACvC,GAAG,OAAO,CAAC,+BAA+B,EAAE,CAAC,CAO7C;A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