@aooth/auth 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atscript-db.cjs +5 -7
- package/dist/atscript-db.d.cts +21 -25
- package/dist/atscript-db.d.mts +21 -25
- package/dist/atscript-db.mjs +5 -7
- package/dist/{auth-credential-CjCgZv7n.d.mts → auth-credential-46_eOF3c.d.cts} +1 -3
- package/dist/{auth-credential-UV3sJ-lt.d.cts → auth-credential-Co-0pqcD.d.mts} +1 -3
- package/dist/authz.cjs +21 -33
- package/dist/authz.d.cts +23 -45
- package/dist/authz.d.mts +23 -45
- package/dist/authz.mjs +21 -33
- package/dist/client.cjs +1 -2
- package/dist/client.d.cts +7 -10
- package/dist/client.d.mts +7 -10
- package/dist/client.mjs +1 -2
- package/dist/{clock-Bl-H3eqE.cjs → clock-BcBMqB9g.cjs} +1 -2
- package/dist/{clock-Bdsep_1j.mjs → clock-DzAK2bWR.mjs} +1 -2
- package/dist/{clock-CzAaCoZ5.d.cts → clock-hTHoZ2vA.d.cts} +0 -6
- package/dist/{clock-CzAaCoZ5.d.mts → clock-hTHoZ2vA.d.mts} +0 -6
- package/dist/{dynamic-client-store-DykM9QOT.cjs → dynamic-client-store-CC4qr_kz.cjs} +5 -8
- package/dist/{dynamic-client-store-B7EnHuRp.d.cts → dynamic-client-store-CTt1B6Gj.d.cts} +2 -10
- package/dist/{dynamic-client-store-B1JwFHdP.mjs → dynamic-client-store-DrMBcFtG.mjs} +5 -8
- package/dist/{dynamic-client-store-BifZLGkT.d.mts → dynamic-client-store-mYg0nRJU.d.mts} +2 -10
- package/dist/index.cjs +31 -26
- package/dist/index.d.cts +49 -40
- package/dist/index.d.mts +49 -40
- package/dist/index.mjs +31 -27
- package/dist/{opaque-token-BaMOrC1A.mjs → opaque-token-BLoQKkZ3.mjs} +1 -2
- package/dist/{opaque-token-CaZgD2i6.cjs → opaque-token-BLuVHSVJ.cjs} +1 -2
- package/dist/{payload-C1cQW7p_.cjs → payload-CqQH88C6.cjs} +2 -4
- package/dist/{payload-DDlf38B-.mjs → payload-DizkKbzh.mjs} +2 -4
- package/dist/redis.cjs +1 -2
- package/dist/redis.d.cts +7 -9
- package/dist/redis.d.mts +7 -9
- package/dist/redis.mjs +1 -2
- package/dist/{store-BaFYDHxn.d.cts → store-BXxX8sUP.d.mts} +1 -3
- package/dist/{store-h-bLOAaS.d.mts → store-D9CcbcBp.d.cts} +1 -3
- package/package.json +10 -10
package/dist/redis.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as DenylistStore, r as CredentialStore, s as CredentialState } from "./clock-
|
|
2
|
-
import { t as RateLimitStore } from "./store-
|
|
3
|
-
//#region src/redis/index.d.ts
|
|
1
|
+
import { i as DenylistStore, r as CredentialStore, s as CredentialState } from "./clock-hTHoZ2vA.cjs";
|
|
2
|
+
import { t as RateLimitStore } from "./store-D9CcbcBp.cjs";
|
|
4
3
|
/**
|
|
5
4
|
* Structural Redis client. Covers the exact set of commands used by
|
|
6
5
|
* `CredentialStoreRedis`, `DenylistStoreRedis`, and `RateLimitStoreRedis` —
|
|
@@ -61,7 +60,7 @@ import { t as RateLimitStore } from "./store-BaFYDHxn.cjs";
|
|
|
61
60
|
* - `get` returns `string | null`
|
|
62
61
|
* - `smembers` returns `string[]`
|
|
63
62
|
*/
|
|
64
|
-
interface RedisLike {
|
|
63
|
+
export interface RedisLike {
|
|
65
64
|
/** `SET key value PX ms` — `mode`/`ttlMs` are a required pair (see above). */
|
|
66
65
|
set(key: string, value: string, mode: "PX", ttlMs: number): Promise<string | null>;
|
|
67
66
|
/**
|
|
@@ -102,7 +101,7 @@ interface RedisCredentialStoreOptions {
|
|
|
102
101
|
* so Redis evicts it on expiry. The user-index set is NOT TTL-bounded — we
|
|
103
102
|
* lazily prune dead members on `listForUser` and `revokeAllForUser`.
|
|
104
103
|
*/
|
|
105
|
-
declare class CredentialStoreRedis<TPayload extends object = object> implements CredentialStore<TPayload> {
|
|
104
|
+
export declare class CredentialStoreRedis<TPayload extends object = object> implements CredentialStore<TPayload> {
|
|
106
105
|
private readonly redis;
|
|
107
106
|
private readonly prefix;
|
|
108
107
|
constructor(opts: RedisCredentialStoreOptions);
|
|
@@ -130,7 +129,7 @@ interface RedisDenylistStoreOptions {
|
|
|
130
129
|
* to `expiresAt - now`, so Redis self-evicts the entry once the underlying
|
|
131
130
|
* token would have expired anyway. `cleanup` is a no-op for that reason.
|
|
132
131
|
*/
|
|
133
|
-
declare class DenylistStoreRedis implements DenylistStore {
|
|
132
|
+
export declare class DenylistStoreRedis implements DenylistStore {
|
|
134
133
|
private readonly redis;
|
|
135
134
|
private readonly prefix;
|
|
136
135
|
constructor(opts: RedisDenylistStoreOptions);
|
|
@@ -153,7 +152,7 @@ interface RedisRateLimitStoreOptions {
|
|
|
153
152
|
* `incr` and `pexpire`, the TTL-less key leaks a few bytes but is never
|
|
154
153
|
* counted again.
|
|
155
154
|
*/
|
|
156
|
-
declare class RateLimitStoreRedis implements RateLimitStore {
|
|
155
|
+
export declare class RateLimitStoreRedis implements RateLimitStore {
|
|
157
156
|
private readonly redis;
|
|
158
157
|
private readonly prefix;
|
|
159
158
|
constructor(opts: RedisRateLimitStoreOptions);
|
|
@@ -163,5 +162,4 @@ declare class RateLimitStoreRedis implements RateLimitStore {
|
|
|
163
162
|
expire(key: string, ttlMs: number): Promise<void>;
|
|
164
163
|
reset(key: string): Promise<void>;
|
|
165
164
|
}
|
|
166
|
-
|
|
167
|
-
export { CredentialStoreRedis, DenylistStoreRedis, RateLimitStoreRedis, RedisLike };
|
|
165
|
+
export {};
|
package/dist/redis.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as DenylistStore, r as CredentialStore, s as CredentialState } from "./clock-
|
|
2
|
-
import { t as RateLimitStore } from "./store-
|
|
3
|
-
//#region src/redis/index.d.ts
|
|
1
|
+
import { i as DenylistStore, r as CredentialStore, s as CredentialState } from "./clock-hTHoZ2vA.mjs";
|
|
2
|
+
import { t as RateLimitStore } from "./store-BXxX8sUP.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* Structural Redis client. Covers the exact set of commands used by
|
|
6
5
|
* `CredentialStoreRedis`, `DenylistStoreRedis`, and `RateLimitStoreRedis` —
|
|
@@ -61,7 +60,7 @@ import { t as RateLimitStore } from "./store-h-bLOAaS.mjs";
|
|
|
61
60
|
* - `get` returns `string | null`
|
|
62
61
|
* - `smembers` returns `string[]`
|
|
63
62
|
*/
|
|
64
|
-
interface RedisLike {
|
|
63
|
+
export interface RedisLike {
|
|
65
64
|
/** `SET key value PX ms` — `mode`/`ttlMs` are a required pair (see above). */
|
|
66
65
|
set(key: string, value: string, mode: "PX", ttlMs: number): Promise<string | null>;
|
|
67
66
|
/**
|
|
@@ -102,7 +101,7 @@ interface RedisCredentialStoreOptions {
|
|
|
102
101
|
* so Redis evicts it on expiry. The user-index set is NOT TTL-bounded — we
|
|
103
102
|
* lazily prune dead members on `listForUser` and `revokeAllForUser`.
|
|
104
103
|
*/
|
|
105
|
-
declare class CredentialStoreRedis<TPayload extends object = object> implements CredentialStore<TPayload> {
|
|
104
|
+
export declare class CredentialStoreRedis<TPayload extends object = object> implements CredentialStore<TPayload> {
|
|
106
105
|
private readonly redis;
|
|
107
106
|
private readonly prefix;
|
|
108
107
|
constructor(opts: RedisCredentialStoreOptions);
|
|
@@ -130,7 +129,7 @@ interface RedisDenylistStoreOptions {
|
|
|
130
129
|
* to `expiresAt - now`, so Redis self-evicts the entry once the underlying
|
|
131
130
|
* token would have expired anyway. `cleanup` is a no-op for that reason.
|
|
132
131
|
*/
|
|
133
|
-
declare class DenylistStoreRedis implements DenylistStore {
|
|
132
|
+
export declare class DenylistStoreRedis implements DenylistStore {
|
|
134
133
|
private readonly redis;
|
|
135
134
|
private readonly prefix;
|
|
136
135
|
constructor(opts: RedisDenylistStoreOptions);
|
|
@@ -153,7 +152,7 @@ interface RedisRateLimitStoreOptions {
|
|
|
153
152
|
* `incr` and `pexpire`, the TTL-less key leaks a few bytes but is never
|
|
154
153
|
* counted again.
|
|
155
154
|
*/
|
|
156
|
-
declare class RateLimitStoreRedis implements RateLimitStore {
|
|
155
|
+
export declare class RateLimitStoreRedis implements RateLimitStore {
|
|
157
156
|
private readonly redis;
|
|
158
157
|
private readonly prefix;
|
|
159
158
|
constructor(opts: RedisRateLimitStoreOptions);
|
|
@@ -163,5 +162,4 @@ declare class RateLimitStoreRedis implements RateLimitStore {
|
|
|
163
162
|
expire(key: string, ttlMs: number): Promise<void>;
|
|
164
163
|
reset(key: string): Promise<void>;
|
|
165
164
|
}
|
|
166
|
-
|
|
167
|
-
export { CredentialStoreRedis, DenylistStoreRedis, RateLimitStoreRedis, RedisLike };
|
|
165
|
+
export {};
|
package/dist/redis.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// src/redis/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* Redis-backed `CredentialStore`. Token id is a random UUID (the same
|
|
5
5
|
* scheme as `CredentialStoreMemory`) — the token is opaque to the client.
|
|
@@ -190,5 +190,4 @@ var RateLimitStoreRedis = class {
|
|
|
190
190
|
await this.redis.del(this.key(key));
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
|
-
//#endregion
|
|
194
193
|
export { CredentialStoreRedis, DenylistStoreRedis, RateLimitStoreRedis };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as Clock } from "./clock-
|
|
2
|
-
//#region src/rate-limit/store.d.ts
|
|
1
|
+
import { t as Clock } from "./clock-hTHoZ2vA.mjs";
|
|
3
2
|
/**
|
|
4
3
|
* Storage contract for the fixed-window limiter (RL.spec.md §4.3).
|
|
5
4
|
*
|
|
@@ -65,5 +64,4 @@ declare class RateLimitStoreMemory implements RateLimitStore {
|
|
|
65
64
|
cleanup(): Promise<number>;
|
|
66
65
|
private sweep;
|
|
67
66
|
}
|
|
68
|
-
//#endregion
|
|
69
67
|
export { RateLimitStoreMemory as n, RateLimitStore as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as Clock } from "./clock-
|
|
2
|
-
//#region src/rate-limit/store.d.ts
|
|
1
|
+
import { t as Clock } from "./clock-hTHoZ2vA.cjs";
|
|
3
2
|
/**
|
|
4
3
|
* Storage contract for the fixed-window limiter (RL.spec.md §4.3).
|
|
5
4
|
*
|
|
@@ -65,5 +64,4 @@ declare class RateLimitStoreMemory implements RateLimitStore {
|
|
|
65
64
|
cleanup(): Promise<number>;
|
|
66
65
|
private sweep;
|
|
67
66
|
}
|
|
68
|
-
//#endregion
|
|
69
67
|
export { RateLimitStoreMemory as n, RateLimitStore as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aooth/auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Auth method layer for aoothjs (sessions, tokens, password reset, MFA primitives)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aoothjs",
|
|
@@ -104,22 +104,22 @@
|
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"jose": "^6.2.3",
|
|
107
|
-
"@aooth/user": "0.2.
|
|
107
|
+
"@aooth/user": "0.2.3"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@atscript/core": "^0.2.
|
|
111
|
-
"@atscript/db": "^0.1.
|
|
112
|
-
"@atscript/db-sql-tools": "^0.1.
|
|
113
|
-
"@atscript/db-sqlite": "^0.1.
|
|
114
|
-
"@atscript/typescript": "^0.2.
|
|
110
|
+
"@atscript/core": "^0.2.4",
|
|
111
|
+
"@atscript/db": "^0.1.168",
|
|
112
|
+
"@atscript/db-sql-tools": "^0.1.168",
|
|
113
|
+
"@atscript/db-sqlite": "^0.1.168",
|
|
114
|
+
"@atscript/typescript": "^0.2.4",
|
|
115
115
|
"@types/better-sqlite3": "^7.6.13",
|
|
116
|
-
"@uniqu/core": "^0.
|
|
116
|
+
"@uniqu/core": "^0.2.0",
|
|
117
117
|
"better-sqlite3": "^12.6.2",
|
|
118
118
|
"ioredis": "^5.11.1",
|
|
119
|
-
"unplugin-atscript": "^0.2.
|
|
119
|
+
"unplugin-atscript": "^0.2.4"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
|
-
"@atscript/db": "^0.1.
|
|
122
|
+
"@atscript/db": "^0.1.168"
|
|
123
123
|
},
|
|
124
124
|
"peerDependenciesMeta": {
|
|
125
125
|
"@atscript/db": {
|