@aura-stack/auth 0.1.0-rc.9 → 0.2.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/dist/@types/index.cjs +15 -15
- package/dist/@types/index.d.ts +6 -31
- package/dist/@types/index.js +1 -1
- package/dist/@types/router.d.cjs +1 -1
- package/dist/@types/router.d.d.ts +6 -7
- package/dist/@types/utility.cjs +15 -15
- package/dist/@types/utility.d.ts +4 -8
- package/dist/@types/utility.js +1 -1
- package/dist/actions/callback/access-token.cjs +159 -149
- package/dist/actions/callback/access-token.d.ts +14 -20
- package/dist/actions/callback/access-token.js +9 -4
- package/dist/actions/callback/callback.cjs +371 -484
- package/dist/actions/callback/callback.d.ts +9 -12
- package/dist/actions/callback/callback.js +15 -12
- package/dist/actions/callback/userinfo.cjs +149 -139
- package/dist/actions/callback/userinfo.d.ts +8 -9
- package/dist/actions/callback/userinfo.js +11 -6
- package/dist/actions/csrfToken/csrfToken.cjs +112 -190
- package/dist/actions/csrfToken/csrfToken.d.ts +3 -3
- package/dist/actions/csrfToken/csrfToken.js +12 -8
- package/dist/actions/index.cjs +623 -807
- package/dist/actions/index.d.ts +12 -13
- package/dist/actions/index.js +33 -18
- package/dist/actions/session/session.cjs +86 -176
- package/dist/actions/session/session.d.ts +3 -3
- package/dist/actions/session/session.js +10 -7
- package/dist/actions/signIn/authorization.cjs +248 -257
- package/dist/actions/signIn/authorization.d.ts +11 -18
- package/dist/actions/signIn/authorization.js +16 -6
- package/dist/actions/signIn/signIn.cjs +302 -451
- package/dist/actions/signIn/signIn.d.ts +9 -10
- package/dist/actions/signIn/signIn.js +12 -10
- package/dist/actions/signOut/signOut.cjs +299 -468
- package/dist/actions/signOut/signOut.d.ts +3 -3
- package/dist/actions/signOut/signOut.js +14 -11
- package/dist/assert.cjs +40 -36
- package/dist/assert.d.ts +12 -4
- package/dist/assert.js +12 -2
- package/dist/chunk-2RXNXMCZ.js +55 -0
- package/dist/chunk-42XB3YCW.js +19 -17
- package/dist/chunk-4V4JNXVF.js +55 -0
- package/dist/chunk-6R2YZ4AC.js +22 -0
- package/dist/chunk-7H3OR6UU.js +81 -0
- package/dist/chunk-CXLATHS5.js +143 -0
- package/dist/chunk-E3OXBRYF.js +19 -17
- package/dist/chunk-EIL2FPSS.js +22 -0
- package/dist/chunk-FIPU4MLT.js +18 -16
- package/dist/chunk-FKRDCWBF.js +19 -17
- package/dist/chunk-IKHPGFCW.js +11 -9
- package/dist/chunk-IMICRJ5U.js +197 -0
- package/dist/chunk-IUYZQTJV.js +30 -0
- package/dist/chunk-KRNOMBXQ.js +19 -17
- package/dist/chunk-N2APGLXA.js +71 -0
- package/dist/chunk-NEVKX6K2.js +70 -0
- package/dist/chunk-PTJUYB33.js +33 -0
- package/dist/chunk-QDO2KSRJ.js +35 -0
- package/dist/chunk-QEZL7EYN.js +96 -0
- package/dist/chunk-RRLIF4PQ.js +55 -0
- package/dist/chunk-STHEPPUZ.js +8 -6
- package/dist/chunk-TLE4PXY3.js +39 -0
- package/dist/chunk-UEH3LVON.js +97 -0
- package/dist/chunk-WD7AUHQ5.js +79 -0
- package/dist/chunk-ZLR3LI6X.js +55 -0
- package/dist/cookie.cjs +222 -187
- package/dist/cookie.d.ts +38 -76
- package/dist/cookie.js +27 -34
- package/dist/errors.cjs +85 -0
- package/dist/errors.d.ts +48 -0
- package/dist/errors.js +18 -0
- package/dist/headers.cjs +28 -28
- package/dist/headers.d.ts +2 -2
- package/dist/headers.js +6 -2
- package/dist/{index-DpfbvTZ_.d.ts → index-EqsoyjrF.d.ts} +351 -318
- package/dist/index.cjs +1006 -1001
- package/dist/index.d.ts +9 -31
- package/dist/index.js +82 -51
- package/dist/jose.cjs +74 -66
- package/dist/jose.d.ts +11 -8
- package/dist/jose.js +10 -5
- package/dist/oauth/bitbucket.cjs +38 -38
- package/dist/oauth/bitbucket.d.ts +6 -7
- package/dist/oauth/bitbucket.js +6 -2
- package/dist/oauth/discord.cjs +47 -48
- package/dist/oauth/discord.d.ts +6 -7
- package/dist/oauth/discord.js +6 -2
- package/dist/oauth/figma.cjs +39 -39
- package/dist/oauth/figma.d.ts +6 -7
- package/dist/oauth/figma.js +6 -2
- package/dist/oauth/github.cjs +31 -31
- package/dist/oauth/github.d.ts +6 -7
- package/dist/oauth/github.js +6 -2
- package/dist/oauth/gitlab.cjs +39 -39
- package/dist/oauth/gitlab.d.ts +6 -7
- package/dist/oauth/gitlab.js +6 -2
- package/dist/oauth/index.cjs +306 -180
- package/dist/oauth/index.d.ts +6 -26
- package/dist/oauth/index.js +43 -9
- package/dist/oauth/spotify.cjs +39 -39
- package/dist/oauth/spotify.d.ts +6 -7
- package/dist/oauth/spotify.js +6 -2
- package/dist/oauth/strava.cjs +46 -0
- package/dist/oauth/strava.d.ts +6 -0
- package/dist/oauth/strava.js +6 -0
- package/dist/oauth/x.cjs +39 -39
- package/dist/oauth/x.d.ts +6 -7
- package/dist/oauth/x.js +6 -2
- package/dist/schemas.cjs +97 -91
- package/dist/schemas.d.ts +96 -126
- package/dist/schemas.js +20 -18
- package/dist/secure.cjs +106 -101
- package/dist/secure.d.ts +16 -17
- package/dist/secure.js +19 -4
- package/dist/utils.cjs +197 -135
- package/dist/utils.d.ts +20 -26
- package/dist/utils.js +25 -21
- package/package.json +5 -6
- package/dist/chunk-256KIVJL.js +0 -110
- package/dist/chunk-6SM22VVJ.js +0 -15
- package/dist/chunk-CAKJT3KS.js +0 -77
- package/dist/chunk-EBPE35JT.js +0 -29
- package/dist/chunk-FJUDBLCP.js +0 -52
- package/dist/chunk-GZU3RBTB.js +0 -51
- package/dist/chunk-HGJ4TXY4.js +0 -105
- package/dist/chunk-HMRKN75I.js +0 -74
- package/dist/chunk-JAPMIE6S.js +0 -8
- package/dist/chunk-LLR722CL.js +0 -75
- package/dist/chunk-RLT4RFKV.js +0 -36
- package/dist/chunk-SJPDVKUS.js +0 -93
- package/dist/chunk-SMQO5WD7.js +0 -20
- package/dist/chunk-UJJ7R56J.js +0 -42
- package/dist/chunk-UTDLUEEG.js +0 -25
- package/dist/chunk-VFTYH33W.js +0 -44
- package/dist/chunk-XXJKNKGQ.js +0 -27
- package/dist/chunk-ZV4BH47P.js +0 -156
- package/dist/error.cjs +0 -88
- package/dist/error.d.ts +0 -62
- package/dist/error.js +0 -9
- package/dist/response.cjs +0 -34
- package/dist/response.d.ts +0 -10
- package/dist/response.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
f as OAuthProviderCredentials,
|
|
9
|
-
S as Session,
|
|
10
|
-
U as User,
|
|
11
|
-
} from "./index-DpfbvTZ_.js"
|
|
12
|
-
import * as _aura_stack_router from "@aura-stack/router"
|
|
13
|
-
import "zod/v4"
|
|
14
|
-
import "@aura-stack/jose/jose"
|
|
15
|
-
import "./schemas.js"
|
|
16
|
-
import "zod/v4/core"
|
|
17
|
-
import "cookie"
|
|
18
|
-
import "./@types/utility.js"
|
|
1
|
+
import { d as AuthConfig, e as AuthInstance } from './index-EqsoyjrF.js';
|
|
2
|
+
export { C as CookieConfig, E as ErrorType, f as JoseInstance, O as OAuthProvider, g as OAuthProviderConfig, h as OAuthProviderCredentials, S as Session, U as User } from './index-EqsoyjrF.js';
|
|
3
|
+
import 'zod/v4';
|
|
4
|
+
import './schemas.js';
|
|
5
|
+
import '@aura-stack/router/cookie';
|
|
6
|
+
import '@aura-stack/jose/jose';
|
|
7
|
+
import './@types/utility.js';
|
|
19
8
|
|
|
20
9
|
/**
|
|
21
10
|
* Creates the authentication instance with the configuration provided for OAuth provider.
|
|
@@ -39,17 +28,6 @@ import "./@types/utility.js"
|
|
|
39
28
|
* }]
|
|
40
29
|
* })
|
|
41
30
|
*/
|
|
42
|
-
declare const createAuth: (authConfig: AuthConfig) =>
|
|
43
|
-
handlers: _aura_stack_router.GetHttpHandlers<
|
|
44
|
-
[
|
|
45
|
-
_aura_stack_router.RouteEndpoint<"GET", "/signIn/:oauth", {}>,
|
|
46
|
-
_aura_stack_router.RouteEndpoint<"GET", "/callback/:oauth", {}>,
|
|
47
|
-
_aura_stack_router.RouteEndpoint<"GET", "/session", {}>,
|
|
48
|
-
_aura_stack_router.RouteEndpoint<"POST", "/signOut", {}>,
|
|
49
|
-
_aura_stack_router.RouteEndpoint<"GET", "/csrfToken", {}>,
|
|
50
|
-
]
|
|
51
|
-
>
|
|
52
|
-
jose: JoseInstance
|
|
53
|
-
}
|
|
31
|
+
declare const createAuth: (authConfig: AuthConfig) => AuthInstance;
|
|
54
32
|
|
|
55
|
-
export { AuthConfig,
|
|
33
|
+
export { AuthConfig, AuthInstance, createAuth };
|
package/dist/index.js
CHANGED
|
@@ -1,55 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import "./chunk-
|
|
1
|
+
import {
|
|
2
|
+
createBuiltInOAuthProviders
|
|
3
|
+
} from "./chunk-7H3OR6UU.js";
|
|
4
|
+
import "./chunk-IKHPGFCW.js";
|
|
5
|
+
import "./chunk-KRNOMBXQ.js";
|
|
6
|
+
import "./chunk-E3OXBRYF.js";
|
|
7
|
+
import "./chunk-6R2YZ4AC.js";
|
|
8
|
+
import "./chunk-42XB3YCW.js";
|
|
9
|
+
import "./chunk-ITQ7352M.js";
|
|
10
|
+
import {
|
|
11
|
+
csrfTokenAction
|
|
12
|
+
} from "./chunk-QDO2KSRJ.js";
|
|
13
|
+
import {
|
|
14
|
+
signInAction
|
|
15
|
+
} from "./chunk-2RXNXMCZ.js";
|
|
16
|
+
import {
|
|
17
|
+
sessionAction
|
|
18
|
+
} from "./chunk-PTJUYB33.js";
|
|
19
|
+
import {
|
|
20
|
+
signOutAction
|
|
21
|
+
} from "./chunk-NEVKX6K2.js";
|
|
22
|
+
import "./chunk-QEZL7EYN.js";
|
|
23
|
+
import {
|
|
24
|
+
callbackAction
|
|
25
|
+
} from "./chunk-UEH3LVON.js";
|
|
26
|
+
import "./chunk-ZLR3LI6X.js";
|
|
27
|
+
import "./chunk-4V4JNXVF.js";
|
|
28
|
+
import "./chunk-FIPU4MLT.js";
|
|
29
|
+
import "./chunk-IUYZQTJV.js";
|
|
30
|
+
import "./chunk-FKRDCWBF.js";
|
|
31
|
+
import {
|
|
32
|
+
createCookieStore
|
|
33
|
+
} from "./chunk-IMICRJ5U.js";
|
|
34
|
+
import "./chunk-STHEPPUZ.js";
|
|
35
|
+
import {
|
|
36
|
+
createJoseInstance
|
|
37
|
+
} from "./chunk-TLE4PXY3.js";
|
|
38
|
+
import "./chunk-WD7AUHQ5.js";
|
|
39
|
+
import "./chunk-N2APGLXA.js";
|
|
40
|
+
import {
|
|
41
|
+
onErrorHandler,
|
|
42
|
+
useSecureCookies
|
|
43
|
+
} from "./chunk-CXLATHS5.js";
|
|
44
|
+
import "./chunk-EIL2FPSS.js";
|
|
45
|
+
import "./chunk-RRLIF4PQ.js";
|
|
27
46
|
|
|
28
47
|
// src/index.ts
|
|
29
|
-
import "dotenv/config"
|
|
30
|
-
import { createRouter } from "@aura-stack/router"
|
|
48
|
+
import "dotenv/config";
|
|
49
|
+
import { createRouter } from "@aura-stack/router";
|
|
31
50
|
var createInternalConfig = (authConfig) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
51
|
+
const useSecure = authConfig?.trustedProxyHeaders ?? false;
|
|
52
|
+
return {
|
|
53
|
+
basePath: authConfig?.basePath ?? "/auth",
|
|
54
|
+
onError: onErrorHandler,
|
|
55
|
+
context: {
|
|
56
|
+
oauth: createBuiltInOAuthProviders(authConfig?.oauth),
|
|
57
|
+
cookies: createCookieStore(useSecure, authConfig?.cookies?.prefix, authConfig?.cookies?.overrides ?? {}),
|
|
58
|
+
jose: createJoseInstance(authConfig?.secret),
|
|
59
|
+
secret: authConfig?.secret,
|
|
60
|
+
basePath: authConfig?.basePath ?? "/auth",
|
|
61
|
+
trustedProxyHeaders: useSecure
|
|
62
|
+
},
|
|
63
|
+
middlewares: [
|
|
64
|
+
(ctx) => {
|
|
65
|
+
const useSecure2 = useSecureCookies(ctx.request, ctx.context.trustedProxyHeaders);
|
|
66
|
+
const cookies = createCookieStore(useSecure2, authConfig?.cookies?.prefix, authConfig?.cookies?.overrides ?? {});
|
|
67
|
+
ctx.context.cookies = cookies;
|
|
68
|
+
return ctx;
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
};
|
|
44
73
|
var createAuth = (authConfig) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
export {
|
|
74
|
+
const config = createInternalConfig(authConfig);
|
|
75
|
+
const router = createRouter(
|
|
76
|
+
[signInAction(config.context.oauth), callbackAction(config.context.oauth), sessionAction, signOutAction, csrfTokenAction],
|
|
77
|
+
config
|
|
78
|
+
);
|
|
79
|
+
return {
|
|
80
|
+
handlers: router,
|
|
81
|
+
jose: config.context.jose
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
createAuth
|
|
86
|
+
};
|
package/dist/jose.cjs
CHANGED
|
@@ -1,83 +1,91 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
var __create = Object.create
|
|
3
|
-
var __defProp = Object.defineProperty
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
)
|
|
30
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
29
|
|
|
32
30
|
// src/jose.ts
|
|
33
|
-
var jose_exports = {}
|
|
31
|
+
var jose_exports = {};
|
|
34
32
|
__export(jose_exports, {
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
module.exports = __toCommonJS(jose_exports)
|
|
38
|
-
var import_config = require("dotenv/config")
|
|
39
|
-
var import_jose = require("@aura-stack/jose")
|
|
33
|
+
createJoseInstance: () => createJoseInstance
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(jose_exports);
|
|
36
|
+
var import_config = require("dotenv/config");
|
|
37
|
+
var import_jose = require("@aura-stack/jose");
|
|
40
38
|
|
|
41
39
|
// src/secure.ts
|
|
42
|
-
var import_node_crypto = __toESM(require("crypto"), 1)
|
|
40
|
+
var import_node_crypto = __toESM(require("crypto"), 1);
|
|
43
41
|
|
|
44
42
|
// src/utils.ts
|
|
45
|
-
var import_router = require("@aura-stack/router")
|
|
43
|
+
var import_router = require("@aura-stack/router");
|
|
46
44
|
|
|
47
|
-
// src/
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
// src/errors.ts
|
|
46
|
+
var AuthInternalError = class extends Error {
|
|
47
|
+
type = "AUTH_INTERNAL_ERROR";
|
|
48
|
+
code;
|
|
49
|
+
constructor(code, message, options) {
|
|
50
|
+
super(message, options);
|
|
51
|
+
this.code = code;
|
|
52
|
+
this.name = new.target.name;
|
|
53
|
+
Error.captureStackTrace(this, new.target);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
55
56
|
|
|
56
57
|
// src/secure.ts
|
|
57
58
|
var createDerivedSalt = (secret) => {
|
|
58
|
-
|
|
59
|
-
}
|
|
59
|
+
return import_node_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex");
|
|
60
|
+
};
|
|
60
61
|
|
|
61
62
|
// src/jose.ts
|
|
62
63
|
var createJoseInstance = (secret) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
const env = process.env;
|
|
65
|
+
secret ??= env.AURA_AUTH_SECRET ?? env.AUTH_SECRET;
|
|
66
|
+
if (!secret) {
|
|
67
|
+
throw new AuthInternalError(
|
|
68
|
+
"JOSE_INITIALIZATION_FAILED",
|
|
69
|
+
"AURA_AUTH_SECRET environment variable is not set and no secret was provided."
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const salt = env.AURA_AUTH_SALT ?? env.AUTH_SALT ?? createDerivedSalt(secret);
|
|
73
|
+
const { derivedKey: derivedSigningKey } = (0, import_jose.createDeriveKey)(secret, salt, "signing");
|
|
74
|
+
const { derivedKey: derivedEncryptionKey } = (0, import_jose.createDeriveKey)(secret, salt, "encryption");
|
|
75
|
+
const { derivedKey: derivedCsrfTokenKey } = (0, import_jose.createDeriveKey)(secret, salt, "csrfToken");
|
|
76
|
+
const { decodeJWT, encodeJWT } = (0, import_jose.createJWT)({ jws: derivedSigningKey, jwe: derivedEncryptionKey });
|
|
77
|
+
const { signJWS, verifyJWS } = (0, import_jose.createJWS)(derivedCsrfTokenKey);
|
|
78
|
+
const { encryptJWE, decryptJWE } = (0, import_jose.createJWE)(derivedEncryptionKey);
|
|
79
|
+
return {
|
|
80
|
+
decodeJWT,
|
|
81
|
+
encodeJWT,
|
|
82
|
+
signJWS,
|
|
83
|
+
verifyJWS,
|
|
84
|
+
encryptJWE,
|
|
85
|
+
decryptJWE
|
|
86
|
+
};
|
|
87
|
+
};
|
|
79
88
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 &&
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
createJoseInstance
|
|
91
|
+
});
|
package/dist/jose.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
1
|
+
import * as _aura_stack_jose from '@aura-stack/jose';
|
|
2
|
+
import * as _aura_stack_jose_jose from '@aura-stack/jose/jose';
|
|
3
|
+
export { JWTPayload } from '@aura-stack/jose/jose';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Creates the JOSE instance used for signing and verifying tokens. It derives keys
|
|
@@ -11,10 +12,12 @@ export { JWTPayload } from "@aura-stack/jose/jose"
|
|
|
11
12
|
* @returns jose instance with methods for encoding/decoding JWTs and signing/verifying JWSs
|
|
12
13
|
*/
|
|
13
14
|
declare const createJoseInstance: (secret?: string) => {
|
|
14
|
-
decodeJWT: (token: string) => Promise<_aura_stack_jose_jose.JWTPayload
|
|
15
|
-
encodeJWT: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string
|
|
16
|
-
signJWS: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string
|
|
17
|
-
verifyJWS: (payload: string) => Promise<_aura_stack_jose_jose.JWTPayload
|
|
18
|
-
|
|
15
|
+
decodeJWT: (token: string) => Promise<_aura_stack_jose_jose.JWTPayload>;
|
|
16
|
+
encodeJWT: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string>;
|
|
17
|
+
signJWS: (payload: _aura_stack_jose_jose.JWTPayload) => Promise<string>;
|
|
18
|
+
verifyJWS: (payload: string, options?: _aura_stack_jose.JWTVerifyOptions) => Promise<_aura_stack_jose_jose.JWTPayload>;
|
|
19
|
+
encryptJWE: (payload: string, options?: _aura_stack_jose.EncryptOptions) => Promise<string>;
|
|
20
|
+
decryptJWE: (payload: string, options?: _aura_stack_jose.JWTDecryptOptions) => Promise<string>;
|
|
21
|
+
};
|
|
19
22
|
|
|
20
|
-
export { createJoseInstance }
|
|
23
|
+
export { createJoseInstance };
|
package/dist/jose.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
createJoseInstance
|
|
3
|
+
} from "./chunk-TLE4PXY3.js";
|
|
4
|
+
import "./chunk-N2APGLXA.js";
|
|
5
|
+
import "./chunk-CXLATHS5.js";
|
|
6
|
+
import "./chunk-EIL2FPSS.js";
|
|
7
|
+
import "./chunk-RRLIF4PQ.js";
|
|
8
|
+
export {
|
|
9
|
+
createJoseInstance
|
|
10
|
+
};
|
package/dist/oauth/bitbucket.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
var __defProp = Object.defineProperty
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
9
10
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
19
|
|
|
19
20
|
// src/oauth/bitbucket.ts
|
|
20
|
-
var bitbucket_exports = {}
|
|
21
|
+
var bitbucket_exports = {};
|
|
21
22
|
__export(bitbucket_exports, {
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
module.exports = __toCommonJS(bitbucket_exports)
|
|
23
|
+
bitbucket: () => bitbucket
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(bitbucket_exports);
|
|
25
26
|
var bitbucket = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
27
|
+
id: "bitbucket",
|
|
28
|
+
name: "Bitbucket",
|
|
29
|
+
authorizeURL: "https://bitbucket.org/site/oauth2/authorize",
|
|
30
|
+
accessToken: "https://bitbucket.org/site/oauth2/access_token",
|
|
31
|
+
userInfo: "https://api.bitbucket.org/2.0/user",
|
|
32
|
+
scope: "account email",
|
|
33
|
+
responseType: "code",
|
|
34
|
+
profile(profile) {
|
|
35
|
+
return {
|
|
36
|
+
sub: profile.uuid ?? profile.account_id,
|
|
37
|
+
name: profile.display_name ?? profile.nickname,
|
|
38
|
+
image: profile.links.avatar.href
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
41
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 &&
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
})
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
bitbucket
|
|
45
|
+
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { B as BitbucketProfile,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "cookie"
|
|
1
|
+
export { B as BitbucketProfile, r as bitbucket } from '../index-EqsoyjrF.js';
|
|
2
|
+
import '../@types/utility.js';
|
|
3
|
+
import 'zod/v4';
|
|
4
|
+
import '../schemas.js';
|
|
5
|
+
import '@aura-stack/router/cookie';
|
|
6
|
+
import '@aura-stack/jose/jose';
|
package/dist/oauth/bitbucket.js
CHANGED
package/dist/oauth/discord.cjs
CHANGED
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
var __defProp = Object.defineProperty
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
9
10
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
19
|
|
|
19
20
|
// src/oauth/discord.ts
|
|
20
|
-
var discord_exports = {}
|
|
21
|
+
var discord_exports = {};
|
|
21
22
|
__export(discord_exports, {
|
|
22
|
-
|
|
23
|
-
})
|
|
24
|
-
module.exports = __toCommonJS(discord_exports)
|
|
23
|
+
discord: () => discord
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(discord_exports);
|
|
25
26
|
var discord = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
27
|
+
id: "discord",
|
|
28
|
+
name: "Discord",
|
|
29
|
+
authorizeURL: "https://discord.com/oauth2/authorize",
|
|
30
|
+
accessToken: "https://discord.com/api/oauth2/token",
|
|
31
|
+
userInfo: "https://discord.com/api/users/@me",
|
|
32
|
+
scope: "identify email",
|
|
33
|
+
responseType: "code",
|
|
34
|
+
profile(profile) {
|
|
35
|
+
let image = "";
|
|
36
|
+
if (profile.avatar === null) {
|
|
37
|
+
const index = profile.discriminator === "0" ? (BigInt(profile.id) >> 22n) % 6n : Number(profile.discriminator) % 5;
|
|
38
|
+
image = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
|
|
39
|
+
} else {
|
|
40
|
+
const format = profile.avatar.startsWith("a_") ? "gif" : "png";
|
|
41
|
+
image = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.${format}`;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
sub: profile.id,
|
|
45
|
+
name: profile.global_name ?? profile.username,
|
|
46
|
+
email: profile.email ?? "",
|
|
47
|
+
image
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 &&
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
discord
|
|
54
|
+
});
|
package/dist/oauth/discord.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { D as DiscordProfile, N as Nameplate,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "../@types/utility.js"
|
|
1
|
+
export { D as DiscordProfile, N as Nameplate, p as discord } from '../index-EqsoyjrF.js';
|
|
2
|
+
import 'zod/v4';
|
|
3
|
+
import '../schemas.js';
|
|
4
|
+
import '@aura-stack/router/cookie';
|
|
5
|
+
import '@aura-stack/jose/jose';
|
|
6
|
+
import '../@types/utility.js';
|
package/dist/oauth/discord.js
CHANGED