@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
|
@@ -299,10 +299,10 @@ function OxyServicesAuthMixin(Base) {
|
|
|
299
299
|
/**
|
|
300
300
|
* Whether this process can prove what it is (ADR 0026).
|
|
301
301
|
*
|
|
302
|
-
* The
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
302
|
+
* The internal package subpath selects a client implementation for native
|
|
303
|
+
* and browser bundlers, and the signer only for Node hosts. The runtime
|
|
304
|
+
* Node guard avoids calling attestation on clients; the module boundary
|
|
305
|
+
* keeps node:crypto out of their bundle graphs (a guard alone cannot).
|
|
306
306
|
*
|
|
307
307
|
* @internal
|
|
308
308
|
*/
|
|
@@ -310,7 +310,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
310
310
|
if (typeof process === 'undefined' || !process.versions?.node)
|
|
311
311
|
return false;
|
|
312
312
|
try {
|
|
313
|
-
const { canAttestWorkloadIdentity } = await Promise.resolve().then(() => __importStar(require('
|
|
313
|
+
const { canAttestWorkloadIdentity } = await Promise.resolve().then(() => __importStar(require('@oxy.so/core/internal/workload-identity')));
|
|
314
314
|
return canAttestWorkloadIdentity();
|
|
315
315
|
}
|
|
316
316
|
catch {
|
|
@@ -338,7 +338,7 @@ function OxyServicesAuthMixin(Base) {
|
|
|
338
338
|
return entry.token;
|
|
339
339
|
if (entry?.pending)
|
|
340
340
|
return entry.pending;
|
|
341
|
-
const { requestWorkloadServiceToken } = await Promise.resolve().then(() => __importStar(require('
|
|
341
|
+
const { requestWorkloadServiceToken } = await Promise.resolve().then(() => __importStar(require('@oxy.so/core/internal/workload-identity')));
|
|
342
342
|
const seeded = entry ?? {
|
|
343
343
|
token: '',
|
|
344
344
|
expiresAt: 0,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canAttestWorkloadIdentity = canAttestWorkloadIdentity;
|
|
4
|
+
exports.requestWorkloadServiceToken = requestWorkloadServiceToken;
|
|
5
|
+
/** Workload attestation belongs to a Node host, never a browser or device. */
|
|
6
|
+
function canAttestWorkloadIdentity() {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
async function requestWorkloadServiceToken(_options) {
|
|
10
|
+
throw new Error('Workload identity is only available on a Node host');
|
|
11
|
+
}
|