@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.
@@ -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}`);