@oxy.so/core 1.12.0 → 1.13.0
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/i18n/locales/en-US.json +11 -1
- package/dist/cjs/i18n/locales/es-ES.json +11 -1
- package/dist/cjs/i18n/locales/locales/en-US.json +11 -1
- package/dist/cjs/i18n/locales/locales/es-ES.json +11 -1
- package/dist/cjs/index.js +9 -6
- package/dist/cjs/mixins/OxyServices.user.js +15 -6
- package/dist/cjs/mixins/OxyServices.utility.js +140 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/i18n/locales/en-US.json +11 -1
- package/dist/esm/i18n/locales/es-ES.json +11 -1
- package/dist/esm/i18n/locales/locales/en-US.json +11 -1
- package/dist/esm/i18n/locales/locales/es-ES.json +11 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/mixins/OxyServices.user.js +15 -6
- package/dist/esm/mixins/OxyServices.utility.js +138 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/mixins/OxyServices.user.d.ts +11 -2
- package/dist/types/mixins/OxyServices.utility.d.ts +84 -1
- package/dist/types/server/requesterAssertion.d.ts +2 -2
- package/package.json +1 -1
- package/src/i18n/locales/en-US.json +11 -1
- package/src/i18n/locales/es-ES.json +11 -1
- package/src/index.ts +7 -0
- package/src/mixins/OxyServices.user.ts +23 -6
- package/src/mixins/OxyServices.utility.ts +208 -0
- package/src/mixins/__tests__/accountEvents.test.ts +158 -0
- package/src/mixins/__tests__/getUsersByIds.test.ts +27 -0
|
@@ -110,6 +110,33 @@ describe('OxyServices.getUsersByIds — dual-mode auth', () => {
|
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
+
describe('with an attestable workload identity and no key pair (ADR 0026 backend)', () => {
|
|
114
|
+
it('uses makeServiceRequest — an attested backend is still a backend', async () => {
|
|
115
|
+
jest
|
|
116
|
+
.spyOn(oxy as unknown as { _canUseWorkloadIdentity: () => Promise<boolean> }, '_canUseWorkloadIdentity')
|
|
117
|
+
.mockResolvedValue(true);
|
|
118
|
+
makeServiceRequestSpy.mockResolvedValueOnce([makeRawUser('a')]);
|
|
119
|
+
|
|
120
|
+
const result = await oxy.getUsersByIds(['a']);
|
|
121
|
+
|
|
122
|
+
expect(makeRequestSpy).not.toHaveBeenCalled();
|
|
123
|
+
expect(makeServiceRequestSpy).toHaveBeenCalledWith('POST', '/users/by-ids', { ids: ['a'] });
|
|
124
|
+
expect(result).toHaveLength(1);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('stays on the user path when the host cannot attest', async () => {
|
|
128
|
+
jest
|
|
129
|
+
.spyOn(oxy as unknown as { _canUseWorkloadIdentity: () => Promise<boolean> }, '_canUseWorkloadIdentity')
|
|
130
|
+
.mockResolvedValue(false);
|
|
131
|
+
makeRequestSpy.mockResolvedValueOnce([makeRawUser('a')]);
|
|
132
|
+
|
|
133
|
+
await oxy.getUsersByIds(['a']);
|
|
134
|
+
|
|
135
|
+
expect(makeServiceRequestSpy).not.toHaveBeenCalled();
|
|
136
|
+
expect(makeRequestSpy).toHaveBeenCalledWith('POST', '/users/by-ids', { ids: ['a'] }, { cache: false });
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
113
140
|
describe('chunking + resilience (applies to both modes)', () => {
|
|
114
141
|
it('chunks at 100 ids per request on the user path and flattens results', async () => {
|
|
115
142
|
const ids = Array.from({ length: 250 }, (_, i) => `id-${i}`);
|