@aura-stack/elysia 0.1.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.
Files changed (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -0
  3. package/dist/_core/cookies.cjs +1 -0
  4. package/dist/_core/cookies.d.ts +1 -0
  5. package/dist/_core/cookies.js +1 -0
  6. package/dist/_core/crypto.cjs +1 -0
  7. package/dist/_core/crypto.d.ts +1 -0
  8. package/dist/_core/crypto.js +1 -0
  9. package/dist/_core/identity.cjs +1 -0
  10. package/dist/_core/identity.d.ts +1 -0
  11. package/dist/_core/identity.js +1 -0
  12. package/dist/_core/shared.cjs +1 -0
  13. package/dist/_core/shared.d.ts +1 -0
  14. package/dist/_core/shared.js +1 -0
  15. package/dist/index.cjs +1 -0
  16. package/dist/index.d.ts +693 -0
  17. package/dist/index.js +1 -0
  18. package/dist/oauth/atlassian.cjs +1 -0
  19. package/dist/oauth/atlassian.d.ts +1 -0
  20. package/dist/oauth/atlassian.js +1 -0
  21. package/dist/oauth/bitbucket.cjs +1 -0
  22. package/dist/oauth/bitbucket.d.ts +1 -0
  23. package/dist/oauth/bitbucket.js +1 -0
  24. package/dist/oauth/click-up.cjs +1 -0
  25. package/dist/oauth/click-up.d.ts +1 -0
  26. package/dist/oauth/click-up.js +1 -0
  27. package/dist/oauth/discord.cjs +1 -0
  28. package/dist/oauth/discord.d.ts +1 -0
  29. package/dist/oauth/discord.js +1 -0
  30. package/dist/oauth/dribbble.cjs +1 -0
  31. package/dist/oauth/dribbble.d.ts +1 -0
  32. package/dist/oauth/dribbble.js +1 -0
  33. package/dist/oauth/dropbox.cjs +1 -0
  34. package/dist/oauth/dropbox.d.ts +1 -0
  35. package/dist/oauth/dropbox.js +1 -0
  36. package/dist/oauth/figma.cjs +1 -0
  37. package/dist/oauth/figma.d.ts +1 -0
  38. package/dist/oauth/figma.js +1 -0
  39. package/dist/oauth/github.cjs +1 -0
  40. package/dist/oauth/github.d.ts +1 -0
  41. package/dist/oauth/github.js +1 -0
  42. package/dist/oauth/gitlab.cjs +1 -0
  43. package/dist/oauth/gitlab.d.ts +1 -0
  44. package/dist/oauth/gitlab.js +1 -0
  45. package/dist/oauth/index.cjs +1 -0
  46. package/dist/oauth/index.d.ts +1 -0
  47. package/dist/oauth/index.js +1 -0
  48. package/dist/oauth/mailchimp.cjs +1 -0
  49. package/dist/oauth/mailchimp.d.ts +1 -0
  50. package/dist/oauth/mailchimp.js +1 -0
  51. package/dist/oauth/notion.cjs +1 -0
  52. package/dist/oauth/notion.d.ts +1 -0
  53. package/dist/oauth/notion.js +1 -0
  54. package/dist/oauth/pinterest.cjs +1 -0
  55. package/dist/oauth/pinterest.d.ts +1 -0
  56. package/dist/oauth/pinterest.js +1 -0
  57. package/dist/oauth/spotify.cjs +1 -0
  58. package/dist/oauth/spotify.d.ts +1 -0
  59. package/dist/oauth/spotify.js +1 -0
  60. package/dist/oauth/strava.cjs +1 -0
  61. package/dist/oauth/strava.d.ts +1 -0
  62. package/dist/oauth/strava.js +1 -0
  63. package/dist/oauth/twitch.cjs +1 -0
  64. package/dist/oauth/twitch.d.ts +1 -0
  65. package/dist/oauth/twitch.js +1 -0
  66. package/dist/oauth/x.cjs +1 -0
  67. package/dist/oauth/x.d.ts +1 -0
  68. package/dist/oauth/x.js +1 -0
  69. package/package.json +105 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Auth Stack Js
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ <div align="center">
2
+
3
+ <h1><b>@aura-stack/elysia</b></h1>
4
+
5
+ **Elysia middleware and utilities for the Aura Stack authentication library**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@aura-stack/elysia.svg)](https://www.npmjs.com/package/@aura-stack/elysia)
8
+ [![JSR version](https://jsr.io/badges/@aura-stack/elysia)](https://jsr.io/@aura-stack/elysia)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10
+
11
+ [Official Docs](https://aura-stack-auth.vercel.app/docs) · [Elysia Package Docs](https://aura-stack-auth.vercel.app/docs/packages/elysia)
12
+
13
+ </div>
14
+
15
+ ## Overview
16
+
17
+ `@aura-stack/elysia` provides a seamless integration layer for **Elysia** applications using **Aura Auth**. It allows you to easily mount authentication handlers and protect your routes using type-safe context derivation.
18
+
19
+ It leverages Elysia's functional architecture to provide session management and authentication flows with first-class TypeScript support.
20
+
21
+ ## Features
22
+
23
+ - **Elysia Native** — Designed to work with Elysia's `.derive()` and `.resolve()` patterns.
24
+ - **Type-safe Context** — Automatically injects `session` into your handlers with full type inference.
25
+ - **Unified Handlers** — Bridge Web Request/Response API handlers to Elysia effortlessly.
26
+ - **Deno & Bun Ready** — Optimized for high-performance runtimes.
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ pnpm add @aura-stack/elysia @aura-stack/auth
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ### 1. Configure Auth
37
+
38
+ Create your authentication instance. This typically goes in a shared file like `lib/auth.ts`.
39
+
40
+ ```tsx
41
+ import { createAuth } from "@aura-stack/elysia"
42
+
43
+ export const auth = createAuth({
44
+ oauth: ["github"],
45
+ // your configuration
46
+ })
47
+
48
+ export const { toHandler, withAuth } = auth
49
+ ```
50
+
51
+ ### 2. Mount Auth Endpoints
52
+
53
+ Mount the authentication endpoints using `app.all()`.
54
+
55
+ ```tsx
56
+ import { Elysia } from "elysia"
57
+ import { toHandler } from "./lib/auth"
58
+
59
+ const app = new Elysia().all("/api/auth/*", (ctx) => toHandler(ctx))
60
+ ```
61
+
62
+ ### 3. Protect Your Routes
63
+
64
+ Use the `withAuth` utility with `.derive()` to protect routes. The session will be available in the handler's context.
65
+
66
+ ```tsx
67
+ import { withAuth } from "./lib/auth"
68
+
69
+ app.derive(withAuth).get("/api/protected", ({ session, error }) => {
70
+ if (!session) {
71
+ return error(401, "Unauthorized")
72
+ }
73
+
74
+ return { message: `Hello, ${session.user.name}!` }
75
+ })
76
+ ```
77
+
78
+ ## Documentation
79
+
80
+ Visit the [**official documentation website**](https://aura-stack-auth.vercel.app) for more detailed guides and API references.
81
+
82
+ ## License
83
+
84
+ Licensed under the [MIT License](../../LICENSE). © [Aura Stack](https://github.com/aura-stack-ts)
85
+
86
+ ---
87
+
88
+ <p align="center">
89
+ Made with ❤️ by <a href="https://github.com/aura-stack-ts">Aura Stack team</a>
90
+ </p>
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/cookies`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/cookies";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/cookies";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/crypto`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/crypto";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/crypto";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/identity`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/identity";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/identity";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/shared`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/shared";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/shared";
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@aura-stack/auth`);const t=e=>async({request:t})=>await e.ALL(t),n=({api:e})=>async({request:t})=>{try{let{session:n,success:r}=await e.getSession({headers:t.headers});return{session:r?n:null}}catch{return{session:null}}},r=r=>{let i=(0,e.createAuth)(r);return{...i,toHandler:t(i.handlers),withAuth:n(i)}};exports.createAuth=r;
@@ -0,0 +1,693 @@
1
+ import { AuthConfig as AuthConfig$1, Session as Session$1, User as User$1 } from "@aura-stack/auth";
2
+ import { FromShapeToObject, Identities } from "@aura-stack/auth/identity";
3
+ import * as _$elysia from "elysia";
4
+ import * as _$_aura_stack_auth_types0 from "@aura-stack/auth/types";
5
+ import { AuthConfig, AuthInstance, Session, User } from "@aura-stack/auth/types";
6
+
7
+ //#region src/lib/with-auth.d.ts
8
+ type WithAuthContext<DefaultUser extends User$1 = User$1> = {
9
+ session?: Session$1<DefaultUser> | null;
10
+ };
11
+ //#endregion
12
+ //#region ../../node_modules/.pnpm/jose@6.2.1/node_modules/jose/dist/types/types.d.ts
13
+ /** Generic JSON Web Key Parameters. */
14
+ interface JWKParameters$1 {
15
+ /** JWK "kty" (Key Type) Parameter */
16
+ kty?: string;
17
+ /**
18
+ * JWK "alg" (Algorithm) Parameter
19
+ *
20
+ * @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
21
+ */
22
+ alg?: string;
23
+ /** JWK "key_ops" (Key Operations) Parameter */
24
+ key_ops?: string[];
25
+ /** JWK "ext" (Extractable) Parameter */
26
+ ext?: boolean;
27
+ /** JWK "use" (Public Key Use) Parameter */
28
+ use?: string;
29
+ /** JWK "x5c" (X.509 Certificate Chain) Parameter */
30
+ x5c?: string[];
31
+ /** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
32
+ x5t?: string;
33
+ /** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
34
+ 'x5t#S256'?: string;
35
+ /** JWK "x5u" (X.509 URL) Parameter */
36
+ x5u?: string;
37
+ /** JWK "kid" (Key ID) Parameter */
38
+ kid?: string;
39
+ }
40
+ /**
41
+ * JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", "AKP", and
42
+ * "oct" key types are supported.
43
+ *
44
+ * @see {@link JWK_AKP_Public}
45
+ * @see {@link JWK_AKP_Private}
46
+ * @see {@link JWK_OKP_Public}
47
+ * @see {@link JWK_OKP_Private}
48
+ * @see {@link JWK_EC_Public}
49
+ * @see {@link JWK_EC_Private}
50
+ * @see {@link JWK_RSA_Public}
51
+ * @see {@link JWK_RSA_Private}
52
+ * @see {@link JWK_oct}
53
+ */
54
+ interface JWK$1 extends JWKParameters$1 {
55
+ /**
56
+ * - EC JWK "crv" (Curve) Parameter
57
+ * - OKP JWK "crv" (The Subtype of Key Pair) Parameter
58
+ */
59
+ crv?: string;
60
+ /**
61
+ * - Private RSA JWK "d" (Private Exponent) Parameter
62
+ * - Private EC JWK "d" (ECC Private Key) Parameter
63
+ * - Private OKP JWK "d" (The Private Key) Parameter
64
+ */
65
+ d?: string;
66
+ /** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
67
+ dp?: string;
68
+ /** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
69
+ dq?: string;
70
+ /** RSA JWK "e" (Exponent) Parameter */
71
+ e?: string;
72
+ /** Oct JWK "k" (Key Value) Parameter */
73
+ k?: string;
74
+ /** RSA JWK "n" (Modulus) Parameter */
75
+ n?: string;
76
+ /** Private RSA JWK "p" (First Prime Factor) Parameter */
77
+ p?: string;
78
+ /** Private RSA JWK "q" (Second Prime Factor) Parameter */
79
+ q?: string;
80
+ /** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
81
+ qi?: string;
82
+ /**
83
+ * - EC JWK "x" (X Coordinate) Parameter
84
+ * - OKP JWK "x" (The public key) Parameter
85
+ */
86
+ x?: string;
87
+ /** EC JWK "y" (Y Coordinate) Parameter */
88
+ y?: string;
89
+ /** AKP JWK "pub" (Public Key) Parameter */
90
+ pub?: string;
91
+ /** AKP JWK "priv" (Private key) Parameter */
92
+ priv?: string;
93
+ }
94
+ /** Header Parameters common to JWE and JWS */
95
+ interface JoseHeaderParameters$1 {
96
+ /** "kid" (Key ID) Header Parameter */
97
+ kid?: string;
98
+ /** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
99
+ x5t?: string;
100
+ /** "x5c" (X.509 Certificate Chain) Header Parameter */
101
+ x5c?: string[];
102
+ /** "x5u" (X.509 URL) Header Parameter */
103
+ x5u?: string;
104
+ /** "jku" (JWK Set URL) Header Parameter */
105
+ jku?: string;
106
+ /** "jwk" (JSON Web Key) Header Parameter */
107
+ jwk?: Pick<JWK$1, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n' | 'alg' | 'pub'>;
108
+ /** "typ" (Type) Header Parameter */
109
+ typ?: string;
110
+ /** "cty" (Content Type) Header Parameter */
111
+ cty?: string;
112
+ }
113
+ /** Recognized JWS Header Parameters, any other Header Members may also be present. */
114
+ interface JWSHeaderParameters$1 extends JoseHeaderParameters$1 {
115
+ /**
116
+ * JWS "alg" (Algorithm) Header Parameter
117
+ *
118
+ * @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
119
+ */
120
+ alg?: string;
121
+ /**
122
+ * This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
123
+ * Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
124
+ */
125
+ b64?: boolean;
126
+ /** JWS "crit" (Critical) Header Parameter */
127
+ crit?: string[];
128
+ /** Any other JWS Header member. */
129
+ [propName: string]: unknown;
130
+ }
131
+ /** Recognized JWE Header Parameters, any other Header members may also be present. */
132
+ interface JWEHeaderParameters$1 extends JoseHeaderParameters$1 {
133
+ /**
134
+ * JWE "alg" (Algorithm) Header Parameter
135
+ *
136
+ * @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
137
+ */
138
+ alg?: string;
139
+ /**
140
+ * JWE "enc" (Encryption Algorithm) Header Parameter
141
+ *
142
+ * @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
143
+ */
144
+ enc?: string;
145
+ /** JWE "crit" (Critical) Header Parameter */
146
+ crit?: string[];
147
+ /**
148
+ * JWE "zip" (Compression Algorithm) Header Parameter.
149
+ *
150
+ * The only supported value is `"DEF"` (DEFLATE). Requires the `CompressionStream` /
151
+ * `DecompressionStream` APIs to be available in the runtime.
152
+ *
153
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7516#section-4.1.3 JWE "zip" Header Parameter}
154
+ */
155
+ zip?: string;
156
+ /** Any other JWE Header member. */
157
+ [propName: string]: unknown;
158
+ }
159
+ /** Shared Interface with a "crit" property for all sign, verify, encrypt and decrypt operations. */
160
+ interface CritOption$1 {
161
+ /**
162
+ * An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
163
+ * for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity
164
+ * protected, `false` when it's irrelevant.
165
+ *
166
+ * This makes the "Extension Header Parameter "..." is not recognized" error go away.
167
+ *
168
+ * Use this when a given JWS/JWT/JWE profile requires the use of proprietary non-registered "crit"
169
+ * (Critical) Header Parameters. This will only make sure the Header Parameter is syntactically
170
+ * correct when provided and that it is optionally integrity protected. It will not process the
171
+ * Header Parameter in any way or reject the operation if it is missing. You MUST still verify the
172
+ * Header Parameter was present and process it according to the profile's validation steps after
173
+ * the operation succeeds.
174
+ *
175
+ * The JWS extension Header Parameter `b64` is always recognized and processed properly. No other
176
+ * registered Header Parameters that need this kind of default built-in treatment are currently
177
+ * available.
178
+ */
179
+ crit?: {
180
+ [propName: string]: boolean;
181
+ };
182
+ }
183
+ /** JWE Decryption options. */
184
+ interface DecryptOptions$1 extends CritOption$1 {
185
+ /**
186
+ * A list of accepted JWE "alg" (Algorithm) Header Parameter values. By default all "alg"
187
+ * (Algorithm) Header Parameter values applicable for the used key/secret are allowed except for
188
+ * all PBES2 Key Management Algorithms, these need to be explicitly allowed using this option.
189
+ */
190
+ keyManagementAlgorithms?: string[];
191
+ /**
192
+ * A list of accepted JWE "enc" (Encryption Algorithm) Header Parameter values. By default all
193
+ * "enc" (Encryption Algorithm) values applicable for the used key/secret are allowed.
194
+ */
195
+ contentEncryptionAlgorithms?: string[];
196
+ /**
197
+ * (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter
198
+ * value. The PBKDF2 iteration count defines the algorithm's computational expense. By default
199
+ * this value is set to 10000.
200
+ */
201
+ maxPBES2Count?: number;
202
+ /**
203
+ * Maximum allowed size (in bytes) of the decompressed plaintext when the JWE `"zip"` (Compression
204
+ * Algorithm) Header Parameter is present. By default this value is set to 250000 (250 KB). The
205
+ * value must be `0`, a positive safe integer, or `Infinity`.
206
+ *
207
+ * Set to `0` to reject all compressed JWEs during decryption.
208
+ *
209
+ * Set to `Infinity` to disable the decompressed size limit.
210
+ */
211
+ maxDecompressedLength?: number;
212
+ }
213
+ /** JWT Claims Set verification options. */
214
+ interface JWTClaimVerificationOptions$1 {
215
+ /**
216
+ * Expected JWT "aud" (Audience) Claim value(s).
217
+ *
218
+ * This option makes the JWT "aud" (Audience) Claim presence required.
219
+ */
220
+ audience?: string | string[];
221
+ /**
222
+ * Clock skew tolerance
223
+ *
224
+ * - In seconds when number (e.g. 5)
225
+ * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
226
+ *
227
+ * Used when validating the JWT "nbf" (Not Before) and "exp" (Expiration Time) claims, and when
228
+ * validating the "iat" (Issued At) claim if the {@link maxTokenAge `maxTokenAge` option} is set.
229
+ */
230
+ clockTolerance?: string | number;
231
+ /**
232
+ * Expected JWT "iss" (Issuer) Claim value(s).
233
+ *
234
+ * This option makes the JWT "iss" (Issuer) Claim presence required.
235
+ */
236
+ issuer?: string | string[];
237
+ /**
238
+ * Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.
239
+ *
240
+ * - In seconds when number (e.g. 5)
241
+ * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
242
+ *
243
+ * This option makes the JWT "iat" (Issued At) Claim presence required.
244
+ */
245
+ maxTokenAge?: string | number;
246
+ /**
247
+ * Expected JWT "sub" (Subject) Claim value.
248
+ *
249
+ * This option makes the JWT "sub" (Subject) Claim presence required.
250
+ */
251
+ subject?: string;
252
+ /**
253
+ * Expected JWT "typ" (Type) Header Parameter value.
254
+ *
255
+ * This option makes the JWT "typ" (Type) Header Parameter presence required.
256
+ */
257
+ typ?: string;
258
+ /** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
259
+ currentDate?: Date;
260
+ /**
261
+ * Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if
262
+ * the {@link issuer `issuer` option} is set, then JWT "iss" (Issuer) Claim must be present; if the
263
+ * {@link audience `audience` option} is set, then JWT "aud" (Audience) Claim must be present; if
264
+ * the {@link subject `subject` option} is set, then JWT "sub" (Subject) Claim must be present; if
265
+ * the {@link maxTokenAge `maxTokenAge` option} is set, then JWT "iat" (Issued At) Claim must be
266
+ * present.
267
+ */
268
+ requiredClaims?: string[];
269
+ }
270
+ /** JWS Verification options. */
271
+ interface VerifyOptions$1 extends CritOption$1 {
272
+ /**
273
+ * A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg"
274
+ * (Algorithm) values applicable for the used key/secret are allowed.
275
+ *
276
+ * > [!NOTE]\
277
+ * > Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
278
+ */
279
+ algorithms?: string[];
280
+ }
281
+ /** Recognized JWT Claims Set members, any other members may also be present. */
282
+ interface JWTPayload {
283
+ /**
284
+ * JWT Issuer
285
+ *
286
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1}
287
+ */
288
+ iss?: string;
289
+ /**
290
+ * JWT Subject
291
+ *
292
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2}
293
+ */
294
+ sub?: string;
295
+ /**
296
+ * JWT Audience
297
+ *
298
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3}
299
+ */
300
+ aud?: string | string[];
301
+ /**
302
+ * JWT ID
303
+ *
304
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7}
305
+ */
306
+ jti?: string;
307
+ /**
308
+ * JWT Not Before
309
+ *
310
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5}
311
+ */
312
+ nbf?: number;
313
+ /**
314
+ * JWT Expiration Time
315
+ *
316
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
317
+ */
318
+ exp?: number;
319
+ /**
320
+ * JWT Issued At
321
+ *
322
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
323
+ */
324
+ iat?: number;
325
+ /** Any other JWT Claim Set member. */
326
+ [propName: string]: unknown;
327
+ }
328
+ /** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */
329
+ interface CompactJWSHeaderParameters$1 extends JWSHeaderParameters$1 {
330
+ alg: string;
331
+ }
332
+ /** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */
333
+ interface JWTHeaderParameters$1 extends CompactJWSHeaderParameters$1 {
334
+ b64?: true;
335
+ }
336
+ //#endregion
337
+ //#region ../../node_modules/.pnpm/jose@6.2.1/node_modules/jose/dist/types/jwt/verify.d.ts
338
+ /** Combination of JWS Verification options and JWT Claims Set verification options. */
339
+ interface JWTVerifyOptions$1 extends VerifyOptions$1, JWTClaimVerificationOptions$1 {}
340
+ //#endregion
341
+ //#region ../jose/dist/index.d.ts
342
+ type TypedJWTPayload<Payload extends JWTPayload> = JWTPayload & Payload;
343
+ /**
344
+ * JWT options for signin and encryption.
345
+ */
346
+ interface EncodeJWTOptions {
347
+ sign?: JWTHeaderParameters$1;
348
+ encrypt?: JWEHeaderParameters$1;
349
+ }
350
+ /**
351
+ * Decoded JWT payload options for verification and decryption.
352
+ */
353
+ interface DecodeJWTOptions {
354
+ verify?: JWTVerifyOptions$1;
355
+ decrypt?: DecryptOptions$1;
356
+ }
357
+ //#endregion
358
+ //#region ../../node_modules/.deno/jose@6.2.2/node_modules/jose/dist/types/types.d.ts
359
+ /** Generic JSON Web Key Parameters. */
360
+ interface JWKParameters {
361
+ /** JWK "kty" (Key Type) Parameter */
362
+ kty?: string;
363
+ /**
364
+ * JWK "alg" (Algorithm) Parameter
365
+ *
366
+ * @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
367
+ */
368
+ alg?: string;
369
+ /** JWK "key_ops" (Key Operations) Parameter */
370
+ key_ops?: string[];
371
+ /** JWK "ext" (Extractable) Parameter */
372
+ ext?: boolean;
373
+ /** JWK "use" (Public Key Use) Parameter */
374
+ use?: string;
375
+ /** JWK "x5c" (X.509 Certificate Chain) Parameter */
376
+ x5c?: string[];
377
+ /** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
378
+ x5t?: string;
379
+ /** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
380
+ 'x5t#S256'?: string;
381
+ /** JWK "x5u" (X.509 URL) Parameter */
382
+ x5u?: string;
383
+ /** JWK "kid" (Key ID) Parameter */
384
+ kid?: string;
385
+ }
386
+ /**
387
+ * JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", "AKP", and
388
+ * "oct" key types are supported.
389
+ *
390
+ * @see {@link JWK_AKP_Public}
391
+ * @see {@link JWK_AKP_Private}
392
+ * @see {@link JWK_OKP_Public}
393
+ * @see {@link JWK_OKP_Private}
394
+ * @see {@link JWK_EC_Public}
395
+ * @see {@link JWK_EC_Private}
396
+ * @see {@link JWK_RSA_Public}
397
+ * @see {@link JWK_RSA_Private}
398
+ * @see {@link JWK_oct}
399
+ */
400
+ interface JWK extends JWKParameters {
401
+ /**
402
+ * - EC JWK "crv" (Curve) Parameter
403
+ * - OKP JWK "crv" (The Subtype of Key Pair) Parameter
404
+ */
405
+ crv?: string;
406
+ /**
407
+ * - Private RSA JWK "d" (Private Exponent) Parameter
408
+ * - Private EC JWK "d" (ECC Private Key) Parameter
409
+ * - Private OKP JWK "d" (The Private Key) Parameter
410
+ */
411
+ d?: string;
412
+ /** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
413
+ dp?: string;
414
+ /** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
415
+ dq?: string;
416
+ /** RSA JWK "e" (Exponent) Parameter */
417
+ e?: string;
418
+ /** Oct JWK "k" (Key Value) Parameter */
419
+ k?: string;
420
+ /** RSA JWK "n" (Modulus) Parameter */
421
+ n?: string;
422
+ /** Private RSA JWK "p" (First Prime Factor) Parameter */
423
+ p?: string;
424
+ /** Private RSA JWK "q" (Second Prime Factor) Parameter */
425
+ q?: string;
426
+ /** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
427
+ qi?: string;
428
+ /**
429
+ * - EC JWK "x" (X Coordinate) Parameter
430
+ * - OKP JWK "x" (The public key) Parameter
431
+ */
432
+ x?: string;
433
+ /** EC JWK "y" (Y Coordinate) Parameter */
434
+ y?: string;
435
+ /** AKP JWK "pub" (Public Key) Parameter */
436
+ pub?: string;
437
+ /** AKP JWK "priv" (Private key) Parameter */
438
+ priv?: string;
439
+ }
440
+ /** Header Parameters common to JWE and JWS */
441
+ interface JoseHeaderParameters {
442
+ /** "kid" (Key ID) Header Parameter */
443
+ kid?: string;
444
+ /** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
445
+ x5t?: string;
446
+ /** "x5c" (X.509 Certificate Chain) Header Parameter */
447
+ x5c?: string[];
448
+ /** "x5u" (X.509 URL) Header Parameter */
449
+ x5u?: string;
450
+ /** "jku" (JWK Set URL) Header Parameter */
451
+ jku?: string;
452
+ /** "jwk" (JSON Web Key) Header Parameter */
453
+ jwk?: Pick<JWK, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n' | 'alg' | 'pub'>;
454
+ /** "typ" (Type) Header Parameter */
455
+ typ?: string;
456
+ /** "cty" (Content Type) Header Parameter */
457
+ cty?: string;
458
+ }
459
+ /** Recognized JWS Header Parameters, any other Header Members may also be present. */
460
+ interface JWSHeaderParameters extends JoseHeaderParameters {
461
+ /**
462
+ * JWS "alg" (Algorithm) Header Parameter
463
+ *
464
+ * @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
465
+ */
466
+ alg?: string;
467
+ /**
468
+ * This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
469
+ * Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
470
+ */
471
+ b64?: boolean;
472
+ /** JWS "crit" (Critical) Header Parameter */
473
+ crit?: string[];
474
+ /** Any other JWS Header member. */
475
+ [propName: string]: unknown;
476
+ }
477
+ /** Recognized JWE Header Parameters, any other Header members may also be present. */
478
+ interface JWEHeaderParameters extends JoseHeaderParameters {
479
+ /**
480
+ * JWE "alg" (Algorithm) Header Parameter
481
+ *
482
+ * @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
483
+ */
484
+ alg?: string;
485
+ /**
486
+ * JWE "enc" (Encryption Algorithm) Header Parameter
487
+ *
488
+ * @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
489
+ */
490
+ enc?: string;
491
+ /** JWE "crit" (Critical) Header Parameter */
492
+ crit?: string[];
493
+ /**
494
+ * JWE "zip" (Compression Algorithm) Header Parameter.
495
+ *
496
+ * The only supported value is `"DEF"` (DEFLATE). Requires the `CompressionStream` /
497
+ * `DecompressionStream` APIs to be available in the runtime.
498
+ *
499
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7516#section-4.1.3 JWE "zip" Header Parameter}
500
+ */
501
+ zip?: string;
502
+ /** Any other JWE Header member. */
503
+ [propName: string]: unknown;
504
+ }
505
+ /** Shared Interface with a "crit" property for all sign, verify, encrypt and decrypt operations. */
506
+ interface CritOption {
507
+ /**
508
+ * An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
509
+ * for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity
510
+ * protected, `false` when it's irrelevant.
511
+ *
512
+ * This makes the "Extension Header Parameter "..." is not recognized" error go away.
513
+ *
514
+ * Use this when a given JWS/JWT/JWE profile requires the use of proprietary non-registered "crit"
515
+ * (Critical) Header Parameters. This will only make sure the Header Parameter is syntactically
516
+ * correct when provided and that it is optionally integrity protected. It will not process the
517
+ * Header Parameter in any way or reject the operation if it is missing. You MUST still verify the
518
+ * Header Parameter was present and process it according to the profile's validation steps after
519
+ * the operation succeeds.
520
+ *
521
+ * The JWS extension Header Parameter `b64` is always recognized and processed properly. No other
522
+ * registered Header Parameters that need this kind of default built-in treatment are currently
523
+ * available.
524
+ */
525
+ crit?: {
526
+ [propName: string]: boolean;
527
+ };
528
+ }
529
+ /** JWE Decryption options. */
530
+ interface DecryptOptions extends CritOption {
531
+ /**
532
+ * A list of accepted JWE "alg" (Algorithm) Header Parameter values. By default all "alg"
533
+ * (Algorithm) Header Parameter values applicable for the used key/secret are allowed except for
534
+ * all PBES2 Key Management Algorithms, these need to be explicitly allowed using this option.
535
+ */
536
+ keyManagementAlgorithms?: string[];
537
+ /**
538
+ * A list of accepted JWE "enc" (Encryption Algorithm) Header Parameter values. By default all
539
+ * "enc" (Encryption Algorithm) values applicable for the used key/secret are allowed.
540
+ */
541
+ contentEncryptionAlgorithms?: string[];
542
+ /**
543
+ * (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter
544
+ * value. The PBKDF2 iteration count defines the algorithm's computational expense. By default
545
+ * this value is set to 10000.
546
+ */
547
+ maxPBES2Count?: number;
548
+ /**
549
+ * Maximum allowed size (in bytes) of the decompressed plaintext when the JWE `"zip"` (Compression
550
+ * Algorithm) Header Parameter is present. By default this value is set to 250000 (250 KB). The
551
+ * value must be `0`, a positive safe integer, or `Infinity`.
552
+ *
553
+ * Set to `0` to reject all compressed JWEs during decryption.
554
+ *
555
+ * Set to `Infinity` to disable the decompressed size limit.
556
+ */
557
+ maxDecompressedLength?: number;
558
+ }
559
+ /** JWT Claims Set verification options. */
560
+ interface JWTClaimVerificationOptions {
561
+ /**
562
+ * Expected JWT "aud" (Audience) Claim value(s).
563
+ *
564
+ * This option makes the JWT "aud" (Audience) Claim presence required.
565
+ */
566
+ audience?: string | string[];
567
+ /**
568
+ * Clock skew tolerance
569
+ *
570
+ * - In seconds when number (e.g. 5)
571
+ * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
572
+ *
573
+ * Used when validating the JWT "nbf" (Not Before) and "exp" (Expiration Time) claims, and when
574
+ * validating the "iat" (Issued At) claim if the {@link maxTokenAge `maxTokenAge` option} is set.
575
+ */
576
+ clockTolerance?: string | number;
577
+ /**
578
+ * Expected JWT "iss" (Issuer) Claim value(s).
579
+ *
580
+ * This option makes the JWT "iss" (Issuer) Claim presence required.
581
+ */
582
+ issuer?: string | string[];
583
+ /**
584
+ * Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.
585
+ *
586
+ * - In seconds when number (e.g. 5)
587
+ * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
588
+ *
589
+ * This option makes the JWT "iat" (Issued At) Claim presence required.
590
+ */
591
+ maxTokenAge?: string | number;
592
+ /**
593
+ * Expected JWT "sub" (Subject) Claim value.
594
+ *
595
+ * This option makes the JWT "sub" (Subject) Claim presence required.
596
+ */
597
+ subject?: string;
598
+ /**
599
+ * Expected JWT "typ" (Type) Header Parameter value.
600
+ *
601
+ * This option makes the JWT "typ" (Type) Header Parameter presence required.
602
+ */
603
+ typ?: string;
604
+ /** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
605
+ currentDate?: Date;
606
+ /**
607
+ * Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if
608
+ * the {@link issuer `issuer` option} is set, then JWT "iss" (Issuer) Claim must be present; if the
609
+ * {@link audience `audience` option} is set, then JWT "aud" (Audience) Claim must be present; if
610
+ * the {@link subject `subject` option} is set, then JWT "sub" (Subject) Claim must be present; if
611
+ * the {@link maxTokenAge `maxTokenAge` option} is set, then JWT "iat" (Issued At) Claim must be
612
+ * present.
613
+ */
614
+ requiredClaims?: string[];
615
+ }
616
+ /** JWS Verification options. */
617
+ interface VerifyOptions extends CritOption {
618
+ /**
619
+ * A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg"
620
+ * (Algorithm) values applicable for the used key/secret are allowed.
621
+ *
622
+ * > [!NOTE]\
623
+ * > Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
624
+ */
625
+ algorithms?: string[];
626
+ }
627
+ /** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */
628
+ interface CompactJWSHeaderParameters extends JWSHeaderParameters {
629
+ alg: string;
630
+ }
631
+ /** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */
632
+ interface JWTHeaderParameters extends CompactJWSHeaderParameters {
633
+ b64?: true;
634
+ }
635
+ //#endregion
636
+ //#region ../../node_modules/.deno/jose@6.2.2/node_modules/jose/dist/types/jwt/verify.d.ts
637
+ /** Combination of JWS Verification options and JWT Claims Set verification options. */
638
+ interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOptions {}
639
+ //#endregion
640
+ //#region ../../node_modules/.deno/jose@6.2.2/node_modules/jose/dist/types/jwt/decrypt.d.ts
641
+ /** Combination of JWE Decryption options and JWT Claims Set verification options. */
642
+ interface JWTDecryptOptions extends DecryptOptions, JWTClaimVerificationOptions {}
643
+ //#endregion
644
+ //#region src/createAuth.d.ts
645
+ /**
646
+ * Creates an Aura Auth instance with Elysia-specific utilities.
647
+ */
648
+ declare const createAuth: <Identity extends Identities>(config: AuthConfig$1<Identity>) => {
649
+ /**
650
+ * Elysia handler that bridges Aura Auth Web-API handlers.
651
+ * Mount this on the `basePath` configured in `createAuth()` (default: `/api/auth`).
652
+ *
653
+ * @example
654
+ * app.all("/api/auth/*", auth.toHandler)
655
+ */
656
+ toHandler: ({
657
+ request
658
+ }: _$elysia.Context) => Promise<Response>;
659
+ /**
660
+ * Utility to be used with Elysia's `.derive()` or `.resolve()` to inject the session into the context.
661
+ *
662
+ * @example
663
+ * app.derive(auth.withAuth).get("/me", ({ session }) => session)
664
+ */
665
+ withAuth: ({
666
+ request
667
+ }: {
668
+ request: Request;
669
+ }) => Promise<WithAuthContext<FromShapeToObject<Identity>>>;
670
+ api: {
671
+ getSession: (options: _$_aura_stack_auth_types0.GetSessionAPIOptions) => Promise<_$_aura_stack_auth_types0.GetSessionAPIReturn<FromShapeToObject<Identity>>>;
672
+ signIn: (oauth: _$_aura_stack_auth_types0.LiteralUnion<_$_aura_stack_auth_types0.BuiltInOAuthProvider>, options?: _$_aura_stack_auth_types0.SignInAPIOptions) => Promise<_$_aura_stack_auth_types0.SignInAPIReturn>;
673
+ signInCredentials: (options: _$_aura_stack_auth_types0.SignInCredentialsAPIOptions) => Promise<_$_aura_stack_auth_types0.SignInCredentialsAPIReturn>;
674
+ updateSession: (options: _$_aura_stack_auth_types0.UpdateSessionAPIOptions<FromShapeToObject<Identity>>) => Promise<_$_aura_stack_auth_types0.UpdateSessionAPIReturn<FromShapeToObject<Identity>>>;
675
+ signOut: (options: _$_aura_stack_auth_types0.SignOutAPIOptions) => Promise<_$_aura_stack_auth_types0.SignOutAPIReturn>;
676
+ };
677
+ jose: {
678
+ signJWS: (payload: TypedJWTPayload<Partial<FromShapeToObject<Identity>>>, options?: JWTHeaderParameters) => Promise<string>;
679
+ verifyJWS: (token: string, options?: JWTVerifyOptions) => Promise<TypedJWTPayload<FromShapeToObject<Identity>>>;
680
+ encryptJWE: (payload: TypedJWTPayload<Partial<FromShapeToObject<Identity>>>, options?: JWEHeaderParameters) => Promise<string>;
681
+ decryptJWE: (token: string, options?: JWTDecryptOptions) => Promise<TypedJWTPayload<FromShapeToObject<Identity>>>;
682
+ encodeJWT: (payload: TypedJWTPayload<Partial<FromShapeToObject<Identity>>>, options?: EncodeJWTOptions) => Promise<string>;
683
+ decodeJWT: (token: string, options?: DecodeJWTOptions) => Promise<TypedJWTPayload<FromShapeToObject<Identity>>>;
684
+ };
685
+ handlers: {
686
+ GET: (request: Request) => Response | Promise<Response>;
687
+ POST: (request: Request) => Response | Promise<Response>;
688
+ PATCH: (request: Request) => Response | Promise<Response>;
689
+ ALL: (request: Request) => Response | Promise<Response>;
690
+ };
691
+ };
692
+ //#endregion
693
+ export { type AuthConfig, type AuthInstance, type Session, type User, createAuth };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{createAuth as e}from"@aura-stack/auth";const t=e=>async({request:t})=>await e.ALL(t),n=({api:e})=>async({request:t})=>{try{let{session:n,success:r}=await e.getSession({headers:t.headers});return{session:r?n:null}}catch{return{session:null}}},r=r=>{let i=e(r);return{...i,toHandler:t(i.handlers),withAuth:n(i)}};export{r as createAuth};
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/atlassian`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/atlassian";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/atlassian";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/bitbucket`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/bitbucket";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/bitbucket";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/click-up`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/click-up";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/click-up";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/discord`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/discord";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/discord";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/dribbble`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/dribbble";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/dribbble";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/dropbox`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/dropbox";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/dropbox";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/figma`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/figma";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/figma";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/github`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/github";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/github";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/gitlab`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/gitlab";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/gitlab";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/index`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/index";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/index";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/mailchimp`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/mailchimp";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/mailchimp";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/notion`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/notion";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/notion";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/pinterest`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/pinterest";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/pinterest";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/spotify`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/spotify";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/spotify";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/strava`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/strava";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/strava";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/twitch`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/twitch";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/twitch";
@@ -0,0 +1 @@
1
+ var e=require(`@aura-stack/auth/oauth/x`);Object.keys(e).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
@@ -0,0 +1 @@
1
+ export * from "@aura-stack/auth/oauth/x";
@@ -0,0 +1 @@
1
+ export*from"@aura-stack/auth/oauth/x";
package/package.json ADDED
@@ -0,0 +1,105 @@
1
+ {
2
+ "name": "@aura-stack/elysia",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "Authentication integration for Elysia applications. Provides middleware, route handlers and session verification powered by Aura Auth.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/aura-stack-ts/auth"
10
+ },
11
+ "sideEffects": false,
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs"
20
+ },
21
+ "./oauth": {
22
+ "types": "./dist/oauth/index.d.ts",
23
+ "import": "./dist/oauth/index.js",
24
+ "require": "./dist/oauth/index.cjs"
25
+ },
26
+ "./oauth/*": {
27
+ "types": "./dist/oauth/*.d.ts",
28
+ "import": "./dist/oauth/*.js",
29
+ "require": "./dist/oauth/*.cjs"
30
+ },
31
+ "./identity": {
32
+ "types": "./dist/_core/identity.d.ts",
33
+ "import": "./dist/_core/identity.js",
34
+ "require": "./dist/_core/identity.cjs"
35
+ },
36
+ "./crypto": {
37
+ "types": "./dist/_core/crypto.d.ts",
38
+ "import": "./dist/_core/crypto.js",
39
+ "require": "./dist/_core/crypto.cjs"
40
+ },
41
+ "./shared": {
42
+ "types": "./dist/_core/shared.d.ts",
43
+ "import": "./dist/_core/shared.js",
44
+ "require": "./dist/_core/shared.cjs"
45
+ },
46
+ "./cookies": {
47
+ "types": "./dist/_core/cookies.d.ts",
48
+ "import": "./dist/_core/cookies.js",
49
+ "require": "./dist/_core/cookies.cjs"
50
+ }
51
+ },
52
+ "keywords": [
53
+ "auth",
54
+ "oauth",
55
+ "oauth2",
56
+ "security",
57
+ "session",
58
+ "authentication",
59
+ "authorization",
60
+ "elysia",
61
+ "elysiajs",
62
+ "bun",
63
+ "middleware",
64
+ "typescript",
65
+ "javascript",
66
+ "web-api",
67
+ "aura-stack",
68
+ "aura-stack-ts",
69
+ "aura auth",
70
+ "aura-auth"
71
+ ],
72
+ "author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
73
+ "homepage": "https://aura-stack-auth.vercel.app",
74
+ "bugs": {
75
+ "url": "https://github.com/aura-stack-ts/auth/issues"
76
+ },
77
+ "license": "MIT",
78
+ "dependencies": {
79
+ "@aura-stack/auth": "0.7.1"
80
+ },
81
+ "devDependencies": {
82
+ "elysia": "^1.2.22",
83
+ "vitest": "4.1.4",
84
+ "@aura-stack/tsconfig": "0.0.0",
85
+ "@aura-stack/tsdown-config": "0.0.0"
86
+ },
87
+ "peerDependencies": {
88
+ "elysia": ">=1.0.0"
89
+ },
90
+ "scripts": {
91
+ "dev": "tsdown --watch",
92
+ "build": "pnpm sync:modules && tsdown",
93
+ "lint": "oxlint",
94
+ "lint:fix": "oxlint --fix",
95
+ "test": "vitest --run",
96
+ "test:watch": "vitest",
97
+ "test:coverage": "vitest --run --coverage",
98
+ "format": "oxfmt",
99
+ "format:check": "oxfmt --check",
100
+ "type-check": "tsc --noEmit",
101
+ "clean": "rm -rf dist src/_core src/oauth",
102
+ "clean:cts": "[ -d dist ] && find dist -type f -name \"*.cts\" -delete || true",
103
+ "sync:modules": "node ../shared/scripts/modules.js"
104
+ }
105
+ }