@oatscenter/trellis 0.100.0-rc.36 → 0.100.0-rc.38
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/auth/connection.js +21 -0
- package/auth/protocol_wasm/client/trellis_protocol_wasm_bg.wasm +0 -0
- package/auth/protocol_wasm/provider/trellis_protocol_wasm_bg.wasm +0 -0
- package/internal_sdk/generated/apis/auth/mod.d.ts +1 -1
- package/internal_sdk/generated/apis/auth/mod.js +5 -5
- package/internal_sdk/generated/apis/core/mod.js +4 -4
- package/internal_sdk/generated/apis/events/mod.js +4 -4
- package/internal_sdk/generated/apis/health/mod.js +4 -4
- package/internal_sdk/generated/apis/jobs/mod.js +4 -4
- package/internal_sdk/generated/apis/state/mod.js +4 -4
- package/internal_sdk/generated/package.json +2 -2
- package/internal_sdk/generated/participants/eventsRuntime/mod.js +4 -4
- package/internal_sdk/generated/participants/healthRuntime/mod.js +4 -4
- package/internal_sdk/generated/participants/jobsRuntime/mod.js +4 -4
- package/internal_sdk/generated/participants/platform/mod.d.ts +1 -1
- package/internal_sdk/generated/participants/platform/mod.js +6 -6
- package/internal_sdk/generated/types/_internal/p0.d.ts +1 -0
- package/internal_sdk/generated/types/_internal/p0.js +1 -0
- package/package.json +2 -2
package/auth/connection.js
CHANGED
|
@@ -8,6 +8,8 @@ import { base64urlDecode, base64urlEncode, sha256, utf8 } from "./utils.js";
|
|
|
8
8
|
import { initializeProtocolWasm, signProvisionedAdmissionWasm, verifyOAuthAdmissionWasm, createSessionAuthorityHandleWasm, assertSessionAuthorityHandleCurrentWasm, transportAuthorizationDigestWasm, classifyTransportAuthorizationWasm, } from "./protocol_wasm.js";
|
|
9
9
|
import { loadDefaultRuntimeTransport, } from "../runtime_transport.js";
|
|
10
10
|
import { TransportGenerationManager, } from "../transport/generations.js";
|
|
11
|
+
/** Subjects on which Auth announces a new provider of an API the session calls. */
|
|
12
|
+
const PROVIDERS_NOTICE_SUBJECT_PREFIX = "trellis.auth.providers.";
|
|
11
13
|
const policySchema = z.object({
|
|
12
14
|
format: z.literal("trellis.transport-authorization.v1"),
|
|
13
15
|
account: z.string(),
|
|
@@ -89,6 +91,7 @@ export async function connectAdmitted(options) {
|
|
|
89
91
|
let renewalTask;
|
|
90
92
|
let mirrorRecovery;
|
|
91
93
|
const credentials = new WeakMap();
|
|
94
|
+
const noticed = new WeakSet();
|
|
92
95
|
const preparedCredentials = new WeakMap();
|
|
93
96
|
const pendingAdmissions = new WeakMap();
|
|
94
97
|
const candidates = new WeakMap();
|
|
@@ -337,6 +340,24 @@ export async function connectAdmitted(options) {
|
|
|
337
340
|
const value = candidates.get(generation.nc);
|
|
338
341
|
if (!value)
|
|
339
342
|
throw new Error("AdmissionUnavailable");
|
|
343
|
+
if (!noticed.has(generation.nc)) {
|
|
344
|
+
noticed.add(generation.nc);
|
|
345
|
+
// Routes name the providers that existed at admission. Auth announces
|
|
346
|
+
// one added since, and renewing adopts the route to it at once.
|
|
347
|
+
for (const subject of value.admission.policy.subscribeAllow) {
|
|
348
|
+
if (!subject.startsWith(PROVIDERS_NOTICE_SUBJECT_PREFIX))
|
|
349
|
+
continue;
|
|
350
|
+
generation.nc.subscribe(subject, {
|
|
351
|
+
callback: (error) => {
|
|
352
|
+
if (error || manager.isClosed())
|
|
353
|
+
return;
|
|
354
|
+
void refreshAuthority().catch(() => {
|
|
355
|
+
/* typed failure is retained by closed() */
|
|
356
|
+
});
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
340
361
|
if (value.committed)
|
|
341
362
|
return;
|
|
342
363
|
if (!value.candidate)
|
|
Binary file
|
|
Binary file
|
|
@@ -1296,5 +1296,5 @@ declare const __api: {
|
|
|
1296
1296
|
readonly packageEvidence: unknown;
|
|
1297
1297
|
};
|
|
1298
1298
|
export declare const API: typeof __api;
|
|
1299
|
-
export declare const API_DIGEST: "
|
|
1299
|
+
export declare const API_DIGEST: "OaeRlYQE6oQeGu8eaRiCz12jLLtNIheWt2dUW2ArdAk";
|
|
1300
1300
|
export {};
|