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