@aooth/auth 0.1.58 → 0.1.60

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.
@@ -1,6 +1,5 @@
1
1
  import { c as CredentialSuccessorRef, r as CredentialStore, s as CredentialState, t as Clock } from "./clock-C0O0FCCN.cjs";
2
- import { c as AuthCodeStore, d as NewAuthCode, h as PendingAuthorizationStore, m as PendingAuthorization, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient } from "./dynamic-client-store-Cujxec8n.cjs";
3
-
2
+ import { c as AuthCodeStore, d as NewAuthCode, h as PendingAuthorizationStore, m as PendingAuthorization, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient } from "./dynamic-client-store-CafYRhI4.cjs";
4
3
  //#region src/atscript-db/authz-stores.d.ts
5
4
  /**
6
5
  * atscript-db-backed durable implementations of the two short-lived
@@ -1,6 +1,5 @@
1
1
  import { c as CredentialSuccessorRef, r as CredentialStore, s as CredentialState, t as Clock } from "./clock-C0O0FCCN.mjs";
2
- import { c as AuthCodeStore, d as NewAuthCode, h as PendingAuthorizationStore, m as PendingAuthorization, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient } from "./dynamic-client-store-DEGFMiTK.mjs";
3
-
2
+ import { c as AuthCodeStore, d as NewAuthCode, h as PendingAuthorizationStore, m as PendingAuthorization, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient } from "./dynamic-client-store-BCAqzG0Y.mjs";
4
3
  //#region src/atscript-db/authz-stores.d.ts
5
4
  /**
6
5
  * atscript-db-backed durable implementations of the two short-lived
@@ -1,5 +1,4 @@
1
1
  import { a as AuthContext, d as RefreshConfig, f as RefreshResult, i as DenylistStore, l as EnrichedSession, m as SessionInfo, o as CredentialMetadata, p as SessionEnricher, r as CredentialStore, s as CredentialState, t as Clock, u as IssueResult } from "./clock-C0O0FCCN.mjs";
2
-
3
2
  //#region src/credential/auth-credential.d.ts
4
3
  interface AuthCredentialOptions<TPayload extends object = object> {
5
4
  /** Pluggable credential store (Memory, JWT, Encapsulated, ...). */
@@ -1,5 +1,4 @@
1
1
  import { a as AuthContext, d as RefreshConfig, f as RefreshResult, i as DenylistStore, l as EnrichedSession, m as SessionInfo, o as CredentialMetadata, p as SessionEnricher, r as CredentialStore, s as CredentialState, t as Clock, u as IssueResult } from "./clock-C0O0FCCN.cjs";
2
-
3
2
  //#region src/credential/auth-credential.d.ts
4
3
  interface AuthCredentialOptions<TPayload extends object = object> {
5
4
  /** Pluggable credential store (Memory, JWT, Encapsulated, ...). */
package/dist/authz.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { t as Clock } from "./clock-C0O0FCCN.cjs";
2
- import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-Cujxec8n.cjs";
2
+ import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-CafYRhI4.cjs";
3
3
  import { JWK } from "jose";
4
-
5
4
  //#region src/authz/authz-errors.d.ts
6
5
  /**
7
6
  * Failure taxonomy for the authorization-server endpoints (AUTH-SERVER.md §7).
@@ -10,12 +9,26 @@ import { JWK } from "jose";
10
9
  * code. Messages are benign — they must not disclose whether a failure was an
11
10
  * unknown client vs. a bad redirect vs. an expired code.
12
11
  */
13
- type AuthorizeErrorCode = /** Missing or malformed parameter at `/authorize` or `/token`. */"invalid_request" /** `redirect_uri` is not an allowed (loopback / registered) target. */ | "invalid_redirect" /** Code unknown / expired / already-redeemed, or PKCE verifier mismatch (`/token`). */ | "invalid_grant" /** Unknown or unauthenticated client (Tier 2). */ | "invalid_client" /** A known client used a grant/response it is not allowed (Tier 2). */ | "unauthorized_client"
12
+ type AuthorizeErrorCode =
13
+ /** Missing or malformed parameter at `/authorize` or `/token`. */
14
+ "invalid_request" |
15
+ /** `redirect_uri` is not an allowed (loopback / registered) target. */
16
+ "invalid_redirect" |
17
+ /** Code unknown / expired / already-redeemed, or PKCE verifier mismatch (`/token`). */
18
+ "invalid_grant" |
19
+ /** Unknown or unauthenticated client (Tier 2). */
20
+ "invalid_client" |
21
+ /** A known client used a grant/response it is not allowed (Tier 2). */
22
+ "unauthorized_client" |
14
23
  /**
15
24
  * RFC 8707: more than one `resource` value on a leg, or the `/token`
16
25
  * `resource` differs from the one recorded at `/authorize`.
17
26
  */
18
- | "invalid_target" /** The user declined the authorization (consent). */ | "access_denied" /** An unexpected server-side failure. */ | "server_error";
27
+ "invalid_target" |
28
+ /** The user declined the authorization (consent). */
29
+ "access_denied" |
30
+ /** An unexpected server-side failure. */
31
+ "server_error";
19
32
  /** A typed authorization-server failure. */
20
33
  declare class AuthorizeError extends Error {
21
34
  readonly code: AuthorizeErrorCode;
package/dist/authz.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { t as Clock } from "./clock-C0O0FCCN.mjs";
2
- import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-DEGFMiTK.mjs";
2
+ import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-BCAqzG0Y.mjs";
3
3
  import { JWK } from "jose";
4
-
5
4
  //#region src/authz/authz-errors.d.ts
6
5
  /**
7
6
  * Failure taxonomy for the authorization-server endpoints (AUTH-SERVER.md §7).
@@ -10,12 +9,26 @@ import { JWK } from "jose";
10
9
  * code. Messages are benign — they must not disclose whether a failure was an
11
10
  * unknown client vs. a bad redirect vs. an expired code.
12
11
  */
13
- type AuthorizeErrorCode = /** Missing or malformed parameter at `/authorize` or `/token`. */"invalid_request" /** `redirect_uri` is not an allowed (loopback / registered) target. */ | "invalid_redirect" /** Code unknown / expired / already-redeemed, or PKCE verifier mismatch (`/token`). */ | "invalid_grant" /** Unknown or unauthenticated client (Tier 2). */ | "invalid_client" /** A known client used a grant/response it is not allowed (Tier 2). */ | "unauthorized_client"
12
+ type AuthorizeErrorCode =
13
+ /** Missing or malformed parameter at `/authorize` or `/token`. */
14
+ "invalid_request" |
15
+ /** `redirect_uri` is not an allowed (loopback / registered) target. */
16
+ "invalid_redirect" |
17
+ /** Code unknown / expired / already-redeemed, or PKCE verifier mismatch (`/token`). */
18
+ "invalid_grant" |
19
+ /** Unknown or unauthenticated client (Tier 2). */
20
+ "invalid_client" |
21
+ /** A known client used a grant/response it is not allowed (Tier 2). */
22
+ "unauthorized_client" |
14
23
  /**
15
24
  * RFC 8707: more than one `resource` value on a leg, or the `/token`
16
25
  * `resource` differs from the one recorded at `/authorize`.
17
26
  */
18
- | "invalid_target" /** The user declined the authorization (consent). */ | "access_denied" /** An unexpected server-side failure. */ | "server_error";
27
+ "invalid_target" |
28
+ /** The user declined the authorization (consent). */
29
+ "access_denied" |
30
+ /** An unexpected server-side failure. */
31
+ "server_error";
19
32
  /** A typed authorization-server failure. */
20
33
  declare class AuthorizeError extends Error {
21
34
  readonly code: AuthorizeErrorCode;
@@ -1,6 +1,5 @@
1
1
  import { t as Clock } from "./clock-C0O0FCCN.mjs";
2
- import { r as IssueOptions } from "./auth-credential-C9xy4X_k.mjs";
3
-
2
+ import { r as IssueOptions } from "./auth-credential-C5DiSbb2.mjs";
4
3
  //#region src/authz/token-policy.d.ts
5
4
  /**
6
5
  * What the authorization server mints for a completed grant — forwarded verbatim
@@ -1,6 +1,5 @@
1
1
  import { t as Clock } from "./clock-C0O0FCCN.cjs";
2
- import { r as IssueOptions } from "./auth-credential-C5zD8b0J.cjs";
3
-
2
+ import { r as IssueOptions } from "./auth-credential-CU4vsKhu.cjs";
4
3
  //#region src/authz/token-policy.d.ts
5
4
  /**
6
5
  * What the authorization server mints for a completed grant — forwarded verbatim
package/dist/index.cjs CHANGED
@@ -184,7 +184,7 @@ function hkdfSubkey(ikm, label) {
184
184
  }
185
185
  //#endregion
186
186
  //#region src/stores/jwt.ts
187
- const HS_ALGS = new Set([
187
+ const HS_ALGS = /* @__PURE__ */ new Set([
188
188
  "HS256",
189
189
  "HS384",
190
190
  "HS512"
package/dist/index.d.cts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { a as AuthContext, d as RefreshConfig, f as RefreshResult, i as DenylistStore, l as EnrichedSession, m as SessionInfo, n as defaultClock, o as CredentialMetadata, p as SessionEnricher, r as CredentialStore, s as CredentialState, t as Clock, u as IssueResult } from "./clock-C0O0FCCN.cjs";
2
- import { i as RefreshCallOptions, n as AuthCredentialOptions, r as IssueOptions, t as AuthCredential } from "./auth-credential-C5zD8b0J.cjs";
3
- import { n as RateLimitStoreMemory, t as RateLimitStore } from "./store-C6DU6VZk.cjs";
2
+ import { i as RefreshCallOptions, n as AuthCredentialOptions, r as IssueOptions, t as AuthCredential } from "./auth-credential-CU4vsKhu.cjs";
3
+ import { n as RateLimitStoreMemory, t as RateLimitStore } from "./store-3YN2hfss.cjs";
4
4
  import { CryptoKey } from "jose";
5
-
6
5
  //#region src/errors.d.ts
7
6
  type AuthErrorType = "INVALID_TOKEN" | "TOKEN_EXPIRED" | "TOKEN_REVOKED" | "REFRESH_REUSE_DETECTED" | "STATELESS_OPERATION_UNSUPPORTED" | "MAX_CONCURRENT_REACHED" | "INVALID_CONFIG";
8
7
  declare class AuthError extends Error {
package/dist/index.d.mts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { a as AuthContext, d as RefreshConfig, f as RefreshResult, i as DenylistStore, l as EnrichedSession, m as SessionInfo, n as defaultClock, o as CredentialMetadata, p as SessionEnricher, r as CredentialStore, s as CredentialState, t as Clock, u as IssueResult } from "./clock-C0O0FCCN.mjs";
2
- import { i as RefreshCallOptions, n as AuthCredentialOptions, r as IssueOptions, t as AuthCredential } from "./auth-credential-C9xy4X_k.mjs";
3
- import { n as RateLimitStoreMemory, t as RateLimitStore } from "./store-y7K7z1EF.mjs";
2
+ import { i as RefreshCallOptions, n as AuthCredentialOptions, r as IssueOptions, t as AuthCredential } from "./auth-credential-C5DiSbb2.mjs";
3
+ import { n as RateLimitStoreMemory, t as RateLimitStore } from "./store-BUIC0iCK.mjs";
4
4
  import { CryptoKey } from "jose";
5
-
6
5
  //#region src/errors.d.ts
7
6
  type AuthErrorType = "INVALID_TOKEN" | "TOKEN_EXPIRED" | "TOKEN_REVOKED" | "REFRESH_REUSE_DETECTED" | "STATELESS_OPERATION_UNSUPPORTED" | "MAX_CONCURRENT_REACHED" | "INVALID_CONFIG";
8
7
  declare class AuthError extends Error {
package/dist/index.mjs CHANGED
@@ -183,7 +183,7 @@ function hkdfSubkey(ikm, label) {
183
183
  }
184
184
  //#endregion
185
185
  //#region src/stores/jwt.ts
186
- const HS_ALGS = new Set([
186
+ const HS_ALGS = /* @__PURE__ */ new Set([
187
187
  "HS256",
188
188
  "HS384",
189
189
  "HS512"
package/dist/redis.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { i as DenylistStore, r as CredentialStore, s as CredentialState } from "./clock-C0O0FCCN.cjs";
2
- import { t as RateLimitStore } from "./store-C6DU6VZk.cjs";
3
-
2
+ import { t as RateLimitStore } from "./store-3YN2hfss.cjs";
4
3
  //#region src/redis/index.d.ts
5
4
  /**
6
5
  * Structural Redis client. Covers the exact set of commands used by
package/dist/redis.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { i as DenylistStore, r as CredentialStore, s as CredentialState } from "./clock-C0O0FCCN.mjs";
2
- import { t as RateLimitStore } from "./store-y7K7z1EF.mjs";
3
-
2
+ import { t as RateLimitStore } from "./store-BUIC0iCK.mjs";
4
3
  //#region src/redis/index.d.ts
5
4
  /**
6
5
  * Structural Redis client. Covers the exact set of commands used by
@@ -1,5 +1,4 @@
1
1
  import { t as Clock } from "./clock-C0O0FCCN.cjs";
2
-
3
2
  //#region src/rate-limit/store.d.ts
4
3
  /**
5
4
  * Storage contract for the fixed-window limiter (RL.spec.md §4.3).
@@ -1,5 +1,4 @@
1
1
  import { t as Clock } from "./clock-C0O0FCCN.mjs";
2
-
3
2
  //#region src/rate-limit/store.d.ts
4
3
  /**
5
4
  * Storage contract for the fixed-window limiter (RL.spec.md §4.3).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/auth",
3
- "version": "0.1.58",
3
+ "version": "0.1.60",
4
4
  "description": "Auth method layer for aoothjs (sessions, tokens, password reset, MFA primitives)",
5
5
  "keywords": [
6
6
  "aoothjs",
@@ -104,18 +104,18 @@
104
104
  },
105
105
  "dependencies": {
106
106
  "jose": "^6.2.3",
107
- "@aooth/user": "0.1.58"
107
+ "@aooth/user": "0.1.60"
108
108
  },
109
109
  "devDependencies": {
110
- "@atscript/core": "^0.1.85",
111
- "@atscript/db": "^0.1.124",
112
- "@atscript/db-sql-tools": "^0.1.124",
113
- "@atscript/db-sqlite": "^0.1.124",
114
- "@atscript/typescript": "^0.1.85",
110
+ "@atscript/core": "^0.1.88",
111
+ "@atscript/db": "^0.1.126",
112
+ "@atscript/db-sql-tools": "^0.1.126",
113
+ "@atscript/db-sqlite": "^0.1.126",
114
+ "@atscript/typescript": "^0.1.88",
115
115
  "@types/better-sqlite3": "^7.6.13",
116
116
  "better-sqlite3": "^12.6.2",
117
117
  "ioredis": "^5.11.1",
118
- "unplugin-atscript": "^0.1.85"
118
+ "unplugin-atscript": "^0.1.88"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@atscript/db": ">=0.1.79"