canopycms-auth-dev 0.0.10 → 0.0.12
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/cache-writer.d.ts +2 -2
- package/dist/cache-writer.js +1 -1
- package/dist/jwt-verifier.d.ts +2 -2
- package/dist/jwt-verifier.js +2 -2
- package/package.json +3 -3
package/dist/cache-writer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevUser, DevGroup } from './dev-defaults';
|
|
2
2
|
export interface RefreshDevCacheOptions {
|
|
3
|
-
/** Directory to write cache files to (e.g., .canopy-
|
|
3
|
+
/** Directory to write cache files to (e.g., .canopy-dev/.cache) */
|
|
4
4
|
cachePath: string;
|
|
5
5
|
/** Custom users (defaults to DEFAULT_USERS) */
|
|
6
6
|
users?: DevUser[];
|
|
@@ -14,7 +14,7 @@ export interface RefreshDevCacheOptions {
|
|
|
14
14
|
* the same JSON files that CachingAuthPlugin reads. Since dev users are
|
|
15
15
|
* hardcoded, no API calls are needed.
|
|
16
16
|
*
|
|
17
|
-
* Used by the worker's `run-once` command in
|
|
17
|
+
* Used by the worker's `run-once` command in dev mode with dev auth.
|
|
18
18
|
*/
|
|
19
19
|
export declare function refreshDevCache(options: RefreshDevCacheOptions): Promise<{
|
|
20
20
|
userCount: number;
|
package/dist/cache-writer.js
CHANGED
|
@@ -7,7 +7,7 @@ import { DEFAULT_USERS, DEFAULT_GROUPS } from './dev-defaults';
|
|
|
7
7
|
* the same JSON files that CachingAuthPlugin reads. Since dev users are
|
|
8
8
|
* hardcoded, no API calls are needed.
|
|
9
9
|
*
|
|
10
|
-
* Used by the worker's `run-once` command in
|
|
10
|
+
* Used by the worker's `run-once` command in dev mode with dev auth.
|
|
11
11
|
*/
|
|
12
12
|
export async function refreshDevCache(options) {
|
|
13
13
|
const { cachePath } = options;
|
package/dist/jwt-verifier.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import type { TokenVerifier } from 'canopycms/auth';
|
|
|
4
4
|
* Extracts userId from X-Test-User header, x-dev-user-id header,
|
|
5
5
|
* or canopy-dev-user cookie — same logic as DevAuthPlugin.authenticate().
|
|
6
6
|
*
|
|
7
|
-
* Used with CachingAuthPlugin in
|
|
7
|
+
* Used with CachingAuthPlugin in dev mode to simulate the prod
|
|
8
8
|
* code path (token verification + cached metadata lookup) using dev users.
|
|
9
9
|
*
|
|
10
10
|
* @deprecated Use `DevAuthPlugin.verifyTokenOnly()` instead. The plugin's method is
|
|
11
|
-
* automatically wired into CachingAuthPlugin by `createNextCanopyContext()` in prod/
|
|
11
|
+
* automatically wired into CachingAuthPlugin by `createNextCanopyContext()` in prod/dev.
|
|
12
12
|
*/
|
|
13
13
|
export declare function createDevTokenVerifier(options?: {
|
|
14
14
|
defaultUserId?: string;
|
package/dist/jwt-verifier.js
CHANGED
|
@@ -16,11 +16,11 @@ const TEST_USER_MAP = {
|
|
|
16
16
|
* Extracts userId from X-Test-User header, x-dev-user-id header,
|
|
17
17
|
* or canopy-dev-user cookie — same logic as DevAuthPlugin.authenticate().
|
|
18
18
|
*
|
|
19
|
-
* Used with CachingAuthPlugin in
|
|
19
|
+
* Used with CachingAuthPlugin in dev mode to simulate the prod
|
|
20
20
|
* code path (token verification + cached metadata lookup) using dev users.
|
|
21
21
|
*
|
|
22
22
|
* @deprecated Use `DevAuthPlugin.verifyTokenOnly()` instead. The plugin's method is
|
|
23
|
-
* automatically wired into CachingAuthPlugin by `createNextCanopyContext()` in prod/
|
|
23
|
+
* automatically wired into CachingAuthPlugin by `createNextCanopyContext()` in prod/dev.
|
|
24
24
|
*/
|
|
25
25
|
export function createDevTokenVerifier(options) {
|
|
26
26
|
const defaultUserId = options?.defaultUserId ?? DEFAULT_USER_ID;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canopycms-auth-dev",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Development authentication provider for CanopyCMS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react": "^18.0.0 || ^19.0.0",
|
|
37
37
|
"@mantine/core": "^7.0.0 || ^8.0.0",
|
|
38
38
|
"react-icons": "^5.0.0",
|
|
39
|
-
"canopycms": "0.0.
|
|
39
|
+
"canopycms": "0.0.12"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@mantine/core": "^7.0.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react-icons": "^5.0.0",
|
|
47
47
|
"typescript": "^5.6.3",
|
|
48
48
|
"vitest": "^1.6.0",
|
|
49
|
-
"canopycms": "0.0.
|
|
49
|
+
"canopycms": "0.0.12"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsc -p tsconfig.build.json",
|