@dereekb/oauth-resource 14.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/LICENSE +21 -0
- package/README.md +185 -0
- package/express/index.d.ts +1 -0
- package/express/index.esm.js +321 -0
- package/express/package.json +29 -0
- package/express/src/index.d.ts +1 -0
- package/express/src/lib/bearer.middleware.d.ts +78 -0
- package/express/src/lib/index.d.ts +2 -0
- package/express/src/lib/well-known.router.d.ts +35 -0
- package/firebase/index.d.ts +1 -0
- package/firebase/index.esm.js +1924 -0
- package/firebase/package.json +27 -0
- package/firebase/src/index.d.ts +1 -0
- package/firebase/src/lib/firestore/firestore.sdk-identity.d.ts +165 -0
- package/firebase/src/lib/firestore/index.d.ts +1 -0
- package/firebase/src/lib/index.d.ts +2 -0
- package/firebase/src/lib/session/firebase-client.config.d.ts +86 -0
- package/firebase/src/lib/session/firebase-user-session.d.ts +223 -0
- package/firebase/src/lib/session/firebase-user-session.pool.d.ts +168 -0
- package/firebase/src/lib/session/firestore-session.cache.d.ts +79 -0
- package/firebase/src/lib/session/firestore-session.client.d.ts +149 -0
- package/firebase/src/lib/session/index.d.ts +5 -0
- package/index.d.ts +1 -0
- package/index.esm.js +1066 -0
- package/package.json +53 -0
- package/src/index.d.ts +1 -0
- package/src/lib/auth/index.d.ts +1 -0
- package/src/lib/auth/oauth.resource.auth.d.ts +55 -0
- package/src/lib/challenge/bearer.challenge.d.ts +73 -0
- package/src/lib/challenge/index.d.ts +1 -0
- package/src/lib/error/index.d.ts +1 -0
- package/src/lib/error/oauth.resource.error.d.ts +76 -0
- package/src/lib/index.d.ts +6 -0
- package/src/lib/issuer/index.d.ts +1 -0
- package/src/lib/issuer/issuer.profile.d.ts +98 -0
- package/src/lib/metadata/index.d.ts +1 -0
- package/src/lib/metadata/protected-resource.metadata.d.ts +64 -0
- package/src/lib/verify/index.d.ts +1 -0
- package/src/lib/verify/verify.bearer.d.ts +95 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type BuildProtectedResourceMetadataConfig, type OAuthProtectedResourceMetadata } from '@dereekb/oauth-resource';
|
|
2
|
+
import { type Maybe, type Seconds } from '@dereekb/util';
|
|
3
|
+
import { Router } from 'express';
|
|
4
|
+
/**
|
|
5
|
+
* How long a client may cache the protected-resource metadata document, in seconds.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_PROTECTED_RESOURCE_METADATA_MAX_AGE: Seconds;
|
|
8
|
+
export interface CreateWellKnownRouterConfig extends BuildProtectedResourceMetadataConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Path of the resource on this origin, used to serve the RFC 9728 §3.1 path-suffixed well-known
|
|
11
|
+
* path (e.g. `/mcp` → `/.well-known/oauth-protected-resource/mcp`, the path clients try first).
|
|
12
|
+
*
|
|
13
|
+
* Defaults to the path component of {@link BuildProtectedResourceMetadataConfig.resource}.
|
|
14
|
+
*/
|
|
15
|
+
readonly resourcePath?: Maybe<string>;
|
|
16
|
+
/**
|
|
17
|
+
* `cache-control: public, max-age=` value in seconds. Defaults to
|
|
18
|
+
* {@link DEFAULT_PROTECTED_RESOURCE_METADATA_MAX_AGE}.
|
|
19
|
+
*/
|
|
20
|
+
readonly maxAge?: Maybe<Seconds>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Serves the RFC 9728 metadata at both the path-suffixed (`…/oauth-protected-resource/mcp`,
|
|
24
|
+
* what clients try first) and bare well-known paths. Public and CORS-open so a browser-based
|
|
25
|
+
* client can discover the issuer, and built once at construction.
|
|
26
|
+
*
|
|
27
|
+
* @param config - The metadata document's inputs plus the resource path and cache lifetime.
|
|
28
|
+
* @returns The router.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createWellKnownRouter(config: CreateWellKnownRouterConfig): Router;
|
|
31
|
+
/**
|
|
32
|
+
* Re-exported for callers that want the document without the router (e.g. to serve it from
|
|
33
|
+
* another framework).
|
|
34
|
+
*/
|
|
35
|
+
export type { OAuthProtectedResourceMetadata };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|