@aura-stack/auth 0.1.0-rc.7 → 0.1.0-rc.8

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 (117) hide show
  1. package/dist/@types/index.cjs +15 -15
  2. package/dist/@types/index.d.ts +31 -7
  3. package/dist/@types/index.js +1 -1
  4. package/dist/@types/router.d.cjs +1 -1
  5. package/dist/@types/router.d.d.ts +7 -7
  6. package/dist/@types/utility.cjs +15 -15
  7. package/dist/@types/utility.d.ts +6 -6
  8. package/dist/@types/utility.js +1 -1
  9. package/dist/actions/callback/access-token.cjs +143 -143
  10. package/dist/actions/callback/access-token.d.ts +20 -15
  11. package/dist/actions/callback/access-token.js +4 -8
  12. package/dist/actions/callback/callback.cjs +455 -437
  13. package/dist/actions/callback/callback.d.ts +12 -10
  14. package/dist/actions/callback/callback.js +12 -16
  15. package/dist/actions/callback/userinfo.cjs +134 -131
  16. package/dist/actions/callback/userinfo.d.ts +9 -9
  17. package/dist/actions/callback/userinfo.js +6 -10
  18. package/dist/actions/csrfToken/csrfToken.cjs +171 -162
  19. package/dist/actions/csrfToken/csrfToken.d.ts +3 -3
  20. package/dist/actions/csrfToken/csrfToken.js +8 -12
  21. package/dist/actions/index.cjs +773 -746
  22. package/dist/actions/index.d.ts +13 -13
  23. package/dist/actions/index.js +18 -34
  24. package/dist/actions/session/session.cjs +155 -149
  25. package/dist/actions/session/session.d.ts +3 -3
  26. package/dist/actions/session/session.js +7 -11
  27. package/dist/actions/signIn/authorization.cjs +249 -231
  28. package/dist/actions/signIn/authorization.d.ts +18 -12
  29. package/dist/actions/signIn/authorization.js +6 -16
  30. package/dist/actions/signIn/signIn.cjs +423 -396
  31. package/dist/actions/signIn/signIn.d.ts +10 -10
  32. package/dist/actions/signIn/signIn.js +10 -14
  33. package/dist/actions/signOut/signOut.cjs +440 -417
  34. package/dist/actions/signOut/signOut.d.ts +3 -3
  35. package/dist/actions/signOut/signOut.js +11 -15
  36. package/dist/assert.cjs +36 -35
  37. package/dist/assert.d.ts +4 -4
  38. package/dist/assert.js +2 -10
  39. package/dist/chunk-256KIVJL.js +96 -85
  40. package/dist/chunk-42XB3YCW.js +17 -19
  41. package/dist/chunk-6SM22VVJ.js +10 -13
  42. package/dist/chunk-CAKJT3KS.js +69 -84
  43. package/dist/chunk-E3OXBRYF.js +17 -19
  44. package/dist/chunk-EBPE35JT.js +26 -28
  45. package/dist/chunk-FIPU4MLT.js +16 -18
  46. package/dist/chunk-FJUDBLCP.js +43 -50
  47. package/dist/chunk-FKRDCWBF.js +17 -19
  48. package/dist/chunk-GZU3RBTB.js +40 -51
  49. package/dist/chunk-HGJ4TXY4.js +100 -132
  50. package/dist/chunk-HMRKN75I.js +63 -63
  51. package/dist/chunk-IKHPGFCW.js +9 -11
  52. package/dist/chunk-JAPMIE6S.js +5 -7
  53. package/dist/chunk-KRNOMBXQ.js +17 -19
  54. package/dist/chunk-LLR722CL.js +70 -91
  55. package/dist/chunk-RLT4RFKV.js +30 -39
  56. package/dist/chunk-SJPDVKUS.js +88 -107
  57. package/dist/chunk-SMQO5WD7.js +16 -26
  58. package/dist/chunk-STHEPPUZ.js +6 -8
  59. package/dist/chunk-UJJ7R56J.js +37 -47
  60. package/dist/chunk-UTDLUEEG.js +25 -0
  61. package/dist/chunk-VFTYH33W.js +37 -54
  62. package/dist/chunk-XXJKNKGQ.js +23 -33
  63. package/dist/chunk-ZV4BH47P.js +134 -132
  64. package/dist/cookie.cjs +175 -169
  65. package/dist/cookie.d.ts +51 -23
  66. package/dist/cookie.js +34 -34
  67. package/dist/error.cjs +75 -75
  68. package/dist/error.d.ts +30 -30
  69. package/dist/error.js +8 -15
  70. package/dist/headers.cjs +28 -28
  71. package/dist/headers.d.ts +2 -2
  72. package/dist/headers.js +2 -6
  73. package/dist/index-DpfbvTZ_.d.ts +298 -249
  74. package/dist/index.cjs +969 -933
  75. package/dist/index.d.ts +31 -10
  76. package/dist/index.js +50 -70
  77. package/dist/jose.cjs +67 -52
  78. package/dist/jose.d.ts +8 -8
  79. package/dist/jose.js +5 -9
  80. package/dist/oauth/bitbucket.cjs +38 -38
  81. package/dist/oauth/bitbucket.d.ts +7 -7
  82. package/dist/oauth/bitbucket.js +2 -6
  83. package/dist/oauth/discord.cjs +48 -48
  84. package/dist/oauth/discord.d.ts +7 -7
  85. package/dist/oauth/discord.js +2 -6
  86. package/dist/oauth/figma.cjs +39 -39
  87. package/dist/oauth/figma.d.ts +7 -7
  88. package/dist/oauth/figma.js +2 -6
  89. package/dist/oauth/github.cjs +31 -31
  90. package/dist/oauth/github.d.ts +7 -7
  91. package/dist/oauth/github.js +2 -6
  92. package/dist/oauth/gitlab.cjs +39 -39
  93. package/dist/oauth/gitlab.d.ts +7 -7
  94. package/dist/oauth/gitlab.js +2 -6
  95. package/dist/oauth/index.cjs +180 -180
  96. package/dist/oauth/index.d.ts +26 -7
  97. package/dist/oauth/index.js +9 -36
  98. package/dist/oauth/spotify.cjs +39 -39
  99. package/dist/oauth/spotify.d.ts +7 -7
  100. package/dist/oauth/spotify.js +2 -6
  101. package/dist/oauth/x.cjs +39 -39
  102. package/dist/oauth/x.d.ts +7 -7
  103. package/dist/oauth/x.js +2 -6
  104. package/dist/response.cjs +27 -27
  105. package/dist/response.d.ts +2 -2
  106. package/dist/response.js +2 -6
  107. package/dist/schemas.cjs +91 -91
  108. package/dist/schemas.d.ts +126 -93
  109. package/dist/schemas.js +18 -18
  110. package/dist/secure.cjs +98 -95
  111. package/dist/secure.d.ts +17 -17
  112. package/dist/secure.js +4 -18
  113. package/dist/utils.cjs +132 -119
  114. package/dist/utils.d.ts +26 -11
  115. package/dist/utils.js +21 -21
  116. package/package.json +1 -1
  117. package/dist/chunk-X7M4CQTN.js +0 -25
package/dist/utils.d.ts CHANGED
@@ -1,9 +1,14 @@
1
- import { RouterConfig } from '@aura-stack/router';
1
+ import { RouterConfig } from "@aura-stack/router"
2
2
 
3
- declare const toSnakeCase: (str: string) => string;
4
- declare const toUpperCase: (str: string) => string;
5
- declare const toCastCase: <Obj extends Record<string, any>, Type extends "snake" | "upper">(obj: Obj, type?: Type) => Type extends "snake" ? { [K in keyof Obj as `${string & K}`]: Obj[K]; } : { [K in keyof Obj as Uppercase<string & K>]: Obj[K]; };
6
- declare const equals: (a: string | number | undefined | null, b: string | number | undefined | null) => boolean;
3
+ declare const toSnakeCase: (str: string) => string
4
+ declare const toUpperCase: (str: string) => string
5
+ declare const toCastCase: <Obj extends Record<string, any>, Type extends "snake" | "upper">(
6
+ obj: Obj,
7
+ type?: Type
8
+ ) => Type extends "snake"
9
+ ? { [K in keyof Obj as `${string & K}`]: Obj[K] }
10
+ : { [K in keyof Obj as Uppercase<string & K>]: Obj[K] }
11
+ declare const equals: (a: string | number | undefined | null, b: string | number | undefined | null) => boolean
7
12
  /**
8
13
  * Sanitizes a URL by removing dangerous patterns that could be used for path traversal
9
14
  * or other attacks. This function:
@@ -16,7 +21,7 @@ declare const equals: (a: string | number | undefined | null, b: string | number
16
21
  * @param url - The URL or path to sanitize
17
22
  * @returns The sanitized URL or path
18
23
  */
19
- declare const sanitizeURL: (url: string) => string;
24
+ declare const sanitizeURL: (url: string) => string
20
25
  /**
21
26
  * Validates that a path is a safe relative path to prevent open redirect attacks.
22
27
  * A safe relative path must:
@@ -29,8 +34,8 @@ declare const sanitizeURL: (url: string) => string;
29
34
  * @param path - The path to validate
30
35
  * @returns true if the path is safe, false otherwise
31
36
  */
32
- declare const isValidRelativePath: (path: string | undefined | null) => boolean;
33
- declare const onErrorHandler: RouterConfig["onError"];
37
+ declare const isValidRelativePath: (path: string | undefined | null) => boolean
38
+ declare const onErrorHandler: RouterConfig["onError"]
34
39
  /**
35
40
  * Extracts and normalizes the origin and pathname from a URL string.
36
41
  * Removes query parameters and hash fragments for a clean path.
@@ -39,7 +44,17 @@ declare const onErrorHandler: RouterConfig["onError"];
39
44
  * @param path - The URL or path string to process
40
45
  * @returns The normalized URL with origin and pathname, or the original path
41
46
  */
42
- declare const getNormalizedOriginPath: (path: string) => string;
43
- declare const toISOString: (date: Date | string | number) => string;
47
+ declare const getNormalizedOriginPath: (path: string) => string
48
+ declare const toISOString: (date: Date | string | number) => string
44
49
 
45
- export { equals, getNormalizedOriginPath, isValidRelativePath, onErrorHandler, sanitizeURL, toCastCase, toISOString, toSnakeCase, toUpperCase };
50
+ export {
51
+ equals,
52
+ getNormalizedOriginPath,
53
+ isValidRelativePath,
54
+ onErrorHandler,
55
+ sanitizeURL,
56
+ toCastCase,
57
+ toISOString,
58
+ toSnakeCase,
59
+ toUpperCase,
60
+ }
package/dist/utils.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import {
2
- equals,
3
- getNormalizedOriginPath,
4
- isValidRelativePath,
5
- onErrorHandler,
6
- sanitizeURL,
7
- toCastCase,
8
- toISOString,
9
- toSnakeCase,
10
- toUpperCase
11
- } from "./chunk-256KIVJL.js";
12
- import "./chunk-FJUDBLCP.js";
2
+ equals,
3
+ getNormalizedOriginPath,
4
+ isValidRelativePath,
5
+ onErrorHandler,
6
+ sanitizeURL,
7
+ toCastCase,
8
+ toISOString,
9
+ toSnakeCase,
10
+ toUpperCase,
11
+ } from "./chunk-256KIVJL.js"
12
+ import "./chunk-FJUDBLCP.js"
13
13
  export {
14
- equals,
15
- getNormalizedOriginPath,
16
- isValidRelativePath,
17
- onErrorHandler,
18
- sanitizeURL,
19
- toCastCase,
20
- toISOString,
21
- toSnakeCase,
22
- toUpperCase
23
- };
14
+ equals,
15
+ getNormalizedOriginPath,
16
+ isValidRelativePath,
17
+ onErrorHandler,
18
+ sanitizeURL,
19
+ toCastCase,
20
+ toISOString,
21
+ toSnakeCase,
22
+ toUpperCase,
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura-stack/auth",
3
- "version": "0.1.0-rc.7",
3
+ "version": "0.1.0-rc.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Core auth for @aura-stack/auth",
@@ -1,25 +0,0 @@
1
- import {
2
- createDerivedSalt
3
- } from "./chunk-GZU3RBTB.js";
4
-
5
- // src/jose.ts
6
- import "dotenv/config";
7
- import { createJWT, createJWS, createDeriveKey } from "@aura-stack/jose";
8
- var createJoseInstance = (secret) => {
9
- secret ?? (secret = process.env.AURA_AUTH_SECRET);
10
- const salt = process.env.AURA_AUTH_SALT ?? createDerivedSalt(secret);
11
- const { derivedKey: derivedSessionKey } = createDeriveKey(secret, salt, "session");
12
- const { derivedKey: derivedCsrfTokenKey } = createDeriveKey(secret, salt, "csrfToken");
13
- const { decodeJWT, encodeJWT } = createJWT(derivedSessionKey);
14
- const { signJWS, verifyJWS } = createJWS(derivedCsrfTokenKey);
15
- return {
16
- decodeJWT,
17
- encodeJWT,
18
- signJWS,
19
- verifyJWS
20
- };
21
- };
22
-
23
- export {
24
- createJoseInstance
25
- };