cauthy-auth 0.5.2 → 0.9.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/README.md +68 -3
- package/dist/{cauthy-BCTCqubt.d.ts → cauthy-Bn3iv50y.d.ts} +1 -1
- package/dist/{cauthy-hswMoS7B.d.mts → cauthy-C29HCvag.d.mts} +1 -1
- package/dist/cli.js +490 -25
- package/dist/client.d.mts +273 -0
- package/dist/client.d.ts +273 -0
- package/dist/client.js +342 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +308 -0
- package/dist/client.mjs.map +1 -0
- package/dist/express.d.mts +24 -0
- package/dist/express.d.ts +24 -0
- package/dist/express.js +102 -0
- package/dist/express.js.map +1 -0
- package/dist/express.mjs +76 -0
- package/dist/express.mjs.map +1 -0
- package/dist/fastify.d.mts +2 -2
- package/dist/fastify.d.ts +2 -2
- package/dist/fastify.js +3 -1
- package/dist/fastify.js.map +1 -1
- package/dist/fastify.mjs +3 -1
- package/dist/fastify.mjs.map +1 -1
- package/dist/hono.d.mts +23 -0
- package/dist/hono.d.ts +23 -0
- package/dist/hono.js +50 -0
- package/dist/hono.js.map +1 -0
- package/dist/hono.mjs +24 -0
- package/dist/hono.mjs.map +1 -0
- package/dist/index.d.mts +44 -6
- package/dist/index.d.ts +44 -6
- package/dist/index.js +713 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +701 -37
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +24 -0
- package/dist/next.d.ts +24 -0
- package/dist/next.js +77 -0
- package/dist/next.js.map +1 -0
- package/dist/next.mjs +52 -0
- package/dist/next.mjs.map +1 -0
- package/dist/react.d.mts +592 -7
- package/dist/react.d.ts +592 -7
- package/dist/react.js +1025 -14
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1013 -10
- package/dist/react.mjs.map +1 -1
- package/dist/styles.css +271 -0
- package/dist/svelte.d.mts +26 -0
- package/dist/svelte.d.ts +26 -0
- package/dist/svelte.js +413 -0
- package/dist/svelte.js.map +1 -0
- package/dist/svelte.mjs +384 -0
- package/dist/svelte.mjs.map +1 -0
- package/dist/{system-DvcQjORr.d.ts → system-DhRr_WxR.d.ts} +139 -1
- package/dist/{system-CR8p4BjB.d.mts → system-ZD_Wa8Bm.d.mts} +139 -1
- package/dist/theme.d.mts +56 -1
- package/dist/theme.d.ts +56 -1
- package/dist/theme.js +181 -5
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +176 -4
- package/dist/theme.mjs.map +1 -1
- package/dist/validate-B_iC-4y8.d.mts +19 -0
- package/dist/validate-B_iC-4y8.d.ts +19 -0
- package/dist/vue.d.mts +28 -0
- package/dist/vue.d.ts +28 -0
- package/dist/vue.js +431 -0
- package/dist/vue.js.map +1 -0
- package/dist/vue.mjs +402 -0
- package/dist/vue.mjs.map +1 -0
- package/package.json +68 -7
- package/dist/permissions-B-a3eN0h.d.mts +0 -52
- package/dist/permissions-B-a3eN0h.d.ts +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cauthy-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Sign in with Cauthy: one route to mount, getSession on the server, useSession in the browser. No database, no screens to build.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,16 +26,49 @@
|
|
|
26
26
|
"types": "./dist/theme.d.ts",
|
|
27
27
|
"import": "./dist/theme.mjs",
|
|
28
28
|
"require": "./dist/theme.js"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"./client": {
|
|
31
|
+
"types": "./dist/client.d.ts",
|
|
32
|
+
"import": "./dist/client.mjs",
|
|
33
|
+
"require": "./dist/client.js"
|
|
34
|
+
},
|
|
35
|
+
"./express": {
|
|
36
|
+
"types": "./dist/express.d.ts",
|
|
37
|
+
"import": "./dist/express.mjs",
|
|
38
|
+
"require": "./dist/express.js"
|
|
39
|
+
},
|
|
40
|
+
"./hono": {
|
|
41
|
+
"types": "./dist/hono.d.ts",
|
|
42
|
+
"import": "./dist/hono.mjs",
|
|
43
|
+
"require": "./dist/hono.js"
|
|
44
|
+
},
|
|
45
|
+
"./next": {
|
|
46
|
+
"types": "./dist/next.d.ts",
|
|
47
|
+
"import": "./dist/next.mjs",
|
|
48
|
+
"require": "./dist/next.js"
|
|
49
|
+
},
|
|
50
|
+
"./vue": {
|
|
51
|
+
"types": "./dist/vue.d.ts",
|
|
52
|
+
"import": "./dist/vue.mjs",
|
|
53
|
+
"require": "./dist/vue.js"
|
|
54
|
+
},
|
|
55
|
+
"./svelte": {
|
|
56
|
+
"types": "./dist/svelte.d.ts",
|
|
57
|
+
"import": "./dist/svelte.mjs",
|
|
58
|
+
"require": "./dist/svelte.js"
|
|
59
|
+
},
|
|
60
|
+
"./styles.css": "./dist/styles.css"
|
|
30
61
|
},
|
|
31
62
|
"files": [
|
|
32
63
|
"dist",
|
|
33
64
|
"README.md"
|
|
34
65
|
],
|
|
35
|
-
"sideEffects":
|
|
66
|
+
"sideEffects": [
|
|
67
|
+
"*.css"
|
|
68
|
+
],
|
|
36
69
|
"scripts": {
|
|
37
70
|
"dev": "tsup --watch",
|
|
38
|
-
"build": "tsup",
|
|
71
|
+
"build": "rm -rf dist && tsup && cp src/styles.css dist/styles.css",
|
|
39
72
|
"lint": "tsc --noEmit",
|
|
40
73
|
"test": "vitest run",
|
|
41
74
|
"test:watch": "vitest",
|
|
@@ -46,7 +79,10 @@
|
|
|
46
79
|
},
|
|
47
80
|
"peerDependencies": {
|
|
48
81
|
"fastify": ">=4",
|
|
49
|
-
"
|
|
82
|
+
"hono": ">=4",
|
|
83
|
+
"next": ">=14",
|
|
84
|
+
"react": ">=18",
|
|
85
|
+
"vue": ">=3.3"
|
|
50
86
|
},
|
|
51
87
|
"peerDependenciesMeta": {
|
|
52
88
|
"fastify": {
|
|
@@ -54,16 +90,33 @@
|
|
|
54
90
|
},
|
|
55
91
|
"react": {
|
|
56
92
|
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"hono": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"next": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"vue": {
|
|
101
|
+
"optional": true
|
|
57
102
|
}
|
|
58
103
|
},
|
|
59
104
|
"devDependencies": {
|
|
105
|
+
"@types/express": "^5",
|
|
60
106
|
"@types/node": "^20.0.0",
|
|
61
107
|
"@types/react": "^19.0.0",
|
|
108
|
+
"@types/react-dom": "^19",
|
|
109
|
+
"express": "^5",
|
|
62
110
|
"fastify": "^5.6.0",
|
|
111
|
+
"hono": "^4",
|
|
112
|
+
"next": "^15",
|
|
63
113
|
"react": "^19.0.0",
|
|
114
|
+
"react-dom": "^19.0.0",
|
|
115
|
+
"svelte": "^5",
|
|
64
116
|
"tsup": "^8.5.0",
|
|
65
117
|
"typescript": "^5.4.0",
|
|
66
|
-
"vitest": "^3.2.0"
|
|
118
|
+
"vitest": "^3.2.0",
|
|
119
|
+
"vue": "^3.5"
|
|
67
120
|
},
|
|
68
121
|
"publishConfig": {
|
|
69
122
|
"access": "public"
|
|
@@ -78,7 +131,15 @@
|
|
|
78
131
|
"oauth",
|
|
79
132
|
"oidc",
|
|
80
133
|
"session",
|
|
81
|
-
"sso"
|
|
134
|
+
"sso",
|
|
135
|
+
"nextjs",
|
|
136
|
+
"express",
|
|
137
|
+
"hono",
|
|
138
|
+
"fastify",
|
|
139
|
+
"vue",
|
|
140
|
+
"svelte",
|
|
141
|
+
"nuxt",
|
|
142
|
+
"sveltekit"
|
|
82
143
|
],
|
|
83
144
|
"bin": {
|
|
84
145
|
"cauthy-auth": "dist/cli.js"
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/** The part of an organization that says what its member may do. */
|
|
2
|
-
interface Permitted {
|
|
3
|
-
/** "resource:action" entries the person is allowed; "*" is any. Absent when the system keeps no catalog in Cauthy. */
|
|
4
|
-
permissions?: string[];
|
|
5
|
-
/** Entries the person is denied whatever else allows them. */
|
|
6
|
-
denied?: string[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Whether the person may do an action on a resource in an organization:
|
|
10
|
-
* allowed by some entry, and denied by none. A denial wins.
|
|
11
|
-
*
|
|
12
|
-
* An organization of a system that keeps no catalog in Cauthy carries no
|
|
13
|
-
* permissions, and the answer is `false`: decide by its `role` instead.
|
|
14
|
-
*
|
|
15
|
-
* if (!can(organization, 'invoicing', 'write')) return forbidden()
|
|
16
|
-
*/
|
|
17
|
-
declare function can(organization: Permitted | null | undefined, resource: string, action: string): boolean;
|
|
18
|
-
/** Something a role may do: an action on a resource, in organizations of a kind ("*", the default, is every kind). */
|
|
19
|
-
interface PolicyPermission {
|
|
20
|
-
kind?: string;
|
|
21
|
-
resource: string;
|
|
22
|
-
action: string;
|
|
23
|
-
}
|
|
24
|
-
interface PolicyRole {
|
|
25
|
-
role: string;
|
|
26
|
-
name?: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
/** Roles whose permissions this one has as well. */
|
|
29
|
-
inherits?: string[];
|
|
30
|
-
permissions?: PolicyPermission[];
|
|
31
|
-
}
|
|
32
|
-
interface PushPolicyOptions {
|
|
33
|
-
/** The system whose catalog this is. Default: `CAUTHY_SYSTEM`. */
|
|
34
|
-
system?: string;
|
|
35
|
-
roles: PolicyRole[];
|
|
36
|
-
/** Cauthy's address. Default: `CAUTHY_ISSUER`. */
|
|
37
|
-
issuer?: string;
|
|
38
|
-
/** The workspace's slug. Default: `CAUTHY_TENANT`. */
|
|
39
|
-
tenant?: string;
|
|
40
|
-
/** A personal access token with `organizations:manage`. Default: `CAUTHY_TOKEN`. */
|
|
41
|
-
token?: string;
|
|
42
|
-
fetch?: typeof fetch;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Gives Cauthy a system's catalog of roles, replacing the one it has. It is
|
|
46
|
-
* the way to load a first catalog from what a system already had; from then on
|
|
47
|
-
* the catalog is Cauthy's, edited in its dashboard, and pushing again would
|
|
48
|
-
* overwrite what was edited there.
|
|
49
|
-
*/
|
|
50
|
-
declare function pushPolicy(o: PushPolicyOptions): Promise<void>;
|
|
51
|
-
|
|
52
|
-
export { type Permitted as P, type PolicyPermission as a, type PolicyRole as b, type PushPolicyOptions as c, can as d, pushPolicy as p };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/** The part of an organization that says what its member may do. */
|
|
2
|
-
interface Permitted {
|
|
3
|
-
/** "resource:action" entries the person is allowed; "*" is any. Absent when the system keeps no catalog in Cauthy. */
|
|
4
|
-
permissions?: string[];
|
|
5
|
-
/** Entries the person is denied whatever else allows them. */
|
|
6
|
-
denied?: string[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Whether the person may do an action on a resource in an organization:
|
|
10
|
-
* allowed by some entry, and denied by none. A denial wins.
|
|
11
|
-
*
|
|
12
|
-
* An organization of a system that keeps no catalog in Cauthy carries no
|
|
13
|
-
* permissions, and the answer is `false`: decide by its `role` instead.
|
|
14
|
-
*
|
|
15
|
-
* if (!can(organization, 'invoicing', 'write')) return forbidden()
|
|
16
|
-
*/
|
|
17
|
-
declare function can(organization: Permitted | null | undefined, resource: string, action: string): boolean;
|
|
18
|
-
/** Something a role may do: an action on a resource, in organizations of a kind ("*", the default, is every kind). */
|
|
19
|
-
interface PolicyPermission {
|
|
20
|
-
kind?: string;
|
|
21
|
-
resource: string;
|
|
22
|
-
action: string;
|
|
23
|
-
}
|
|
24
|
-
interface PolicyRole {
|
|
25
|
-
role: string;
|
|
26
|
-
name?: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
/** Roles whose permissions this one has as well. */
|
|
29
|
-
inherits?: string[];
|
|
30
|
-
permissions?: PolicyPermission[];
|
|
31
|
-
}
|
|
32
|
-
interface PushPolicyOptions {
|
|
33
|
-
/** The system whose catalog this is. Default: `CAUTHY_SYSTEM`. */
|
|
34
|
-
system?: string;
|
|
35
|
-
roles: PolicyRole[];
|
|
36
|
-
/** Cauthy's address. Default: `CAUTHY_ISSUER`. */
|
|
37
|
-
issuer?: string;
|
|
38
|
-
/** The workspace's slug. Default: `CAUTHY_TENANT`. */
|
|
39
|
-
tenant?: string;
|
|
40
|
-
/** A personal access token with `organizations:manage`. Default: `CAUTHY_TOKEN`. */
|
|
41
|
-
token?: string;
|
|
42
|
-
fetch?: typeof fetch;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Gives Cauthy a system's catalog of roles, replacing the one it has. It is
|
|
46
|
-
* the way to load a first catalog from what a system already had; from then on
|
|
47
|
-
* the catalog is Cauthy's, edited in its dashboard, and pushing again would
|
|
48
|
-
* overwrite what was edited there.
|
|
49
|
-
*/
|
|
50
|
-
declare function pushPolicy(o: PushPolicyOptions): Promise<void>;
|
|
51
|
-
|
|
52
|
-
export { type Permitted as P, type PolicyPermission as a, type PolicyRole as b, type PushPolicyOptions as c, can as d, pushPolicy as p };
|