axiam-sdk 1.0.0 → 1.1.1
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 +100 -12
- package/dist/amqp/index.d.cts +3 -2
- package/dist/amqp/index.d.ts +3 -2
- package/dist/{authzCore-BQfX9qxN.d.cts → authzCore-CqXzLNmT.d.cts} +4 -3
- package/dist/{authzCore-BlSHwGnW.d.ts → authzCore-D-hquWSI.d.ts} +4 -3
- package/dist/browser/index.d.cts +8 -7
- package/dist/browser/index.d.ts +8 -7
- package/dist/{client-0WJkblDE.d.ts → client-BMNQi36J.d.ts} +646 -16
- package/dist/{client-yD0eMwHQ.d.cts → client-D34sXV8p.d.cts} +646 -16
- package/dist/{cookieJar-CTD5jOmd.d.cts → cookieJar-C_xPuniu.d.cts} +3 -3
- package/dist/{cookieJar-hWRmZkhe.d.ts → cookieJar-DcrMe93Q.d.ts} +3 -3
- package/dist/{errors-DMIlw2lN.d.ts → errors-DZ3k8a8i.d.cts} +2 -1
- package/dist/{errors-DMIlw2lN.d.cts → errors-DZ3k8a8i.d.ts} +2 -1
- package/dist/{errors-m0Tue_pE.d.cts → errors-RvGlTyUj.d.cts} +18 -3
- package/dist/{errors-CmBvsxV0.d.ts → errors-dlGXAsbh.d.ts} +18 -3
- package/dist/grpc/index.d.cts +10 -9
- package/dist/grpc/index.d.ts +10 -9
- package/dist/grpc/index.js +604 -15
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +604 -15
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +626 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +624 -17
- package/dist/index.mjs.map +1 -1
- package/dist/{jwks-BR55d7-Z.d.cts → jwks-CTVpOWzI.d.cts} +2 -1
- package/dist/{jwks-BR55d7-Z.d.ts → jwks-CTVpOWzI.d.ts} +2 -1
- package/dist/middleware/index.d.cts +13 -12
- package/dist/middleware/index.d.ts +13 -12
- package/dist/middleware/index.js +53 -12
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +53 -12
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/nestjs/index.d.cts +5 -4
- package/dist/nestjs/index.d.ts +5 -4
- package/dist/node/index.d.cts +10 -9
- package/dist/node/index.d.ts +10 -9
- package/dist/node/index.js +631 -19
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +631 -19
- package/dist/node/index.mjs.map +1 -1
- package/dist/{oidcState-mQLVn3-A.d.cts → oidcState-BFIHt7_Y.d.cts} +29 -7
- package/dist/{oidcState-DOSCgnMG.d.ts → oidcState-qoy2vsYG.d.ts} +29 -7
- package/dist/rest/index.d.cts +64 -12
- package/dist/rest/index.d.ts +64 -12
- package/dist/rest/index.js +626 -16
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +624 -17
- package/dist/rest/index.mjs.map +1 -1
- package/dist/{revocationFeed-CDoD7Twr.d.cts → revocationFeed-KQhvMMl8.d.cts} +2 -1
- package/dist/{revocationFeed-CDoD7Twr.d.ts → revocationFeed-KQhvMMl8.d.ts} +2 -1
- package/dist/{session-CeG6P9GO.d.ts → session-BbPFTpMZ.d.ts} +3 -2
- package/dist/{session-BmjEMowX.d.cts → session-C9WlP6DV.d.cts} +3 -2
- package/dist/{telemetry--0DwnNjV.d.cts → telemetry-Du0-zS5f.d.cts} +2 -1
- package/dist/{telemetry--0DwnNjV.d.ts → telemetry-Du0-zS5f.d.ts} +2 -1
- package/dist/{webauthnErrors-fLgfOflO.d.cts → webauthnErrors-m1LZiaRy.d.cts} +2 -1
- package/dist/{webauthnErrors-fLgfOflO.d.ts → webauthnErrors-m1LZiaRy.d.ts} +2 -1
- package/package.json +2 -2
|
@@ -397,4 +397,5 @@ declare function createJwksVerifier(jwksUri: string): JwksVerifier;
|
|
|
397
397
|
*/
|
|
398
398
|
declare function assertTenantClaim(claim: unknown, expected: string | undefined): void;
|
|
399
399
|
|
|
400
|
-
export {
|
|
400
|
+
export { JWKS_PATH as J, MAX_CLOCK_SKEW_SEC as M, CLOCK_SKEW_LEEWAY_SEC as b, createVerifier as c, ID_TOKEN_ALG as d, assertTenantClaim as h, certificateThumbprintS256 as i, createJwksVerifier as j, verifyTokenBinding as k, verifyCertificateBinding as v };
|
|
401
|
+
export type { AxiamClaims as A, CnfClaim as C, IdTokenClaims as I, PresentedProofs as P, Verifier as V, AccessTokenExpectations as a, IdTokenExpectations as e, IdTokenVerifier as f, JwksVerifier as g };
|
|
@@ -397,4 +397,5 @@ declare function createJwksVerifier(jwksUri: string): JwksVerifier;
|
|
|
397
397
|
*/
|
|
398
398
|
declare function assertTenantClaim(claim: unknown, expected: string | undefined): void;
|
|
399
399
|
|
|
400
|
-
export {
|
|
400
|
+
export { JWKS_PATH as J, MAX_CLOCK_SKEW_SEC as M, CLOCK_SKEW_LEEWAY_SEC as b, createVerifier as c, ID_TOKEN_ALG as d, assertTenantClaim as h, certificateThumbprintS256 as i, createJwksVerifier as j, verifyTokenBinding as k, verifyCertificateBinding as v };
|
|
401
|
+
export type { AxiamClaims as A, CnfClaim as C, IdTokenClaims as I, PresentedProofs as P, Verifier as V, AccessTokenExpectations as a, IdTokenExpectations as e, IdTokenVerifier as f, JwksVerifier as g };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Request, RequestHandler, Router } from 'express';
|
|
2
|
-
import { a as AuthzLogger, E as ErrorBody, b as AxiamIdentity, V as VerifiableSession, A as AuthzVerifiableSession, c as ResourceSpec, R as RequireAccessOptions } from '../authzCore-
|
|
3
|
-
export { d as AuthzChecker, C as CheckOutcome, e as ResourceParamRef, f as ResourceResolutionError, g as ResourceResolver, U as UmaChallenger, h as UmaTicketMinter, i as assertAuthzClient, j as authenticateRequest, k as evaluateAccess, l as fromParam, m as hasAnyRole, r as resolveResourceId } from '../authzCore-
|
|
4
|
-
import { P as OidcClient, W as OidcStateStore, X as OidcTokenSet, V as OidcStateEntry } from '../oidcState-
|
|
5
|
-
export { a as AuthorizationRequest, c as CibaAwaitParams, d as CibaClock, e as CibaDelivery, f as CibaInitiateParams, g as CibaInitiateResponse, h as CibaPingHeaders, i as CibaPollParams, j as CibaRequestSigner, k as CibaSignerDescription, l as CibaSigningAlg, m as CibaSigningKey, n as CibaUserHint, r as DeviceAuthorization, s as DeviceAuthorizeParams, t as DeviceLoginParams, u as DevicePollParams, E as ExchangedToken, F as FederationProvider, v as FederationProviderList, H as HANDOFF_CODE_TTL_SECS, w as HANDOFF_QUERY_PARAM, I as IntrospectParams, x as IntrospectionResult, L as LoginClientCredentialsParams, y as LogoutUrlParams, z as MIN_DISCOVERY_TTL_MS, G as MemoryOidcStateStore, K as MtlsEndpointAliases, O as OIDC_STATE_TTL_MS, N as OidcBeginParams, Q as OidcClientOptions, R as OidcConfiguration, S as OidcExchangeParams, T as OidcParParams, U as OidcRefreshParams, Y as PROTOCOL_OAUTH2, Z as PROTOCOL_OIDC_CONNECT, _ as PROTOCOL_SAML, a0 as PushedAuthorizationRequest, a1 as RequestedPermission, a2 as RequestingPartyToken, a3 as ResourceSet, a4 as RevokeParams, ae as SsoCompleteHandoffParams, af as SsoCompleteOauth2Params, ag as SsoCompleteParams, ah as SsoCompleteResult, ai as SsoProvidersParams, aj as SsoStartOauth2Params, ak as SsoStartParams, al as SsoStartResult, an as TokenExchangeParams, as as UmaExchangeTicketParams, at as VerifiedLogoutToken, au as createOidcClient, av as isAccessDenied, aw as isExpiredToken } from '../oidcState-
|
|
2
|
+
import { a as AuthzLogger, E as ErrorBody, b as AxiamIdentity, V as VerifiableSession, A as AuthzVerifiableSession, c as ResourceSpec, R as RequireAccessOptions } from '../authzCore-CqXzLNmT.cjs';
|
|
3
|
+
export { d as AuthzChecker, C as CheckOutcome, e as ResourceParamRef, f as ResourceResolutionError, g as ResourceResolver, U as UmaChallenger, h as UmaTicketMinter, i as assertAuthzClient, j as authenticateRequest, k as evaluateAccess, l as fromParam, m as hasAnyRole, r as resolveResourceId } from '../authzCore-CqXzLNmT.cjs';
|
|
4
|
+
import { P as OidcClient, W as OidcStateStore, X as OidcTokenSet, V as OidcStateEntry } from '../oidcState-BFIHt7_Y.cjs';
|
|
5
|
+
export { a as AuthorizationRequest, c as CibaAwaitParams, d as CibaClock, e as CibaDelivery, f as CibaInitiateParams, g as CibaInitiateResponse, h as CibaPingHeaders, i as CibaPollParams, j as CibaRequestSigner, k as CibaSignerDescription, l as CibaSigningAlg, m as CibaSigningKey, n as CibaUserHint, r as DeviceAuthorization, s as DeviceAuthorizeParams, t as DeviceLoginParams, u as DevicePollParams, E as ExchangedToken, F as FederationProvider, v as FederationProviderList, H as HANDOFF_CODE_TTL_SECS, w as HANDOFF_QUERY_PARAM, I as IntrospectParams, x as IntrospectionResult, L as LoginClientCredentialsParams, y as LogoutUrlParams, z as MIN_DISCOVERY_TTL_MS, G as MemoryOidcStateStore, K as MtlsEndpointAliases, O as OIDC_STATE_TTL_MS, N as OidcBeginParams, Q as OidcClientOptions, R as OidcConfiguration, S as OidcExchangeParams, T as OidcParParams, U as OidcRefreshParams, Y as PROTOCOL_OAUTH2, Z as PROTOCOL_OIDC_CONNECT, _ as PROTOCOL_SAML, a0 as PushedAuthorizationRequest, a1 as RequestedPermission, a2 as RequestingPartyToken, a3 as ResourceSet, a4 as RevokeParams, ae as SsoCompleteHandoffParams, af as SsoCompleteOauth2Params, ag as SsoCompleteParams, ah as SsoCompleteResult, ai as SsoProvidersParams, aj as SsoStartOauth2Params, ak as SsoStartParams, al as SsoStartResult, an as TokenExchangeParams, as as UmaExchangeTicketParams, at as VerifiedLogoutToken, au as createOidcClient, av as isAccessDenied, aw as isExpiredToken } from '../oidcState-BFIHt7_Y.cjs';
|
|
6
6
|
import { FastifyRequest, FastifyReply, FastifyPluginAsync, FastifyInstance } from 'fastify';
|
|
7
|
-
export { F as FieldError, V as ValidationError } from '../errors-
|
|
8
|
-
import { P as PresentedProofs } from '../jwks-
|
|
9
|
-
export { a as AccessTokenExpectations, A as AxiamClaims, b as CLOCK_SKEW_LEEWAY_SEC, C as CnfClaim, I as IdTokenClaims, V as Verifier, h as assertTenantClaim, i as certificateThumbprintS256, v as verifyCertificateBinding, k as verifyTokenBinding } from '../jwks-
|
|
10
|
-
export { D as DEFAULT_POLL_INTERVAL_MS, M as MAX_ENTRIES, a as MIN_POLL_INTERVAL_MS, R as RevocationFeed, b as RevocationFeedOptions } from '../revocationFeed-
|
|
7
|
+
export { F as FieldError, V as ValidationError } from '../errors-RvGlTyUj.cjs';
|
|
8
|
+
import { P as PresentedProofs } from '../jwks-CTVpOWzI.cjs';
|
|
9
|
+
export { a as AccessTokenExpectations, A as AxiamClaims, b as CLOCK_SKEW_LEEWAY_SEC, C as CnfClaim, I as IdTokenClaims, V as Verifier, h as assertTenantClaim, i as certificateThumbprintS256, v as verifyCertificateBinding, k as verifyTokenBinding } from '../jwks-CTVpOWzI.cjs';
|
|
10
|
+
export { D as DEFAULT_POLL_INTERVAL_MS, M as MAX_ENTRIES, a as MIN_POLL_INTERVAL_MS, R as RevocationFeed, b as RevocationFeedOptions } from '../revocationFeed-KQhvMMl8.cjs';
|
|
11
11
|
import '../sensitive-BC_s7Rrd.cjs';
|
|
12
12
|
import '../types-zXSpiQM-.cjs';
|
|
13
13
|
import 'node:crypto';
|
|
14
|
-
import '../errors-
|
|
15
|
-
import '../session-
|
|
14
|
+
import '../errors-DZ3k8a8i.cjs';
|
|
15
|
+
import '../session-C9WlP6DV.cjs';
|
|
16
16
|
import 'axios';
|
|
17
|
-
import '../telemetry
|
|
17
|
+
import '../telemetry-Du0-zS5f.cjs';
|
|
18
18
|
|
|
19
19
|
/** Configuration shared by the login and callback handlers (CONTRACT.md §12). */
|
|
20
20
|
interface OidcLoginOptions {
|
|
@@ -662,4 +662,5 @@ declare function isSafeMethod(method: string | undefined): boolean;
|
|
|
662
662
|
*/
|
|
663
663
|
declare function isCsrfValid(cookieHeader: string | undefined, csrfHeaderValue: string | undefined): boolean;
|
|
664
664
|
|
|
665
|
-
export { ACCESS_COOKIE_NAME, AuthzLogger, AuthzVerifiableSession,
|
|
665
|
+
export { ACCESS_COOKIE_NAME, AuthzLogger, AuthzVerifiableSession, AxiamIdentity, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, ErrorBody, OidcClient, OidcStateEntry, OidcStateStore, OidcTokenSet, PROTECTED_RESOURCE_METADATA_PREFIX, PresentedProofs, RequireAccessOptions, ResourceSpec, VerifiableSession, axiamMiddleware, axiamPlugin, bearerChallenge, beginOidcLogin, certificateProofFromSocket, completeOidcLogin, extractCredential, extractToken, isCsrfValid, isSafeMethod, oidcLoginHandlers, oidcLoginPlugin, parseCookieHeader, protectedResourceMetadata, requireAccess, requireAccessHook, requireAuth, requireAuthHook, requireRole, requireRoleHook, serveProtectedResourceMetadata };
|
|
666
|
+
export type { AxiamFastifyRequest, AxiamRequest, BearerChallengeError, BearerChallengeOptions, CredentialSource, ExtractedCredential, McpGuardConfig, McpMetadataApp, OidcCallbackQuery, OidcLoginOptions, OidcLoginOutcome, OidcLoginRoutePaths, OidcLoginSuccessBody, PeerCertificateLike, PeerCertificateSocket, PreHandlerHook, ProtectedResourceMetadata, ProtectedResourceMetadataDocument, ProtectedResourceMetadataOptions };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Request, RequestHandler, Router } from 'express';
|
|
2
|
-
import { a as AuthzLogger, E as ErrorBody, b as AxiamIdentity, V as VerifiableSession, A as AuthzVerifiableSession, c as ResourceSpec, R as RequireAccessOptions } from '../authzCore-
|
|
3
|
-
export { d as AuthzChecker, C as CheckOutcome, e as ResourceParamRef, f as ResourceResolutionError, g as ResourceResolver, U as UmaChallenger, h as UmaTicketMinter, i as assertAuthzClient, j as authenticateRequest, k as evaluateAccess, l as fromParam, m as hasAnyRole, r as resolveResourceId } from '../authzCore-
|
|
4
|
-
import { P as OidcClient, W as OidcStateStore, X as OidcTokenSet, V as OidcStateEntry } from '../oidcState-
|
|
5
|
-
export { a as AuthorizationRequest, c as CibaAwaitParams, d as CibaClock, e as CibaDelivery, f as CibaInitiateParams, g as CibaInitiateResponse, h as CibaPingHeaders, i as CibaPollParams, j as CibaRequestSigner, k as CibaSignerDescription, l as CibaSigningAlg, m as CibaSigningKey, n as CibaUserHint, r as DeviceAuthorization, s as DeviceAuthorizeParams, t as DeviceLoginParams, u as DevicePollParams, E as ExchangedToken, F as FederationProvider, v as FederationProviderList, H as HANDOFF_CODE_TTL_SECS, w as HANDOFF_QUERY_PARAM, I as IntrospectParams, x as IntrospectionResult, L as LoginClientCredentialsParams, y as LogoutUrlParams, z as MIN_DISCOVERY_TTL_MS, G as MemoryOidcStateStore, K as MtlsEndpointAliases, O as OIDC_STATE_TTL_MS, N as OidcBeginParams, Q as OidcClientOptions, R as OidcConfiguration, S as OidcExchangeParams, T as OidcParParams, U as OidcRefreshParams, Y as PROTOCOL_OAUTH2, Z as PROTOCOL_OIDC_CONNECT, _ as PROTOCOL_SAML, a0 as PushedAuthorizationRequest, a1 as RequestedPermission, a2 as RequestingPartyToken, a3 as ResourceSet, a4 as RevokeParams, ae as SsoCompleteHandoffParams, af as SsoCompleteOauth2Params, ag as SsoCompleteParams, ah as SsoCompleteResult, ai as SsoProvidersParams, aj as SsoStartOauth2Params, ak as SsoStartParams, al as SsoStartResult, an as TokenExchangeParams, as as UmaExchangeTicketParams, at as VerifiedLogoutToken, au as createOidcClient, av as isAccessDenied, aw as isExpiredToken } from '../oidcState-
|
|
2
|
+
import { a as AuthzLogger, E as ErrorBody, b as AxiamIdentity, V as VerifiableSession, A as AuthzVerifiableSession, c as ResourceSpec, R as RequireAccessOptions } from '../authzCore-D-hquWSI.js';
|
|
3
|
+
export { d as AuthzChecker, C as CheckOutcome, e as ResourceParamRef, f as ResourceResolutionError, g as ResourceResolver, U as UmaChallenger, h as UmaTicketMinter, i as assertAuthzClient, j as authenticateRequest, k as evaluateAccess, l as fromParam, m as hasAnyRole, r as resolveResourceId } from '../authzCore-D-hquWSI.js';
|
|
4
|
+
import { P as OidcClient, W as OidcStateStore, X as OidcTokenSet, V as OidcStateEntry } from '../oidcState-qoy2vsYG.js';
|
|
5
|
+
export { a as AuthorizationRequest, c as CibaAwaitParams, d as CibaClock, e as CibaDelivery, f as CibaInitiateParams, g as CibaInitiateResponse, h as CibaPingHeaders, i as CibaPollParams, j as CibaRequestSigner, k as CibaSignerDescription, l as CibaSigningAlg, m as CibaSigningKey, n as CibaUserHint, r as DeviceAuthorization, s as DeviceAuthorizeParams, t as DeviceLoginParams, u as DevicePollParams, E as ExchangedToken, F as FederationProvider, v as FederationProviderList, H as HANDOFF_CODE_TTL_SECS, w as HANDOFF_QUERY_PARAM, I as IntrospectParams, x as IntrospectionResult, L as LoginClientCredentialsParams, y as LogoutUrlParams, z as MIN_DISCOVERY_TTL_MS, G as MemoryOidcStateStore, K as MtlsEndpointAliases, O as OIDC_STATE_TTL_MS, N as OidcBeginParams, Q as OidcClientOptions, R as OidcConfiguration, S as OidcExchangeParams, T as OidcParParams, U as OidcRefreshParams, Y as PROTOCOL_OAUTH2, Z as PROTOCOL_OIDC_CONNECT, _ as PROTOCOL_SAML, a0 as PushedAuthorizationRequest, a1 as RequestedPermission, a2 as RequestingPartyToken, a3 as ResourceSet, a4 as RevokeParams, ae as SsoCompleteHandoffParams, af as SsoCompleteOauth2Params, ag as SsoCompleteParams, ah as SsoCompleteResult, ai as SsoProvidersParams, aj as SsoStartOauth2Params, ak as SsoStartParams, al as SsoStartResult, an as TokenExchangeParams, as as UmaExchangeTicketParams, at as VerifiedLogoutToken, au as createOidcClient, av as isAccessDenied, aw as isExpiredToken } from '../oidcState-qoy2vsYG.js';
|
|
6
6
|
import { FastifyRequest, FastifyReply, FastifyPluginAsync, FastifyInstance } from 'fastify';
|
|
7
|
-
export { F as FieldError, V as ValidationError } from '../errors-
|
|
8
|
-
import { P as PresentedProofs } from '../jwks-
|
|
9
|
-
export { a as AccessTokenExpectations, A as AxiamClaims, b as CLOCK_SKEW_LEEWAY_SEC, C as CnfClaim, I as IdTokenClaims, V as Verifier, h as assertTenantClaim, i as certificateThumbprintS256, v as verifyCertificateBinding, k as verifyTokenBinding } from '../jwks-
|
|
10
|
-
export { D as DEFAULT_POLL_INTERVAL_MS, M as MAX_ENTRIES, a as MIN_POLL_INTERVAL_MS, R as RevocationFeed, b as RevocationFeedOptions } from '../revocationFeed-
|
|
7
|
+
export { F as FieldError, V as ValidationError } from '../errors-dlGXAsbh.js';
|
|
8
|
+
import { P as PresentedProofs } from '../jwks-CTVpOWzI.js';
|
|
9
|
+
export { a as AccessTokenExpectations, A as AxiamClaims, b as CLOCK_SKEW_LEEWAY_SEC, C as CnfClaim, I as IdTokenClaims, V as Verifier, h as assertTenantClaim, i as certificateThumbprintS256, v as verifyCertificateBinding, k as verifyTokenBinding } from '../jwks-CTVpOWzI.js';
|
|
10
|
+
export { D as DEFAULT_POLL_INTERVAL_MS, M as MAX_ENTRIES, a as MIN_POLL_INTERVAL_MS, R as RevocationFeed, b as RevocationFeedOptions } from '../revocationFeed-KQhvMMl8.js';
|
|
11
11
|
import '../sensitive-BC_s7Rrd.js';
|
|
12
12
|
import '../types-BOX-6Srv.js';
|
|
13
13
|
import 'node:crypto';
|
|
14
|
-
import '../errors-
|
|
15
|
-
import '../session-
|
|
14
|
+
import '../errors-DZ3k8a8i.js';
|
|
15
|
+
import '../session-BbPFTpMZ.js';
|
|
16
16
|
import 'axios';
|
|
17
|
-
import '../telemetry
|
|
17
|
+
import '../telemetry-Du0-zS5f.js';
|
|
18
18
|
|
|
19
19
|
/** Configuration shared by the login and callback handlers (CONTRACT.md §12). */
|
|
20
20
|
interface OidcLoginOptions {
|
|
@@ -662,4 +662,5 @@ declare function isSafeMethod(method: string | undefined): boolean;
|
|
|
662
662
|
*/
|
|
663
663
|
declare function isCsrfValid(cookieHeader: string | undefined, csrfHeaderValue: string | undefined): boolean;
|
|
664
664
|
|
|
665
|
-
export { ACCESS_COOKIE_NAME, AuthzLogger, AuthzVerifiableSession,
|
|
665
|
+
export { ACCESS_COOKIE_NAME, AuthzLogger, AuthzVerifiableSession, AxiamIdentity, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, ErrorBody, OidcClient, OidcStateEntry, OidcStateStore, OidcTokenSet, PROTECTED_RESOURCE_METADATA_PREFIX, PresentedProofs, RequireAccessOptions, ResourceSpec, VerifiableSession, axiamMiddleware, axiamPlugin, bearerChallenge, beginOidcLogin, certificateProofFromSocket, completeOidcLogin, extractCredential, extractToken, isCsrfValid, isSafeMethod, oidcLoginHandlers, oidcLoginPlugin, parseCookieHeader, protectedResourceMetadata, requireAccess, requireAccessHook, requireAuth, requireAuthHook, requireRole, requireRoleHook, serveProtectedResourceMetadata };
|
|
666
|
+
export type { AxiamFastifyRequest, AxiamRequest, BearerChallengeError, BearerChallengeOptions, CredentialSource, ExtractedCredential, McpGuardConfig, McpMetadataApp, OidcCallbackQuery, OidcLoginOptions, OidcLoginOutcome, OidcLoginRoutePaths, OidcLoginSuccessBody, PeerCertificateLike, PeerCertificateSocket, PreHandlerHook, ProtectedResourceMetadata, ProtectedResourceMetadataDocument, ProtectedResourceMetadataOptions };
|
package/dist/middleware/index.js
CHANGED
|
@@ -523,7 +523,7 @@ function protectedResourceMetadata(options) {
|
|
|
523
523
|
if (documentation !== void 0) {
|
|
524
524
|
requireAbsoluteUri(op, "resource_documentation", documentation, LOCATOR);
|
|
525
525
|
}
|
|
526
|
-
const
|
|
526
|
+
const document2 = Object.freeze({
|
|
527
527
|
resource,
|
|
528
528
|
authorization_servers: Object.freeze(authorizationServers),
|
|
529
529
|
...scopesSupported.length > 0 ? { scopes_supported: Object.freeze(scopesSupported) } : {},
|
|
@@ -532,7 +532,7 @@ function protectedResourceMetadata(options) {
|
|
|
532
532
|
});
|
|
533
533
|
const metadataPath = deriveMetadataPath(parsed.path);
|
|
534
534
|
return Object.freeze({
|
|
535
|
-
document,
|
|
535
|
+
document: document2,
|
|
536
536
|
metadataPath,
|
|
537
537
|
metadataUrl: `${parsed.scheme}://${parsed.authority}${metadataPath}`
|
|
538
538
|
});
|
|
@@ -1390,6 +1390,24 @@ function retryableNetworkError(message, response) {
|
|
|
1390
1390
|
return error;
|
|
1391
1391
|
}
|
|
1392
1392
|
|
|
1393
|
+
// src/rest/interceptors.ts
|
|
1394
|
+
function isOAuth2Endpoint(url, baseUrl) {
|
|
1395
|
+
if (!url) {
|
|
1396
|
+
return false;
|
|
1397
|
+
}
|
|
1398
|
+
try {
|
|
1399
|
+
const base = new URL(baseUrl);
|
|
1400
|
+
let path = new URL(url, base).pathname;
|
|
1401
|
+
const prefix = base.pathname.replace(/\/+$/, "");
|
|
1402
|
+
if (prefix !== "" && path.startsWith(`${prefix}/`)) {
|
|
1403
|
+
path = path.slice(prefix.length);
|
|
1404
|
+
}
|
|
1405
|
+
return path.startsWith("/oauth2/");
|
|
1406
|
+
} catch {
|
|
1407
|
+
return false;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1393
1411
|
// src/rest/retry.ts
|
|
1394
1412
|
var MAX_ATTEMPTS = 3;
|
|
1395
1413
|
var BASE_DELAY_MS = 200;
|
|
@@ -1545,9 +1563,9 @@ var DiscoveryCache = class {
|
|
|
1545
1563
|
if (pending) {
|
|
1546
1564
|
return pending;
|
|
1547
1565
|
}
|
|
1548
|
-
const fetch = fetcher().then((
|
|
1549
|
-
this.#documents.set(originKey, { document, expiresAt: Date.now() + this.#ttlMs });
|
|
1550
|
-
return
|
|
1566
|
+
const fetch = fetcher().then((document2) => {
|
|
1567
|
+
this.#documents.set(originKey, { document: document2, expiresAt: Date.now() + this.#ttlMs });
|
|
1568
|
+
return document2;
|
|
1551
1569
|
}).finally(() => {
|
|
1552
1570
|
this.#inFlight.delete(originKey);
|
|
1553
1571
|
});
|
|
@@ -2294,9 +2312,21 @@ var OidcClient = class {
|
|
|
2294
2312
|
* and obtain the code pair.
|
|
2295
2313
|
*
|
|
2296
2314
|
* @remarks
|
|
2297
|
-
* **
|
|
2298
|
-
*
|
|
2299
|
-
*
|
|
2315
|
+
* **The client authenticates as it does at every other token request
|
|
2316
|
+
* (contract 1.62, §14.1 rule 2).** A client built with a `clientSecret` sends
|
|
2317
|
+
* it as `client_secret` in the **form body** — never as `Authorization:
|
|
2318
|
+
* Basic`, whatever the client is registered for (§12.1 rule 3 stands for
|
|
2319
|
+
* this route, and the maintainer's 2026-10-16 "same rules" reading fixes the
|
|
2320
|
+
* form body) — and a client with a §6.1 client certificate presents it on the
|
|
2321
|
+
* connection, through the `mtls_endpoint_aliases` entry when discovery
|
|
2322
|
+
* publishes one (§21.3). **A public client sends no credential at all** and
|
|
2323
|
+
* is never refused client-side, so a device that cannot hold a secret still
|
|
2324
|
+
* works. The SDK sends a credential only when its caller configured one: it
|
|
2325
|
+
* never borrows one from another configuration. `private_key_jwt` client
|
|
2326
|
+
* authentication is not implemented by this SDK.
|
|
2327
|
+
*
|
|
2328
|
+
* A `401` with `{"error":"invalid_client"}` is an {@link OAuthProtocolError}
|
|
2329
|
+
* (§14.2 rule 5), is made once, and does not enter the §9 refresh guard.
|
|
2300
2330
|
*/
|
|
2301
2331
|
async deviceAuthorize(params = {}) {
|
|
2302
2332
|
const configuration = params.configuration ?? await this.oidcDiscover();
|
|
@@ -2308,6 +2338,7 @@ var OidcClient = class {
|
|
|
2308
2338
|
}
|
|
2309
2339
|
const form = new URLSearchParams();
|
|
2310
2340
|
form.set("client_id", this.#options.clientId);
|
|
2341
|
+
this.#appendClientSecret(form);
|
|
2311
2342
|
if (params.scope !== void 0) {
|
|
2312
2343
|
form.set("scope", Array.isArray(params.scope) ? params.scope.join(" ") : params.scope);
|
|
2313
2344
|
}
|
|
@@ -2418,6 +2449,15 @@ var OidcClient = class {
|
|
|
2418
2449
|
* {@link OAuthProtocolError} — `authorization_pending` and `slow_down`
|
|
2419
2450
|
* included — so a hand-rolled loop sees exactly what {@link deviceLogin}
|
|
2420
2451
|
* sees. Most callers want {@link deviceLogin}.
|
|
2452
|
+
*
|
|
2453
|
+
* Client authentication is the one {@link deviceAuthorize} describes
|
|
2454
|
+
* (contract 1.62, §14.1 rule 2): a configured `clientSecret` is sent as
|
|
2455
|
+
* `client_secret` in the form body, never as `Authorization: Basic`; a public
|
|
2456
|
+
* client sends none; `client_id` is sent on **every** poll (§14.1 rule 3). A
|
|
2457
|
+
* `401 invalid_client` surfaces as {@link OAuthProtocolError}, is not retried
|
|
2458
|
+
* and does not enter the §9 refresh guard (§14.2 rule 5). This SDK ships no
|
|
2459
|
+
* DPoP proof generator, so it cannot drive a client registered for DPoP; it
|
|
2460
|
+
* surfaces that client's refusal as the same `invalid_client`.
|
|
2421
2461
|
*/
|
|
2422
2462
|
async devicePoll(params) {
|
|
2423
2463
|
const configuration = params.configuration ?? await this.oidcDiscover();
|
|
@@ -2425,6 +2465,7 @@ var OidcClient = class {
|
|
|
2425
2465
|
form.set("grant_type", DEVICE_CODE_GRANT_TYPE);
|
|
2426
2466
|
form.set("device_code", exposeSecret(params.deviceCode));
|
|
2427
2467
|
form.set("client_id", this.#options.clientId);
|
|
2468
|
+
this.#appendClientSecret(form);
|
|
2428
2469
|
const wire = await this.#postToken(configuration, form, params.tenantId);
|
|
2429
2470
|
return this.#toTokenSet(wire, configuration, void 0);
|
|
2430
2471
|
}
|
|
@@ -3342,7 +3383,7 @@ var OidcClient = class {
|
|
|
3342
3383
|
this.#session.axios.interceptors.request.use((config) => {
|
|
3343
3384
|
const adopted = this.#adoptedCredential;
|
|
3344
3385
|
const url = config.url ?? "";
|
|
3345
|
-
if (!adopted || this.#session.isForeignHost(url) || url.
|
|
3386
|
+
if (!adopted || this.#session.isForeignHost(url) || isOAuth2Endpoint(url, this.#session.baseUrl)) {
|
|
3346
3387
|
return config;
|
|
3347
3388
|
}
|
|
3348
3389
|
config.headers = config.headers ?? {};
|
|
@@ -3514,11 +3555,11 @@ var RevocationFeed = class _RevocationFeed {
|
|
|
3514
3555
|
if (!response.ok) {
|
|
3515
3556
|
return void 0;
|
|
3516
3557
|
}
|
|
3517
|
-
const
|
|
3518
|
-
if (typeof
|
|
3558
|
+
const document2 = await response.json();
|
|
3559
|
+
if (typeof document2 !== "object" || document2 === null) {
|
|
3519
3560
|
return void 0;
|
|
3520
3561
|
}
|
|
3521
|
-
const { alg, revoked } =
|
|
3562
|
+
const { alg, revoked } = document2;
|
|
3522
3563
|
if (alg !== SUPPORTED_ALG) {
|
|
3523
3564
|
return void 0;
|
|
3524
3565
|
}
|