@mondaydotcomorg/atp-providers 0.19.4 → 0.19.5
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/audit/jsonl.d.ts.map +1 -1
- package/dist/audit/jsonl.js +5 -4
- package/dist/audit/jsonl.js.map +1 -1
- package/dist/cache/file.d.ts.map +1 -1
- package/dist/cache/file.js +27 -9
- package/dist/cache/file.js.map +1 -1
- package/dist/cache/redis.d.ts.map +1 -1
- package/dist/cache/redis.js +29 -8
- package/dist/cache/redis.js.map +1 -1
- package/dist/oauth/scope-checkers.d.ts.map +1 -1
- package/dist/oauth/scope-checkers.js +2 -1
- package/dist/oauth/scope-checkers.js.map +1 -1
- package/package.json +3 -2
- package/src/audit/jsonl.ts +5 -4
- package/src/cache/file.ts +24 -30
- package/src/cache/redis.ts +25 -32
- package/src/oauth/scope-checkers.ts +2 -1
- package/tsconfig.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/src/cache/redis.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CacheProvider } from '@mondaydotcomorg/atp-protocol';
|
|
2
|
+
import { log } from '@mondaydotcomorg/atp-runtime';
|
|
2
3
|
import type Redis from 'ioredis';
|
|
3
4
|
|
|
4
5
|
export interface RedisCacheOptions {
|
|
@@ -33,11 +34,10 @@ export class RedisCache implements CacheProvider {
|
|
|
33
34
|
if (!value) return null;
|
|
34
35
|
return JSON.parse(value) as T;
|
|
35
36
|
} catch (error) {
|
|
36
|
-
|
|
37
|
-
'[RedisCache] Failed to get key:',
|
|
37
|
+
log.error('RedisCache failed to get key', {
|
|
38
38
|
key,
|
|
39
|
-
error instanceof Error ? error.message : error
|
|
40
|
-
);
|
|
39
|
+
error: error instanceof Error ? error.message : error,
|
|
40
|
+
});
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -54,11 +54,10 @@ export class RedisCache implements CacheProvider {
|
|
|
54
54
|
await this.redis.set(fullKey, serialized);
|
|
55
55
|
}
|
|
56
56
|
} catch (error) {
|
|
57
|
-
|
|
58
|
-
'[RedisCache] Failed to set key:',
|
|
57
|
+
log.error('RedisCache failed to set key', {
|
|
59
58
|
key,
|
|
60
|
-
error instanceof Error ? error.message : error
|
|
61
|
-
);
|
|
59
|
+
error: error instanceof Error ? error.message : error,
|
|
60
|
+
});
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -66,11 +65,10 @@ export class RedisCache implements CacheProvider {
|
|
|
66
65
|
try {
|
|
67
66
|
await this.redis.del(this.getFullKey(key));
|
|
68
67
|
} catch (error) {
|
|
69
|
-
|
|
70
|
-
'[RedisCache] Failed to delete key:',
|
|
68
|
+
log.error('RedisCache failed to delete key', {
|
|
71
69
|
key,
|
|
72
|
-
error instanceof Error ? error.message : error
|
|
73
|
-
);
|
|
70
|
+
error: error instanceof Error ? error.message : error,
|
|
71
|
+
});
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
|
|
@@ -79,11 +77,10 @@ export class RedisCache implements CacheProvider {
|
|
|
79
77
|
const exists = await this.redis.exists(this.getFullKey(key));
|
|
80
78
|
return exists === 1;
|
|
81
79
|
} catch (error) {
|
|
82
|
-
|
|
83
|
-
'[RedisCache] Failed to check key:',
|
|
80
|
+
log.error('RedisCache failed to check key', {
|
|
84
81
|
key,
|
|
85
|
-
error instanceof Error ? error.message : error
|
|
86
|
-
);
|
|
82
|
+
error: error instanceof Error ? error.message : error,
|
|
83
|
+
});
|
|
87
84
|
return false;
|
|
88
85
|
}
|
|
89
86
|
}
|
|
@@ -103,10 +100,9 @@ export class RedisCache implements CacheProvider {
|
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
102
|
} catch (error) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
);
|
|
103
|
+
log.error('RedisCache failed to clear cache', {
|
|
104
|
+
error: error instanceof Error ? error.message : error,
|
|
105
|
+
});
|
|
110
106
|
}
|
|
111
107
|
}
|
|
112
108
|
|
|
@@ -116,10 +112,9 @@ export class RedisCache implements CacheProvider {
|
|
|
116
112
|
const values = await this.redis.mget(...fullKeys);
|
|
117
113
|
return values.map((value) => (value ? JSON.parse(value) : null));
|
|
118
114
|
} catch (error) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
);
|
|
115
|
+
log.error('RedisCache failed to mget keys', {
|
|
116
|
+
error: error instanceof Error ? error.message : error,
|
|
117
|
+
});
|
|
123
118
|
return keys.map(() => null);
|
|
124
119
|
}
|
|
125
120
|
}
|
|
@@ -140,10 +135,9 @@ export class RedisCache implements CacheProvider {
|
|
|
140
135
|
}
|
|
141
136
|
await pipeline.exec();
|
|
142
137
|
} catch (error) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
);
|
|
138
|
+
log.error('RedisCache failed to mset entries', {
|
|
139
|
+
error: error instanceof Error ? error.message : error,
|
|
140
|
+
});
|
|
147
141
|
}
|
|
148
142
|
}
|
|
149
143
|
|
|
@@ -151,10 +145,9 @@ export class RedisCache implements CacheProvider {
|
|
|
151
145
|
try {
|
|
152
146
|
await this.redis.quit();
|
|
153
147
|
} catch (error) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
);
|
|
148
|
+
log.error('RedisCache failed to disconnect', {
|
|
149
|
+
error: error instanceof Error ? error.message : error,
|
|
150
|
+
});
|
|
158
151
|
}
|
|
159
152
|
}
|
|
160
153
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ScopeChecker, TokenInfo } from '@mondaydotcomorg/atp-protocol';
|
|
2
|
+
import { log } from '@mondaydotcomorg/atp-runtime';
|
|
2
3
|
import { createHash } from 'node:crypto';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -72,7 +73,7 @@ export class ScopeCheckerRegistry {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
if (cleaned > 0) {
|
|
75
|
-
|
|
76
|
+
log.debug(`Cleaned ${cleaned} expired/old scope cache entries`);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"rootDir": "./src",
|
|
5
4
|
"outDir": "./dist",
|
|
5
|
+
"rootDir": "./src",
|
|
6
6
|
"declaration": true,
|
|
7
7
|
"declarationMap": true,
|
|
8
8
|
"sourceMap": true,
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
},
|
|
11
11
|
"include": ["src/**/*"],
|
|
12
12
|
"exclude": ["dist", "node_modules"],
|
|
13
|
-
"references": [{ "path": "../protocol" }]
|
|
13
|
+
"references": [{ "path": "../protocol" }, { "path": "../runtime" }]
|
|
14
14
|
}
|