@oxyhq/core 17.0.0 → 17.0.2
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/server/userInvalidation.js +6 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/server/userInvalidation.js +6 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/server/__tests__/userInvalidation.test.ts +14 -2
- package/src/server/userInvalidation.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/core",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.2",
|
|
4
4
|
"description": "OxyHQ SDK Foundation — API client, authentication, cryptographic identity, and shared utilities",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"dependencies": {
|
|
116
116
|
"@noble/ciphers": "^1.3.0",
|
|
117
117
|
"@noble/hashes": "^1.8.0",
|
|
118
|
-
"@oxyhq/contracts": "^0.
|
|
118
|
+
"@oxyhq/contracts": "^0.21.0",
|
|
119
119
|
"@oxyhq/protocol": "^0.1.6",
|
|
120
120
|
"@scure/bip39": "^1.6.0",
|
|
121
121
|
"buffer": "^6.0.3",
|
|
@@ -112,7 +112,13 @@ describe('@oxyhq/core/server createOxyUserInvalidationHandler', () => {
|
|
|
112
112
|
createOxyUserInvalidationHandler({ oxy: evictor })(validMessage);
|
|
113
113
|
|
|
114
114
|
expect(entries).toEqual(['GET:/users/user-1']);
|
|
115
|
-
expect(prefixes).toEqual([
|
|
115
|
+
expect(prefixes).toEqual([
|
|
116
|
+
'GET:/session/user/',
|
|
117
|
+
'GET:/users/me',
|
|
118
|
+
'GET:/auth/lookup/',
|
|
119
|
+
'GET:/profiles/username/',
|
|
120
|
+
'GET:/profiles/resolve',
|
|
121
|
+
]);
|
|
116
122
|
});
|
|
117
123
|
|
|
118
124
|
it('hands the parsed event to app-specific eviction', () => {
|
|
@@ -203,6 +209,12 @@ describe('@oxyhq/core/server evictOxyIdentityCache', () => {
|
|
|
203
209
|
evictOxyIdentityCache(evictor, 'abc123');
|
|
204
210
|
|
|
205
211
|
expect(entries).toEqual(['GET:/users/abc123']);
|
|
206
|
-
expect(prefixes).toEqual([
|
|
212
|
+
expect(prefixes).toEqual([
|
|
213
|
+
'GET:/session/user/',
|
|
214
|
+
'GET:/users/me',
|
|
215
|
+
'GET:/auth/lookup/',
|
|
216
|
+
'GET:/profiles/username/',
|
|
217
|
+
'GET:/profiles/resolve',
|
|
218
|
+
]);
|
|
207
219
|
});
|
|
208
220
|
});
|
|
@@ -215,6 +215,12 @@ export function createOxyUserInvalidationHandler(
|
|
|
215
215
|
* wrong data.
|
|
216
216
|
*/
|
|
217
217
|
export function evictOxyIdentityCache(oxy: OxyIdentityCacheEvictor, userId: string): void {
|
|
218
|
+
// Match the sweep the user mixin runs after a local profile write — session-
|
|
219
|
+
// bound and /users/me entries are keyed without the user id, so they must be
|
|
220
|
+
// prefix-swept on cross-service invalidation too.
|
|
221
|
+
oxy.clearCacheByPrefix('GET:/session/user/');
|
|
222
|
+
oxy.clearCacheByPrefix('GET:/users/me');
|
|
223
|
+
oxy.clearCacheByPrefix('GET:/auth/lookup/');
|
|
218
224
|
oxy.clearCacheEntry(`GET:/users/${userId}`);
|
|
219
225
|
oxy.clearCacheByPrefix('GET:/profiles/username/');
|
|
220
226
|
oxy.clearCacheByPrefix('GET:/profiles/resolve');
|