@absolutejs/auth 0.27.0-beta.4 → 0.27.0-beta.5

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.
@@ -24,6 +24,24 @@ export type OidcProviderConfig<UserType> = {
24
24
  refreshTokenTtlMs?: number;
25
25
  signingKey: SigningKey;
26
26
  };
27
+ export type TokenExchangeResult = {
28
+ error: 'invalid_grant' | 'invalid_scope';
29
+ ok: false;
30
+ } | {
31
+ accessToken: string;
32
+ expiresIn: number;
33
+ ok: true;
34
+ scope: string;
35
+ };
36
+ export declare const exchangeToken: <UserType>({ actorClientId, audience, config, dpopJkt, now, requestedScopes, subjectToken }: {
37
+ actorClientId: string;
38
+ audience?: string;
39
+ config: OidcProviderConfig<UserType>;
40
+ dpopJkt?: string;
41
+ now?: number;
42
+ requestedScopes?: string[];
43
+ subjectToken: string;
44
+ }) => Promise<TokenExchangeResult>;
27
45
  export declare const issueTokenSet: <UserType>({ claims, clientId, config, dpopJkt, nonce, now, scopes, sub }: {
28
46
  claims?: Record<string, unknown>;
29
47
  clientId: string;
@@ -41,4 +59,13 @@ export declare const issueTokenSet: <UserType>({ claims, clientId, config, dpopJ
41
59
  scope: string;
42
60
  token_type: string;
43
61
  }>;
62
+ export declare const mcpProtectedResourceMetadata: ({ issuer, resource, scopes }: {
63
+ issuer: string;
64
+ resource: string;
65
+ scopes?: string[];
66
+ }) => {
67
+ authorization_servers: string[];
68
+ resource: string;
69
+ scopes_supported: string[];
70
+ };
44
71
  export declare const verifyPkce: (codeVerifier: string, codeChallenge: string) => Promise<boolean>;
@@ -55,6 +55,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
55
55
  [x: string]: {
56
56
  post: {
57
57
  body: {
58
+ audience?: string | undefined;
59
+ resource?: string | undefined;
58
60
  client_id?: string | undefined;
59
61
  scope?: string | undefined;
60
62
  refresh_token?: string | undefined;
@@ -63,6 +65,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
63
65
  code?: string | undefined;
64
66
  redirect_uri?: string | undefined;
65
67
  code_verifier?: string | undefined;
68
+ subject_token?: string | undefined;
69
+ subject_token_type?: string | undefined;
66
70
  };
67
71
  params: {};
68
72
  query: unknown;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.27.0-beta.4",
2
+ "version": "0.27.0-beta.5",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {