@voltro/plugin-auth-supabase 0.84.0 → 0.86.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/CHANGELOG.md +1215 -0
- package/THIRD-PARTY-NOTICES.md +5 -89
- package/dist/index.js +1 -53
- package/dist/strategy.js +53 -0
- package/package.json +3 -3
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -1,70 +1,14 @@
|
|
|
1
1
|
# Third-Party Notices — @voltro/plugin-auth-supabase
|
|
2
2
|
|
|
3
|
-
This package
|
|
3
|
+
This package uses the open-source software listed below. Each is the
|
|
4
4
|
property of its respective copyright holders and is used under the terms of
|
|
5
5
|
its license. This file is provided for attribution; it grants no rights in
|
|
6
6
|
@voltro/plugin-auth-supabase itself, which is proprietary (see LICENSE).
|
|
7
7
|
|
|
8
|
-
Generated from the resolved runtime dependency closure (
|
|
8
|
+
Generated from the resolved runtime dependency closure (4 packages).
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
## @effect/experimental@0.61.1
|
|
13
|
-
|
|
14
|
-
License: MIT
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
MIT License
|
|
18
|
-
|
|
19
|
-
Copyright (c) 2023-present The Contributors
|
|
20
|
-
|
|
21
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
23
|
-
in the Software without restriction, including without limitation the rights
|
|
24
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
26
|
-
furnished to do so, subject to the following conditions:
|
|
27
|
-
|
|
28
|
-
The above copyright notice and this permission notice shall be included in all
|
|
29
|
-
copies or substantial portions of the Software.
|
|
30
|
-
|
|
31
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37
|
-
SOFTWARE.
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## @effect/sql@0.52.1
|
|
41
|
-
|
|
42
|
-
License: MIT
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
MIT License
|
|
46
|
-
|
|
47
|
-
Copyright (c) 2023-present The Contributors
|
|
48
|
-
|
|
49
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
50
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
51
|
-
in the Software without restriction, including without limitation the rights
|
|
52
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
53
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
54
|
-
furnished to do so, subject to the following conditions:
|
|
55
|
-
|
|
56
|
-
The above copyright notice and this permission notice shall be included in all
|
|
57
|
-
copies or substantial portions of the Software.
|
|
58
|
-
|
|
59
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
60
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
61
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
62
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
63
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
64
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
65
|
-
SOFTWARE.
|
|
66
|
-
```
|
|
67
|
-
|
|
68
12
|
## jose@6.2.12
|
|
69
13
|
|
|
70
14
|
License: MIT
|
|
@@ -93,34 +37,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
93
37
|
SOFTWARE.
|
|
94
38
|
```
|
|
95
39
|
|
|
96
|
-
## layerr@3.0.0
|
|
97
|
-
|
|
98
|
-
License: MIT
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
MIT License
|
|
102
|
-
|
|
103
|
-
Copyright (c) 2020 Perry Mitchell
|
|
104
|
-
|
|
105
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
106
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
107
|
-
in the Software without restriction, including without limitation the rights
|
|
108
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
109
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
110
|
-
furnished to do so, subject to the following conditions:
|
|
111
|
-
|
|
112
|
-
The above copyright notice and this permission notice shall be included in all
|
|
113
|
-
copies or substantial portions of the Software.
|
|
114
|
-
|
|
115
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
116
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
117
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
118
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
119
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
120
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
121
|
-
SOFTWARE.
|
|
122
|
-
```
|
|
123
|
-
|
|
124
40
|
## typeid-js@1.2.0
|
|
125
41
|
|
|
126
42
|
License: Apache-2.0
|
|
@@ -329,14 +245,14 @@ Apache License
|
|
|
329
245
|
limitations under the License.
|
|
330
246
|
```
|
|
331
247
|
|
|
332
|
-
##
|
|
248
|
+
## ulid@3.0.2
|
|
333
249
|
|
|
334
250
|
License: MIT
|
|
335
251
|
|
|
336
252
|
```
|
|
337
|
-
MIT License
|
|
253
|
+
The MIT License (MIT)
|
|
338
254
|
|
|
339
|
-
Copyright (c)
|
|
255
|
+
Copyright (c) 2017 Alizain Feerasta
|
|
340
256
|
|
|
341
257
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
342
258
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/index.js
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/strategy.ts
|
|
3
|
-
var n = "app_metadata.tenant_id", r = "base64-", i = 32768, a = 16, o = (e, t) => {
|
|
4
|
-
try {
|
|
5
|
-
let n = e(t);
|
|
6
|
-
if (!n) {
|
|
7
|
-
let r = [], o = 0;
|
|
8
|
-
for (let n = 0; n < a; n++) {
|
|
9
|
-
let a = e(`${t}.${n}`);
|
|
10
|
-
if (!a) break;
|
|
11
|
-
if (o += a.length, o > i) return;
|
|
12
|
-
r.push(a);
|
|
13
|
-
}
|
|
14
|
-
if (r.length === 0) return;
|
|
15
|
-
n = r.join("");
|
|
16
|
-
}
|
|
17
|
-
if (n.length > i) return;
|
|
18
|
-
let o = n.startsWith(r) ? Buffer.from(n.slice(7), "base64url").toString("utf8") : n, s = JSON.parse(o);
|
|
19
|
-
if (typeof s != "object" || !s) return;
|
|
20
|
-
let c = s.access_token;
|
|
21
|
-
return typeof c == "string" && c.length > 0 ? c : void 0;
|
|
22
|
-
} catch {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
}, s = (r) => {
|
|
26
|
-
if (!r.projectRef && !r.jwksUrl && r.jwtSecret === void 0) throw Error("supabaseStrategy: pass `projectRef` (hosted JWKS), `jwksUrl` (self-hosted JWKS), or `jwtSecret` (legacy / self-hosted HS256 shared secret)");
|
|
27
|
-
let i = r.projectRef, a = r.issuer ?? (i ? `https://${i}.supabase.co/auth/v1` : void 0), s = r.tenantClaim ?? n, c = r.scopesFromClaims, l = {
|
|
28
|
-
id: "supabase",
|
|
29
|
-
...a === void 0 ? {} : { issuer: a },
|
|
30
|
-
audience: r.audience ?? "authenticated",
|
|
31
|
-
cookieName: r.cookieName === void 0 ? null : r.cookieName,
|
|
32
|
-
cookieToToken: o,
|
|
33
|
-
tenantIdFromClaims: (e) => {
|
|
34
|
-
if (r.tenantIdFromClaims) return r.tenantIdFromClaims(e);
|
|
35
|
-
let n = t(e, s);
|
|
36
|
-
return typeof n == "string" && n.length > 0 ? n : r.defaultTenantId ?? null;
|
|
37
|
-
},
|
|
38
|
-
...c === void 0 ? {} : { scopesFromClaims: (e) => c(e) }
|
|
39
|
-
};
|
|
40
|
-
if (r.jwtSecret !== void 0) return e({
|
|
41
|
-
...l,
|
|
42
|
-
jwtSecret: r.jwtSecret,
|
|
43
|
-
algorithms: ["HS256"]
|
|
44
|
-
});
|
|
45
|
-
let u = r.jwksUrl ?? `https://${i}.supabase.co/auth/v1/.well-known/jwks.json`;
|
|
46
|
-
return e({
|
|
47
|
-
...l,
|
|
48
|
-
jwksUrl: u,
|
|
49
|
-
algorithms: ["RS256", "ES256"]
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { s as supabaseStrategy };
|
|
1
|
+
export { supabaseStrategy } from "./strategy.js";
|
package/dist/strategy.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jwtBearerStrategy as e, readClaimPath as t } from "@voltro/protocol/jwt";
|
|
2
|
+
//#region src/strategy.ts
|
|
3
|
+
var n = "app_metadata.tenant_id", r = "base64-", i = 32768, a = 16, o = (e, t) => {
|
|
4
|
+
try {
|
|
5
|
+
let n = e(t);
|
|
6
|
+
if (!n) {
|
|
7
|
+
let r = [], o = 0;
|
|
8
|
+
for (let n = 0; n < a; n++) {
|
|
9
|
+
let a = e(`${t}.${n}`);
|
|
10
|
+
if (!a) break;
|
|
11
|
+
if (o += a.length, o > i) return;
|
|
12
|
+
r.push(a);
|
|
13
|
+
}
|
|
14
|
+
if (r.length === 0) return;
|
|
15
|
+
n = r.join("");
|
|
16
|
+
}
|
|
17
|
+
if (n.length > i) return;
|
|
18
|
+
let o = n.startsWith(r) ? Buffer.from(n.slice(7), "base64url").toString("utf8") : n, s = JSON.parse(o);
|
|
19
|
+
if (typeof s != "object" || !s) return;
|
|
20
|
+
let c = s.access_token;
|
|
21
|
+
return typeof c == "string" && c.length > 0 ? c : void 0;
|
|
22
|
+
} catch {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}, s = (r) => {
|
|
26
|
+
if (!r.projectRef && !r.jwksUrl && r.jwtSecret === void 0) throw Error("supabaseStrategy: pass `projectRef` (hosted JWKS), `jwksUrl` (self-hosted JWKS), or `jwtSecret` (legacy / self-hosted HS256 shared secret)");
|
|
27
|
+
let i = r.projectRef, a = r.issuer ?? (i ? `https://${i}.supabase.co/auth/v1` : void 0), s = r.tenantClaim ?? n, c = r.scopesFromClaims, l = {
|
|
28
|
+
id: "supabase",
|
|
29
|
+
...a === void 0 ? {} : { issuer: a },
|
|
30
|
+
audience: r.audience ?? "authenticated",
|
|
31
|
+
cookieName: r.cookieName === void 0 ? null : r.cookieName,
|
|
32
|
+
cookieToToken: o,
|
|
33
|
+
tenantIdFromClaims: (e) => {
|
|
34
|
+
if (r.tenantIdFromClaims) return r.tenantIdFromClaims(e);
|
|
35
|
+
let n = t(e, s);
|
|
36
|
+
return typeof n == "string" && n.length > 0 ? n : r.defaultTenantId ?? null;
|
|
37
|
+
},
|
|
38
|
+
...c === void 0 ? {} : { scopesFromClaims: (e) => c(e) }
|
|
39
|
+
};
|
|
40
|
+
if (r.jwtSecret !== void 0) return e({
|
|
41
|
+
...l,
|
|
42
|
+
jwtSecret: r.jwtSecret,
|
|
43
|
+
algorithms: ["HS256"]
|
|
44
|
+
});
|
|
45
|
+
let u = r.jwksUrl ?? `https://${i}.supabase.co/auth/v1/.well-known/jwks.json`;
|
|
46
|
+
return e({
|
|
47
|
+
...l,
|
|
48
|
+
jwksUrl: u,
|
|
49
|
+
algorithms: ["RS256", "ES256"]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { s as supabaseStrategy };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-auth-supabase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"description": "Supabase Auth (GoTrue)-backed AuthStrategy for the Voltro framework. Verifies Supabase-issued JWTs via the project's JWKS endpoint. Conforms to @voltro/protocol AuthStrategy so it composes with other IdP plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"node": ">=24.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@voltro/protocol": "0.
|
|
36
|
+
"@voltro/protocol": "0.86.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"effect": "
|
|
39
|
+
"effect": "4.0.1"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|