@omg-dev/auth 0.4.28 → 0.4.30
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/package.json +1 -1
- package/src/oauth.ts +32 -0
package/package.json
CHANGED
package/src/oauth.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth resource indicators accepted across the omg authorization and resource
|
|
3
|
+
* servers. This module is the single owner: importing these lists keeps auth,
|
|
4
|
+
* MCP, control-plane, and first-party clients from drifting independently.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const MCP_OAUTH_RESOURCE = "https://mcp.omg.dev"
|
|
8
|
+
export const MCP_OAUTH_AUDIENCES = [
|
|
9
|
+
MCP_OAUTH_RESOURCE,
|
|
10
|
+
`${MCP_OAUTH_RESOURCE}/`,
|
|
11
|
+
`${MCP_OAUTH_RESOURCE}/mcp`,
|
|
12
|
+
] as const
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The CLI token is audience-bound to the control-plane surface it calls. It is
|
|
16
|
+
* intentionally not an MCP audience: the two clients share the omg:apps scope,
|
|
17
|
+
* but a token minted for one resource must not be replayable at the other.
|
|
18
|
+
*/
|
|
19
|
+
export const CLI_OAUTH_RESOURCE = "https://backend.omg.dev/api/cli"
|
|
20
|
+
export const CLI_OAUTH_AUDIENCES = [CLI_OAUTH_RESOURCE] as const
|
|
21
|
+
|
|
22
|
+
/** Every RFC 8707 resource the authorization server is allowed to mint. */
|
|
23
|
+
export const OAUTH_PROVIDER_AUDIENCES = [
|
|
24
|
+
...MCP_OAUTH_AUDIENCES,
|
|
25
|
+
...CLI_OAUTH_AUDIENCES,
|
|
26
|
+
] as const
|
|
27
|
+
|
|
28
|
+
/** Tokens accepted specifically by backend.omg.dev/api/cli/*. */
|
|
29
|
+
export const CLI_API_OAUTH_AUDIENCES = [
|
|
30
|
+
...MCP_OAUTH_AUDIENCES,
|
|
31
|
+
...CLI_OAUTH_AUDIENCES,
|
|
32
|
+
] as const
|