@absolutejs/auth 0.56.12 → 0.56.14
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 +14 -0
- package/dist/agents/config.d.ts +5 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.js +132 -8
- package/dist/agents/index.js.map +8 -7
- package/dist/agents/oauthGuide.d.ts +18 -0
- package/dist/agents/oidcAdapter.d.ts +11 -3
- package/dist/agents/routes.d.ts +1 -66
- package/dist/index.d.ts +4 -22
- package/dist/index.js +172 -24
- package/dist/index.js.map +13 -12
- package/dist/oidc/config.d.ts +5 -1
- package/dist/oidc/index.d.ts +1 -1
- package/dist/oidc/index.js +23 -1
- package/dist/oidc/index.js.map +3 -3
- package/dist/oidc/keys.d.ts +22 -7
- package/dist/server.js +167 -24
- package/dist/server.js.map +13 -12
- package/docs/AGENT-AUTH.md +7 -0
- package/package.json +1 -1
package/dist/oidc/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteString } from '../types';
|
|
2
|
-
import { type SigningKey } from './keys';
|
|
2
|
+
import { type SigningKey, type SigningKeyIdentity } from './keys';
|
|
3
3
|
import type { OnClientRegistered, OnClientRegistration } from './registration';
|
|
4
4
|
import type { VciConfig } from './vci';
|
|
5
5
|
import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore } from './types';
|
|
@@ -107,6 +107,10 @@ export type OidcProviderConfig<UserType> = {
|
|
|
107
107
|
pushedAuthorizationRequestTtlMs?: number;
|
|
108
108
|
refreshTokenStore: OidcRefreshTokenStore;
|
|
109
109
|
refreshTokenTtlMs?: number;
|
|
110
|
+
/** Previous public signing identities retained only for the bounded token
|
|
111
|
+
* overlap window after rotation. The active `signingKey` always signs new
|
|
112
|
+
* tokens and is published first. Private material does not belong here. */
|
|
113
|
+
previousSigningKeys?: readonly SigningKeyIdentity[];
|
|
110
114
|
signingKey: SigningKey;
|
|
111
115
|
strictFapi?: boolean;
|
|
112
116
|
vciConfig?: VciConfig;
|
package/dist/oidc/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* through the package root.
|
|
7
7
|
*/
|
|
8
8
|
export type { OidcProviderConfig } from './config';
|
|
9
|
-
export { generateSigningKey, jwkThumbprint, signJwt, toPublicJwk, verifyJwt, type SigningKey } from './keys';
|
|
9
|
+
export { generateSigningKey, jwkThumbprint, signJwt, signingVerificationKeys, toPublicJwk, verifyJwt, verifyJwtWithKeys, type SigningKey, type SigningKeyIdentity } from './keys';
|
|
10
10
|
export { revokeOAuthClientCredentials } from './operator';
|
|
11
11
|
export { createNeonAuthorizationCodeStore, createNeonClientAssertionJtiStore, createNeonClientRegistrationTokenStore, createNeonDeviceAuthorizationStore, createNeonInitialAccessTokenStore, createNeonOAuthClientStore, createNeonOidcRefreshTokenStore, createPostgresAuthorizationCodeStore, createPostgresClientAssertionJtiStore, createPostgresClientRegistrationTokenStore, createPostgresDeviceAuthorizationStore, createPostgresInitialAccessTokenStore, createPostgresOAuthClientStore, createPostgresOidcRefreshTokenStore } from './postgresStores';
|
|
12
12
|
export type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, OAuthClient, OAuthClientStore, OidcRefreshTokenConnection, OidcRefreshTokenStore } from './types';
|
package/dist/oidc/index.js
CHANGED
|
@@ -125,6 +125,26 @@ var verifyJwt = async (token, publicJwk) => {
|
|
|
125
125
|
payload
|
|
126
126
|
};
|
|
127
127
|
};
|
|
128
|
+
var signingVerificationKeys = (active, previous = []) => {
|
|
129
|
+
const keys = [active, ...previous];
|
|
130
|
+
const keyIds = new Set(keys.map(({ kid }) => kid));
|
|
131
|
+
if (keyIds.size !== keys.length)
|
|
132
|
+
throw new Error("OIDC signing key IDs must be unique");
|
|
133
|
+
return keys;
|
|
134
|
+
};
|
|
135
|
+
var verifyJwtWithKeys = async (token, keys) => {
|
|
136
|
+
const [headerSegment] = token.split(".");
|
|
137
|
+
if (!headerSegment)
|
|
138
|
+
return;
|
|
139
|
+
const header = decodeSegment(headerSegment);
|
|
140
|
+
const kid = header?.kid;
|
|
141
|
+
if (typeof kid !== "string" || kid.length === 0)
|
|
142
|
+
return;
|
|
143
|
+
const key = keys.find((candidate) => candidate.kid === kid);
|
|
144
|
+
if (!key)
|
|
145
|
+
return;
|
|
146
|
+
return verifyJwt(token, key.publicJwk);
|
|
147
|
+
};
|
|
128
148
|
// src/oidc/operator.ts
|
|
129
149
|
var operatorDelete = (store, storeName) => {
|
|
130
150
|
if (!store.deleteForClient)
|
|
@@ -12188,8 +12208,10 @@ var createPostgresBackchannelAuthStore = (db) => ({
|
|
|
12188
12208
|
}
|
|
12189
12209
|
});
|
|
12190
12210
|
export {
|
|
12211
|
+
verifyJwtWithKeys,
|
|
12191
12212
|
verifyJwt,
|
|
12192
12213
|
toPublicJwk,
|
|
12214
|
+
signingVerificationKeys,
|
|
12193
12215
|
signJwt,
|
|
12194
12216
|
revokeOAuthClientCredentials,
|
|
12195
12217
|
jwkThumbprint,
|
|
@@ -12210,5 +12232,5 @@ export {
|
|
|
12210
12232
|
createNeonAuthorizationCodeStore
|
|
12211
12233
|
};
|
|
12212
12234
|
|
|
12213
|
-
//# debugId=
|
|
12235
|
+
//# debugId=09059391C2D6086264756E2164756E21
|
|
12214
12236
|
//# sourceMappingURL=index.js.map
|