@oxy.so/core 1.7.1 → 1.7.3
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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/mixins/OxyServices.auth.js +6 -6
- package/dist/cjs/server/workloadIdentity.client.js +11 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/mixins/OxyServices.auth.js +6 -6
- package/dist/esm/server/workloadIdentity.client.js +7 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/mixins/OxyServices.auth.d.ts +4 -4
- package/dist/types/server/workloadIdentity.client.d.ts +4 -0
- package/package.json +13 -3
- package/src/mixins/OxyServices.auth.ts +6 -6
- package/src/server/__tests__/workloadIdentity.client.test.ts +16 -0
- package/src/server/workloadIdentity.client.ts +12 -0
|
@@ -259,10 +259,10 @@ export function OxyServicesAuthMixin(Base) {
|
|
|
259
259
|
/**
|
|
260
260
|
* Whether this process can prove what it is (ADR 0026).
|
|
261
261
|
*
|
|
262
|
-
* The
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
262
|
+
* The internal package subpath selects a client implementation for native
|
|
263
|
+
* and browser bundlers, and the signer only for Node hosts. The runtime
|
|
264
|
+
* Node guard avoids calling attestation on clients; the module boundary
|
|
265
|
+
* keeps node:crypto out of their bundle graphs (a guard alone cannot).
|
|
266
266
|
*
|
|
267
267
|
* @internal
|
|
268
268
|
*/
|
|
@@ -270,7 +270,7 @@ export function OxyServicesAuthMixin(Base) {
|
|
|
270
270
|
if (typeof process === 'undefined' || !process.versions?.node)
|
|
271
271
|
return false;
|
|
272
272
|
try {
|
|
273
|
-
const { canAttestWorkloadIdentity } = await import('
|
|
273
|
+
const { canAttestWorkloadIdentity } = await import('@oxy.so/core/internal/workload-identity');
|
|
274
274
|
return canAttestWorkloadIdentity();
|
|
275
275
|
}
|
|
276
276
|
catch {
|
|
@@ -298,7 +298,7 @@ export function OxyServicesAuthMixin(Base) {
|
|
|
298
298
|
return entry.token;
|
|
299
299
|
if (entry?.pending)
|
|
300
300
|
return entry.pending;
|
|
301
|
-
const { requestWorkloadServiceToken } = await import('
|
|
301
|
+
const { requestWorkloadServiceToken } = await import('@oxy.so/core/internal/workload-identity');
|
|
302
302
|
const seeded = entry ?? {
|
|
303
303
|
token: '',
|
|
304
304
|
expiresAt: 0,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Workload attestation belongs to a Node host, never a browser or device. */
|
|
2
|
+
export function canAttestWorkloadIdentity() {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
export async function requestWorkloadServiceToken(_options) {
|
|
6
|
+
throw new Error('Workload identity is only available on a Node host');
|
|
7
|
+
}
|