@treeseed/sdk 0.13.0-rc.104 → 0.13.0-rc.105
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"completedAt":"2026-09-
|
|
1
|
+
{"completedAt":"2026-09-09T08:56:33.219Z"}
|
|
@@ -23,6 +23,30 @@ export declare const resourceTokenRequestSchema: z.ZodObject<{
|
|
|
23
23
|
scopes: string[];
|
|
24
24
|
}>;
|
|
25
25
|
export type ResourceTokenRequest = z.infer<typeof resourceTokenRequestSchema>;
|
|
26
|
+
/** RFC 9728 resource discovery. Unknown extensions are not authority. Consumers
|
|
27
|
+
* must match resource exactly and explicitly select one advertised issuer.
|
|
28
|
+
* TreeSeed credentials are transported only in the Authorization header.
|
|
29
|
+
*/
|
|
30
|
+
export declare const protectedResourceMetadataSchema: z.ZodObject<{
|
|
31
|
+
resource: z.ZodEffects<z.ZodString, string, string>;
|
|
32
|
+
authorization_servers: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
33
|
+
scopes_supported: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>, string[], string[]>>;
|
|
34
|
+
bearer_methods_supported: z.ZodOptional<z.ZodArray<z.ZodLiteral<"header">, "many">>;
|
|
35
|
+
resource_documentation: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
resource: string;
|
|
38
|
+
authorization_servers: string[];
|
|
39
|
+
scopes_supported?: string[] | undefined;
|
|
40
|
+
bearer_methods_supported?: "header"[] | undefined;
|
|
41
|
+
resource_documentation?: string | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
resource: string;
|
|
44
|
+
authorization_servers: string[];
|
|
45
|
+
scopes_supported?: string[] | undefined;
|
|
46
|
+
bearer_methods_supported?: "header"[] | undefined;
|
|
47
|
+
resource_documentation?: string | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
export type ProtectedResourceMetadata = z.infer<typeof protectedResourceMetadataSchema>;
|
|
26
50
|
/** Implemented by Identity; implementations must isolate caches by resource and authority. */
|
|
27
51
|
export interface IdentityCredentials {
|
|
28
52
|
token(request: ResourceTokenRequest): Promise<string>;
|
|
@@ -18,6 +18,16 @@ const resourceTokenRequestSchema = z.object({
|
|
|
18
18
|
resource: identityEndpointSchema,
|
|
19
19
|
scopes
|
|
20
20
|
}).strict();
|
|
21
|
+
const protectedResourceMetadataSchema = z.object({
|
|
22
|
+
resource: identityEndpointSchema,
|
|
23
|
+
authorization_servers: z.array(identityEndpointSchema).min(1).max(16).refine(
|
|
24
|
+
(value) => new Set(value).size === value.length,
|
|
25
|
+
"Authorization servers must be unique."
|
|
26
|
+
),
|
|
27
|
+
scopes_supported: scopes.refine((value) => value.length <= 256 && value.every((scope) => scope.length <= 128), "Scope inventory is too large.").optional(),
|
|
28
|
+
bearer_methods_supported: z.array(z.literal("header")).length(1).optional(),
|
|
29
|
+
resource_documentation: identityEndpointSchema.optional()
|
|
30
|
+
});
|
|
21
31
|
const identityPrincipalSchema = z.object({
|
|
22
32
|
principalId: identifier,
|
|
23
33
|
kind: z.enum(["human", "service", "provider", "agent"]),
|
|
@@ -51,5 +61,6 @@ export {
|
|
|
51
61
|
federationRelationshipSchema,
|
|
52
62
|
identityEndpointSchema,
|
|
53
63
|
identityPrincipalSchema,
|
|
64
|
+
protectedResourceMetadataSchema,
|
|
54
65
|
resourceTokenRequestSchema
|
|
55
66
|
};
|