@shware/security 7.1.0 → 7.1.1
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/auth/attributes.cjs +1 -2
- package/dist/auth/attributes.d.cts +0 -2
- package/dist/auth/attributes.d.cts.map +1 -1
- package/dist/auth/attributes.d.mts +0 -2
- package/dist/auth/attributes.d.mts.map +1 -1
- package/dist/auth/attributes.mjs +1 -2
- package/dist/auth/index.cjs +1 -2
- package/dist/auth/index.d.cts +0 -2
- package/dist/auth/index.d.cts.map +1 -1
- package/dist/auth/index.d.mts +0 -2
- package/dist/auth/index.d.mts.map +1 -1
- package/dist/auth/index.mjs +1 -2
- package/dist/auth/types.d.cts +0 -2
- package/dist/auth/types.d.cts.map +1 -1
- package/dist/auth/types.d.mts +0 -2
- package/dist/auth/types.d.mts.map +1 -1
- package/dist/core/index.cjs +1 -2
- package/dist/core/index.d.cts +0 -2
- package/dist/core/index.d.cts.map +1 -1
- package/dist/core/index.d.mts +0 -2
- package/dist/core/index.d.mts.map +1 -1
- package/dist/core/index.mjs +1 -2
- package/dist/email/schema.cjs +1 -2
- package/dist/email/schema.d.cts +0 -2
- package/dist/email/schema.d.cts.map +1 -1
- package/dist/email/schema.d.mts +0 -2
- package/dist/email/schema.d.mts.map +1 -1
- package/dist/email/schema.mjs +1 -2
- package/dist/oauth2/client.cjs +1 -2
- package/dist/oauth2/client.d.cts +0 -2
- package/dist/oauth2/client.d.cts.map +1 -1
- package/dist/oauth2/client.d.mts +0 -2
- package/dist/oauth2/client.d.mts.map +1 -1
- package/dist/oauth2/client.mjs +1 -2
- package/dist/oauth2/error.cjs +1 -2
- package/dist/oauth2/error.d.cts +0 -2
- package/dist/oauth2/error.d.cts.map +1 -1
- package/dist/oauth2/error.d.mts +0 -2
- package/dist/oauth2/error.d.mts.map +1 -1
- package/dist/oauth2/error.mjs +1 -2
- package/dist/oauth2/name.cjs +1 -2
- package/dist/oauth2/name.d.cts +0 -2
- package/dist/oauth2/name.d.cts.map +1 -1
- package/dist/oauth2/name.d.mts +0 -2
- package/dist/oauth2/name.d.mts.map +1 -1
- package/dist/oauth2/name.mjs +1 -2
- package/dist/oauth2/provider/apple-client-secret.cjs +1 -2
- package/dist/oauth2/provider/apple-client-secret.d.cts +0 -2
- package/dist/oauth2/provider/apple-client-secret.d.cts.map +1 -1
- package/dist/oauth2/provider/apple-client-secret.d.mts +0 -2
- package/dist/oauth2/provider/apple-client-secret.d.mts.map +1 -1
- package/dist/oauth2/provider/apple-client-secret.mjs +1 -2
- package/dist/oauth2/provider/apple.cjs +1 -2
- package/dist/oauth2/provider/apple.d.cts +0 -2
- package/dist/oauth2/provider/apple.d.cts.map +1 -1
- package/dist/oauth2/provider/apple.d.mts +0 -2
- package/dist/oauth2/provider/apple.d.mts.map +1 -1
- package/dist/oauth2/provider/apple.mjs +1 -2
- package/dist/oauth2/provider/common.cjs +1 -2
- package/dist/oauth2/provider/common.d.cts +0 -2
- package/dist/oauth2/provider/common.d.cts.map +1 -1
- package/dist/oauth2/provider/common.d.mts +0 -2
- package/dist/oauth2/provider/common.d.mts.map +1 -1
- package/dist/oauth2/provider/common.mjs +1 -2
- package/dist/oauth2/provider/facebook.cjs +1 -2
- package/dist/oauth2/provider/facebook.d.cts +0 -2
- package/dist/oauth2/provider/facebook.d.cts.map +1 -1
- package/dist/oauth2/provider/facebook.d.mts +0 -2
- package/dist/oauth2/provider/facebook.d.mts.map +1 -1
- package/dist/oauth2/provider/facebook.mjs +1 -2
- package/dist/oauth2/provider/github.cjs +1 -2
- package/dist/oauth2/provider/github.d.cts +0 -2
- package/dist/oauth2/provider/github.d.cts.map +1 -1
- package/dist/oauth2/provider/github.d.mts +0 -2
- package/dist/oauth2/provider/github.d.mts.map +1 -1
- package/dist/oauth2/provider/github.mjs +1 -2
- package/dist/oauth2/provider/google.cjs +1 -2
- package/dist/oauth2/provider/google.d.cts +0 -2
- package/dist/oauth2/provider/google.d.cts.map +1 -1
- package/dist/oauth2/provider/google.d.mts +0 -2
- package/dist/oauth2/provider/google.d.mts.map +1 -1
- package/dist/oauth2/provider/google.mjs +1 -2
- package/dist/oauth2/provider/wechat.cjs +1 -2
- package/dist/oauth2/provider/wechat.d.cts +0 -2
- package/dist/oauth2/provider/wechat.d.cts.map +1 -1
- package/dist/oauth2/provider/wechat.d.mts +0 -2
- package/dist/oauth2/provider/wechat.d.mts.map +1 -1
- package/dist/oauth2/provider/wechat.mjs +1 -2
- package/dist/oauth2/provider/x.cjs +1 -2
- package/dist/oauth2/provider/x.d.cts +0 -2
- package/dist/oauth2/provider/x.d.cts.map +1 -1
- package/dist/oauth2/provider/x.d.mts +0 -2
- package/dist/oauth2/provider/x.d.mts.map +1 -1
- package/dist/oauth2/provider/x.mjs +1 -2
- package/dist/oauth2/types.cjs +1 -2
- package/dist/oauth2/types.d.cts +0 -2
- package/dist/oauth2/types.d.cts.map +1 -1
- package/dist/oauth2/types.d.mts +0 -2
- package/dist/oauth2/types.d.mts.map +1 -1
- package/dist/oauth2/types.mjs +1 -2
- package/dist/session/common.cjs +1 -2
- package/dist/session/common.d.cts +0 -2
- package/dist/session/common.d.cts.map +1 -1
- package/dist/session/common.d.mts +0 -2
- package/dist/session/common.d.mts.map +1 -1
- package/dist/session/common.mjs +1 -2
- package/dist/session/db.cjs +1 -2
- package/dist/session/db.d.cts +0 -2
- package/dist/session/db.d.cts.map +1 -1
- package/dist/session/db.d.mts +0 -2
- package/dist/session/db.d.mts.map +1 -1
- package/dist/session/db.mjs +1 -2
- package/dist/session/map-session.cjs +1 -2
- package/dist/session/map-session.d.cts +0 -2
- package/dist/session/map-session.d.cts.map +1 -1
- package/dist/session/map-session.d.mts +0 -2
- package/dist/session/map-session.d.mts.map +1 -1
- package/dist/session/map-session.mjs +1 -2
- package/dist/session/redis.cjs +1 -2
- package/dist/session/redis.d.cts +0 -2
- package/dist/session/redis.d.cts.map +1 -1
- package/dist/session/redis.d.mts +0 -2
- package/dist/session/redis.d.mts.map +1 -1
- package/dist/session/redis.mjs +1 -2
- package/dist/session/types.d.cts +0 -2
- package/dist/session/types.d.cts.map +1 -1
- package/dist/session/types.d.mts +0 -2
- package/dist/session/types.d.mts.map +1 -1
- package/dist/utils/http.cjs +1 -2
- package/dist/utils/http.d.cts +0 -2
- package/dist/utils/http.d.cts.map +1 -1
- package/dist/utils/http.d.mts +0 -2
- package/dist/utils/http.d.mts.map +1 -1
- package/dist/utils/http.mjs +1 -2
- package/dist/utils/oauth2.cjs +1 -2
- package/dist/utils/oauth2.d.cts +0 -2
- package/dist/utils/oauth2.d.cts.map +1 -1
- package/dist/utils/oauth2.d.mts +0 -2
- package/dist/utils/oauth2.d.mts.map +1 -1
- package/dist/utils/oauth2.mjs +1 -2
- package/dist/utils/timing.cjs +1 -2
- package/dist/utils/timing.d.cts +0 -2
- package/dist/utils/timing.d.cts.map +1 -1
- package/dist/utils/timing.d.mts +0 -2
- package/dist/utils/timing.d.mts.map +1 -1
- package/dist/utils/timing.mjs +1 -2
- package/dist/utils/valid.cjs +1 -2
- package/dist/utils/valid.d.cts +0 -2
- package/dist/utils/valid.d.cts.map +1 -1
- package/dist/utils/valid.d.mts +0 -2
- package/dist/utils/valid.d.mts.map +1 -1
- package/dist/utils/valid.mjs +1 -2
- package/package.json +3 -3
package/dist/auth/attributes.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let zod_mini = require("zod/mini");
|
|
3
|
-
|
|
3
|
+
// src/auth/attributes.ts
|
|
4
4
|
/** Upper bound on serialized attributes: they ride in a session or a request body. */
|
|
5
5
|
const MAX_ATTRIBUTES_BYTES = 2048;
|
|
6
6
|
function attributesSize(attributes) {
|
|
@@ -22,7 +22,6 @@ function bodyAttributes(body) {
|
|
|
22
22
|
if (!parsed.success) return null;
|
|
23
23
|
return parsed.data ?? {};
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
exports.MAX_ATTRIBUTES_BYTES = MAX_ATTRIBUTES_BYTES;
|
|
27
26
|
exports.attributesSchema = attributesSchema;
|
|
28
27
|
exports.attributesSize = attributesSize;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/auth/attributes.d.ts
|
|
2
1
|
/** Upper bound on serialized attributes: they ride in a session or a request body. */
|
|
3
2
|
export declare const MAX_ATTRIBUTES_BYTES = 2048;
|
|
4
3
|
export declare function attributesSize(attributes: Record<string, string>): number;
|
|
@@ -13,5 +12,4 @@ export declare const attributesSchema: import("zod/mini").ZodMiniOptional<import
|
|
|
13
12
|
* present but invalid.
|
|
14
13
|
*/
|
|
15
14
|
export declare function bodyAttributes(body: unknown): Record<string, string> | null;
|
|
16
|
-
//#endregion
|
|
17
15
|
//# sourceMappingURL=attributes.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.cts","names":[],"sources":["../../src/auth/attributes.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"attributes.d.cts","names":[],"sources":["../../src/auth/attributes.ts"],"mappings":";qBAGa;wBAEG,eAAe,YAAY;;;;;;qBAS9B,qCAAgB,mCAAA,iCAAA,0CAAA;;;;;wBAYb,eAAe,gBAAgB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/auth/attributes.d.ts
|
|
2
1
|
/** Upper bound on serialized attributes: they ride in a session or a request body. */
|
|
3
2
|
export declare const MAX_ATTRIBUTES_BYTES = 2048;
|
|
4
3
|
export declare function attributesSize(attributes: Record<string, string>): number;
|
|
@@ -13,5 +12,4 @@ export declare const attributesSchema: import("zod/mini").ZodMiniOptional<import
|
|
|
13
12
|
* present but invalid.
|
|
14
13
|
*/
|
|
15
14
|
export declare function bodyAttributes(body: unknown): Record<string, string> | null;
|
|
16
|
-
//#endregion
|
|
17
15
|
//# sourceMappingURL=attributes.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.mts","names":[],"sources":["../../src/auth/attributes.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"attributes.d.mts","names":[],"sources":["../../src/auth/attributes.ts"],"mappings":";qBAGa;wBAEG,eAAe,YAAY;;;;;;qBAS9B,qCAAgB,mCAAA,iCAAA,0CAAA;;;;;wBAYb,eAAe,gBAAgB"}
|
package/dist/auth/attributes.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { optional, record, refine, string } from "zod/mini";
|
|
2
|
-
|
|
2
|
+
// src/auth/attributes.ts
|
|
3
3
|
/** Upper bound on serialized attributes: they ride in a session or a request body. */
|
|
4
4
|
const MAX_ATTRIBUTES_BYTES = 2048;
|
|
5
5
|
function attributesSize(attributes) {
|
|
@@ -21,7 +21,6 @@ function bodyAttributes(body) {
|
|
|
21
21
|
if (!parsed.success) return null;
|
|
22
22
|
return parsed.data ?? {};
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { MAX_ATTRIBUTES_BYTES, attributesSchema, attributesSize, bodyAttributes };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=attributes.mjs.map
|
package/dist/auth/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const require_utils_timing = require("../utils/timing.cjs");
|
|
|
9
9
|
const require_utils_valid = require("../utils/valid.cjs");
|
|
10
10
|
let node_crypto = require("node:crypto");
|
|
11
11
|
let _shware_utils = require("@shware/utils");
|
|
12
|
-
|
|
12
|
+
// src/auth/index.ts
|
|
13
13
|
const PKCE_FORMAT = /^[A-Za-z0-9_-]{43,128}$/;
|
|
14
14
|
const CODE_VERIFIER_FORMAT = /^[A-Za-z0-9._~-]{43,128}$/;
|
|
15
15
|
const INVALID_CODE_VERIFIER = {
|
|
@@ -697,7 +697,6 @@ var Auth = class {
|
|
|
697
697
|
return Response.json({});
|
|
698
698
|
};
|
|
699
699
|
};
|
|
700
|
-
//#endregion
|
|
701
700
|
exports.Auth = Auth;
|
|
702
701
|
exports.PATH = PATH;
|
|
703
702
|
|
package/dist/auth/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Principal } from "../core/index.cjs";
|
|
2
2
|
import { Session } from "../session/types.cjs";
|
|
3
3
|
import { AuthConfig, AuthService, AuthorizedHandler, LoggedHandler, OAuth2AuthorizationOptions } from "./types.cjs";
|
|
4
|
-
//#region src/auth/index.d.ts
|
|
5
4
|
export declare const PATH: {
|
|
6
5
|
readonly CSRF: '/csrf';
|
|
7
6
|
readonly LOGOUT: '/logout';
|
|
@@ -124,5 +123,4 @@ export declare class Auth implements AuthService {
|
|
|
124
123
|
listSessions: (principal: Principal) => Promise<Session[]>;
|
|
125
124
|
cleanupExpiredSessions: (cleanupCount?: number) => Promise<Response>;
|
|
126
125
|
}
|
|
127
|
-
//#endregion
|
|
128
126
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/auth/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/auth/index.ts"],"mappings":";;;qBA4Ga;WACX;WACA;WACA;WAEA;WACA;WACA;WACA;WACA;WACA;WAEA;WACA;WACA;WACA;WASA;WACA;WAEA;;qBAMW,gBAAgB;mBACV;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;EAEjB,cACE,mBACA,cACA,oBACA,kBACA,QACA,QACA,SACA,UACC;UA2BK;EAYR,OAAI,UAAoB,YAAU,QAAQ;EAmB1C,SAAM,SAAmB,YAAU,QAAQ;EAU3C,SAAM,SAAmB,SAAO,WAAa,kBAAgB,QAAQ;UAsB7D;UAUA;UAIA;UAIA;UAIA;UAIA;UAIA;UAIA;EAIR,cAAW,SAAmB,YAAU,QAAQ;EAOhD,cAAW,SAAmB,YAAU,QAAQ;EAOhD,sBAAmB,SACR,SAAO,UACN,+BACT,QAAQ;mBAmCM;EAUjB,kBAAe,SAAmB,SAAO,SAAW,sBAAoB,QAAQ;;;;;;UA+HxE;EAYR,oBAAiB,SAAmB,SAAO,SAAW,sBAAoB,QAAQ;EAmDlF,oBAAiB,SACN,SAAO,SACP,mBAAiB,sBAEzB,QAAQ;EA6EX,4BAAyB,SACd,SAAO,SACP;IAAQ;IAAe;QAA+B,kBAC9D,QAAQ;EA0CX,aAAU,SAAmB,SAAO,SAAW,sBAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;EAsE3E,mBAAgB,SAAmB,YAAU,QAAQ;;;;;;;;;;;;;;;;;;;EA0DrD,kBAAe,SAAmB,YAAU,QAAQ;EAgEpD,4BAAyB,UACb,SAAO,UACP;IAAQ;IAAe;QAA+B,kBAC/D,QAAQ;EAIX,aAAU,UAAoB,SAAO,UAAY,sBAAoB,QAAQ;EAI7E,OAAI,WAAqB,cAAY;;;;;;;;UAcvB;EAOd,kBAAe,SAAmB,YAAU;EAW5C,aAAoB,mBAAiB,SAC1B,SAAO,QACR,MACP,QAAQ,iBAAiB,UAAU;EAwBtC,gBAAa,sBAA8B;EAI3C,eAAY,SAAmB,YAAU,QAAQ;EAWjD,eAAY,WAAqB,cAAY,QAAQ;EAKrD,yBAAsB,0BAAkC,QAAQ"}
|
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Principal } from "../core/index.mjs";
|
|
2
2
|
import { Session } from "../session/types.mjs";
|
|
3
3
|
import { AuthConfig, AuthService, AuthorizedHandler, LoggedHandler, OAuth2AuthorizationOptions } from "./types.mjs";
|
|
4
|
-
//#region src/auth/index.d.ts
|
|
5
4
|
export declare const PATH: {
|
|
6
5
|
readonly CSRF: '/csrf';
|
|
7
6
|
readonly LOGOUT: '/logout';
|
|
@@ -124,5 +123,4 @@ export declare class Auth implements AuthService {
|
|
|
124
123
|
listSessions: (principal: Principal) => Promise<Session[]>;
|
|
125
124
|
cleanupExpiredSessions: (cleanupCount?: number) => Promise<Response>;
|
|
126
125
|
}
|
|
127
|
-
//#endregion
|
|
128
126
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/auth/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/auth/index.ts"],"mappings":";;;qBA4Ga;WACX;WACA;WACA;WAEA;WACA;WACA;WACA;WACA;WACA;WAEA;WACA;WACA;WACA;WASA;WACA;WAEA;;qBAMW,gBAAgB;mBACV;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;EAEjB,cACE,mBACA,cACA,oBACA,kBACA,QACA,QACA,SACA,UACC;UA2BK;EAYR,OAAI,UAAoB,YAAU,QAAQ;EAmB1C,SAAM,SAAmB,YAAU,QAAQ;EAU3C,SAAM,SAAmB,SAAO,WAAa,kBAAgB,QAAQ;UAsB7D;UAUA;UAIA;UAIA;UAIA;UAIA;UAIA;UAIA;EAIR,cAAW,SAAmB,YAAU,QAAQ;EAOhD,cAAW,SAAmB,YAAU,QAAQ;EAOhD,sBAAmB,SACR,SAAO,UACN,+BACT,QAAQ;mBAmCM;EAUjB,kBAAe,SAAmB,SAAO,SAAW,sBAAoB,QAAQ;;;;;;UA+HxE;EAYR,oBAAiB,SAAmB,SAAO,SAAW,sBAAoB,QAAQ;EAmDlF,oBAAiB,SACN,SAAO,SACP,mBAAiB,sBAEzB,QAAQ;EA6EX,4BAAyB,SACd,SAAO,SACP;IAAQ;IAAe;QAA+B,kBAC9D,QAAQ;EA0CX,aAAU,SAAmB,SAAO,SAAW,sBAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;EAsE3E,mBAAgB,SAAmB,YAAU,QAAQ;;;;;;;;;;;;;;;;;;;EA0DrD,kBAAe,SAAmB,YAAU,QAAQ;EAgEpD,4BAAyB,UACb,SAAO,UACP;IAAQ;IAAe;QAA+B,kBAC/D,QAAQ;EAIX,aAAU,UAAoB,SAAO,UAAY,sBAAoB,QAAQ;EAI7E,OAAI,WAAqB,cAAY;;;;;;;;UAcvB;EAOd,kBAAe,SAAmB,YAAU;EAW5C,aAAoB,mBAAiB,SAC1B,SAAO,QACR,MACP,QAAQ,iBAAiB,UAAU;EAwBtC,gBAAa,sBAA8B;EAI3C,eAAY,SAAmB,YAAU,QAAQ;EAWjD,eAAY,WAAqB,cAAY,QAAQ;EAKrD,yBAAsB,0BAAkC,QAAQ"}
|
package/dist/auth/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { timing } from "../utils/timing.mjs";
|
|
|
8
8
|
import { invalidArgument, resourceExhausted, valid, verifyTurnstileToken } from "../utils/valid.mjs";
|
|
9
9
|
import { createHash, randomInt, randomUUID, timingSafeEqual } from "node:crypto";
|
|
10
10
|
import { invariant } from "@shware/utils";
|
|
11
|
-
|
|
11
|
+
// src/auth/index.ts
|
|
12
12
|
const PKCE_FORMAT = /^[A-Za-z0-9_-]{43,128}$/;
|
|
13
13
|
const CODE_VERIFIER_FORMAT = /^[A-Za-z0-9._~-]{43,128}$/;
|
|
14
14
|
const INVALID_CODE_VERIFIER = {
|
|
@@ -696,7 +696,6 @@ var Auth = class {
|
|
|
696
696
|
return Response.json({});
|
|
697
697
|
};
|
|
698
698
|
};
|
|
699
|
-
//#endregion
|
|
700
699
|
export { Auth, PATH };
|
|
701
700
|
|
|
702
701
|
//# sourceMappingURL=index.mjs.map
|
package/dist/auth/types.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import { Principal } from "../core/index.cjs";
|
|
|
2
2
|
import { KVRepository, Session, SessionRepository } from "../session/types.cjs";
|
|
3
3
|
import { OAuth2ClientConfig, OAuth2Token, UserInfo } from "../oauth2/types.cjs";
|
|
4
4
|
import { CookieOptions } from "../utils/http.cjs";
|
|
5
|
-
//#region src/auth/types.d.ts
|
|
6
5
|
export type LoggedHandler = (principal: Principal) => Promise<void>;
|
|
7
6
|
/**
|
|
8
7
|
* Who signed in, and how: what every login method hands to `onAuthorized`.
|
|
@@ -115,5 +114,4 @@ export interface AuthService {
|
|
|
115
114
|
listSessions: (principal: Principal) => Promise<Session[]>;
|
|
116
115
|
cleanupExpiredSessions: (cleanupCount?: number) => Promise<Response>;
|
|
117
116
|
}
|
|
118
|
-
//#endregion
|
|
119
117
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/auth/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/auth/types.ts"],"mappings":";;;;YAKY,iBAAiB,WAAW,cAAc;;;;;;;;;;;;;;;iBAerC;EACf;EACA;EACA,UAAU;EACV,QAAQ;EACR,YAAY;;;YAIF,qBACV,SAAS,SACT,eAAe,kBACZ,QAAQ;iBAEI;;;;;;;;;;;EAWf,aAAa;;iBAGE;EACf;EACA,cAAc;EACd,mBAAmB;EACnB,SAAS;IAAkB;;EAC3B;;;;;;;;;IASE;;EAEF;;EAEA;;;;;IAKE;;;;;IAKA;;EAEF;IACE,SAAS;;IAET;;;;;;;;MAQE;;;;iBAKW;EAEf,OAAO,SAAS,YAAY,QAAQ;EACpC,SAAS,SAAS,YAAY,QAAQ;EACtC,SAAS,SAAS,SAAS,WAAW,kBAAkB,QAAQ;EAGhE,cAAc,SAAS,YAAY,QAAQ;EAC3C,cAAc,SAAS,YAAY,QAAQ;EAC3C,sBACE,SAAS,SACT,UAAU,+BACP,QAAQ;EACb,kBAAkB,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAChF,oBAAoB,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAClF,oBACE,SAAS,SACT,cAAc,mBACd,sBACG,QAAQ;EAGb,4BACE,SAAS,SACT,SAAS;IAAQ;IAAe;QAA+B,kBAC5D,QAAQ;EACb,4BACE,SAAS,SACT,SAAS;IAAQ;IAAe;QAA+B,kBAC5D,QAAQ;EAEb,aAAa,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAC3E,aAAa,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAG3E,OAAO,WAAW,cAAc;EAChC,kBAAkB,SAAS,YAAY;EACvC,aAAa,mBACX,SAAS,SACT,QAAQ,MACL,QAAQ,iBAAiB,UAAU;EACxC,gBAAgB,sBAAsB;EACtC,eAAe,SAAS,YAAY,QAAQ;EAC5C,eAAe,WAAW,cAAc,QAAQ;EAChD,yBAAyB,0BAA0B,QAAQ"}
|
package/dist/auth/types.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { Principal } from "../core/index.mjs";
|
|
|
2
2
|
import { KVRepository, Session, SessionRepository } from "../session/types.mjs";
|
|
3
3
|
import { OAuth2ClientConfig, OAuth2Token, UserInfo } from "../oauth2/types.mjs";
|
|
4
4
|
import { CookieOptions } from "../utils/http.mjs";
|
|
5
|
-
//#region src/auth/types.d.ts
|
|
6
5
|
export type LoggedHandler = (principal: Principal) => Promise<void>;
|
|
7
6
|
/**
|
|
8
7
|
* Who signed in, and how: what every login method hands to `onAuthorized`.
|
|
@@ -115,5 +114,4 @@ export interface AuthService {
|
|
|
115
114
|
listSessions: (principal: Principal) => Promise<Session[]>;
|
|
116
115
|
cleanupExpiredSessions: (cleanupCount?: number) => Promise<Response>;
|
|
117
116
|
}
|
|
118
|
-
//#endregion
|
|
119
117
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/auth/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/auth/types.ts"],"mappings":";;;;YAKY,iBAAiB,WAAW,cAAc;;;;;;;;;;;;;;;iBAerC;EACf;EACA;EACA,UAAU;EACV,QAAQ;EACR,YAAY;;;YAIF,qBACV,SAAS,SACT,eAAe,kBACZ,QAAQ;iBAEI;;;;;;;;;;;EAWf,aAAa;;iBAGE;EACf;EACA,cAAc;EACd,mBAAmB;EACnB,SAAS;IAAkB;;EAC3B;;;;;;;;;IASE;;EAEF;;EAEA;;;;;IAKE;;;;;IAKA;;EAEF;IACE,SAAS;;IAET;;;;;;;;MAQE;;;;iBAKW;EAEf,OAAO,SAAS,YAAY,QAAQ;EACpC,SAAS,SAAS,YAAY,QAAQ;EACtC,SAAS,SAAS,SAAS,WAAW,kBAAkB,QAAQ;EAGhE,cAAc,SAAS,YAAY,QAAQ;EAC3C,cAAc,SAAS,YAAY,QAAQ;EAC3C,sBACE,SAAS,SACT,UAAU,+BACP,QAAQ;EACb,kBAAkB,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAChF,oBAAoB,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAClF,oBACE,SAAS,SACT,cAAc,mBACd,sBACG,QAAQ;EAGb,4BACE,SAAS,SACT,SAAS;IAAQ;IAAe;QAA+B,kBAC5D,QAAQ;EACb,4BACE,SAAS,SACT,SAAS;IAAQ;IAAe;QAA+B,kBAC5D,QAAQ;EAEb,aAAa,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAC3E,aAAa,SAAS,SAAS,cAAc,sBAAsB,QAAQ;EAG3E,OAAO,WAAW,cAAc;EAChC,kBAAkB,SAAS,YAAY;EACvC,aAAa,mBACX,SAAS,SACT,QAAQ,MACL,QAAQ,iBAAiB,UAAU;EACxC,gBAAgB,sBAAsB;EACtC,eAAe,SAAS,YAAY,QAAQ;EAC5C,eAAe,WAAW,cAAc,QAAQ;EAChD,yBAAyB,0BAA0B,QAAQ"}
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/core/index.ts
|
|
3
3
|
const PROVIDERS = [
|
|
4
4
|
"APPLE",
|
|
5
5
|
"DISCORD",
|
|
@@ -14,7 +14,6 @@ const PROVIDERS = [
|
|
|
14
14
|
"EMAIL",
|
|
15
15
|
"PHONE"
|
|
16
16
|
];
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.PROVIDERS = PROVIDERS;
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=index.cjs.map
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/core/index.d.ts
|
|
2
1
|
export type JSONValue = null | string | number | boolean | {
|
|
3
2
|
[value: string]: JSONValue;
|
|
4
3
|
} | Array<JSONValue>;
|
|
@@ -16,5 +15,4 @@ export interface CsrfToken {
|
|
|
16
15
|
}
|
|
17
16
|
export declare const PROVIDERS: readonly ['APPLE', 'DISCORD', 'FACEBOOK', 'GITHUB', 'GOOGLE', 'LINKEDIN', 'MICROSOFT', 'SLACK', 'WECHAT', 'X', 'EMAIL', 'PHONE'];
|
|
18
17
|
export type Provider = (typeof PROVIDERS)[number];
|
|
19
|
-
//#endregion
|
|
20
18
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/core/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/core/index.ts"],"mappings":"A,YAAY;GAKL,gBAAgB;IACnB,MAAM;iBAEO;EACf;;iBAGe,uBAAuB;EACtC;EACA;;iBAGe;EACf;EACA;EACA;;qBAGW;YAiBD,mBAAmB"}
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/core/index.d.ts
|
|
2
1
|
export type JSONValue = null | string | number | boolean | {
|
|
3
2
|
[value: string]: JSONValue;
|
|
4
3
|
} | Array<JSONValue>;
|
|
@@ -16,5 +15,4 @@ export interface CsrfToken {
|
|
|
16
15
|
}
|
|
17
16
|
export declare const PROVIDERS: readonly ['APPLE', 'DISCORD', 'FACEBOOK', 'GITHUB', 'GOOGLE', 'LINKEDIN', 'MICROSOFT', 'SLACK', 'WECHAT', 'X', 'EMAIL', 'PHONE'];
|
|
18
17
|
export type Provider = (typeof PROVIDERS)[number];
|
|
19
|
-
//#endregion
|
|
20
18
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/core/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/core/index.ts"],"mappings":"A,YAAY;GAKL,gBAAgB;IACnB,MAAM;iBAEO;EACf;;iBAGe,uBAAuB;EACtC;EACA;;iBAGe;EACf;EACA;EACA;;qBAGW;YAiBD,mBAAmB"}
|
package/dist/core/index.mjs
CHANGED
package/dist/email/schema.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_auth_attributes = require("../auth/attributes.cjs");
|
|
3
3
|
let zod_mini = require("zod/mini");
|
|
4
|
-
|
|
4
|
+
// src/email/schema.ts
|
|
5
5
|
/**
|
|
6
6
|
* An email address as an identity key: trimmed and lowercased before the format check, so
|
|
7
7
|
* `" A@X.com "` is accepted as `"a@x.com"`. The whole address is lowercased, local part included:
|
|
@@ -18,7 +18,6 @@ const loginEmailSchema = (0, zod_mini.object)({
|
|
|
18
18
|
verificationCode: (0, zod_mini.string)().check((0, zod_mini.regex)(/^\d{6}$/)),
|
|
19
19
|
attributes: require_auth_attributes.attributesSchema
|
|
20
20
|
});
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.loginEmailSchema = loginEmailSchema;
|
|
23
22
|
exports.sendEmailVerificationCodeSchema = sendEmailVerificationCodeSchema;
|
|
24
23
|
|
package/dist/email/schema.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/email/schema.d.ts
|
|
2
1
|
export declare const sendEmailVerificationCodeSchema: import("zod/mini").ZodMiniObject<{
|
|
3
2
|
email: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniEmail>;
|
|
4
3
|
turnstileToken: import("zod/mini").ZodMiniString<string>;
|
|
@@ -8,5 +7,4 @@ export declare const loginEmailSchema: import("zod/mini").ZodMiniObject<{
|
|
|
8
7
|
verificationCode: import("zod/mini").ZodMiniString<string>;
|
|
9
8
|
attributes: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniRecord<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniString<string>>>;
|
|
10
9
|
}, import("zod/v4/core").$strip>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=schema.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.cts","names":[],"sources":["../../src/email/schema.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.cts","names":[],"sources":["../../src/email/schema.ts"],"mappings":"A,qBAWa,oDAA+B;;;yBAG1C;qBAEW,qCAAgB;;;;yBAI3B"}
|
package/dist/email/schema.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/email/schema.d.ts
|
|
2
1
|
export declare const sendEmailVerificationCodeSchema: import("zod/mini").ZodMiniObject<{
|
|
3
2
|
email: import("zod/mini").ZodMiniPipe<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniEmail>;
|
|
4
3
|
turnstileToken: import("zod/mini").ZodMiniString<string>;
|
|
@@ -8,5 +7,4 @@ export declare const loginEmailSchema: import("zod/mini").ZodMiniObject<{
|
|
|
8
7
|
verificationCode: import("zod/mini").ZodMiniString<string>;
|
|
9
8
|
attributes: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniRecord<import("zod/mini").ZodMiniString<string>, import("zod/mini").ZodMiniString<string>>>;
|
|
10
9
|
}, import("zod/v4/core").$strip>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=schema.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.mts","names":[],"sources":["../../src/email/schema.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.mts","names":[],"sources":["../../src/email/schema.ts"],"mappings":"A,qBAWa,oDAA+B;;;yBAG1C;qBAEW,qCAAgB;;;;yBAI3B"}
|
package/dist/email/schema.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attributesSchema } from "../auth/attributes.mjs";
|
|
2
2
|
import { email, maxLength, object, pipe, regex, string, toLowerCase, trim } from "zod/mini";
|
|
3
|
-
|
|
3
|
+
// src/email/schema.ts
|
|
4
4
|
/**
|
|
5
5
|
* An email address as an identity key: trimmed and lowercased before the format check, so
|
|
6
6
|
* `" A@X.com "` is accepted as `"a@x.com"`. The whole address is lowercased, local part included:
|
|
@@ -17,7 +17,6 @@ const loginEmailSchema = object({
|
|
|
17
17
|
verificationCode: string().check(regex(/^\d{6}$/)),
|
|
18
18
|
attributes: attributesSchema
|
|
19
19
|
});
|
|
20
|
-
//#endregion
|
|
21
20
|
export { loginEmailSchema, sendEmailVerificationCodeSchema };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=schema.mjs.map
|
package/dist/oauth2/client.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_oauth2_error = require("./error.cjs");
|
|
3
3
|
let _shware_utils = require("@shware/utils");
|
|
4
4
|
let zod_v4_mini = require("zod/v4-mini");
|
|
5
|
-
|
|
5
|
+
// src/oauth2/client.ts
|
|
6
6
|
const oauth2RedirectQuerySchema = (0, zod_v4_mini.object)({
|
|
7
7
|
code: (0, zod_v4_mini.optional)((0, zod_v4_mini.string)()),
|
|
8
8
|
state: (0, zod_v4_mini.optional)((0, zod_v4_mini.string)()),
|
|
@@ -174,7 +174,6 @@ var OAuth2Client = class {
|
|
|
174
174
|
function isOneTapProvider(provider) {
|
|
175
175
|
return typeof provider.getTokenInfo === "function";
|
|
176
176
|
}
|
|
177
|
-
//#endregion
|
|
178
177
|
exports.OAuth2Client = OAuth2Client;
|
|
179
178
|
exports.googleOneTapSchema = googleOneTapSchema;
|
|
180
179
|
exports.oauth2RedirectQuerySchema = oauth2RedirectQuerySchema;
|
package/dist/oauth2/client.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AuthorizationResponse, NativeCredential, OAuth2ClientConfig, OAuth2Token, OidcToken, PkceParameters, UserInfo } from "./types.cjs";
|
|
2
|
-
//#region src/oauth2/client.d.ts
|
|
3
2
|
export declare const oauth2RedirectQuerySchema: import("zod/mini").ZodMiniObject<{
|
|
4
3
|
code: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
|
|
5
4
|
state: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
|
|
@@ -97,5 +96,4 @@ export declare class OAuth2Client {
|
|
|
97
96
|
clientId: string;
|
|
98
97
|
}>;
|
|
99
98
|
}
|
|
100
|
-
//#endregion
|
|
101
99
|
//# sourceMappingURL=client.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.cts","names":["_$__types0.UserInfo"],"sources":["../../src/oauth2/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":["_$__types0.UserInfo"],"sources":["../../src/oauth2/client.ts"],"mappings":";qBAkBa,8CAAyB;;;;;;;yBAQpC;qBAEW,uCAAkB;;;;;;;;;;yBAY7B;qBAEW;mBACM;EACjB,YAAY,QAAQ;MAIhB;MAIA;MAIA;;UAKU;UAUN;;UAKM;;;;;;UAaA;;;;;;UAcA;UAYA;EAIR,yBACJ,UACA,OACA;IAEA;IACA;IACA,OAAO;MACL,QAAQ;;EAYN,4BACJ,UACA,MACA;IAEA;IACA;IACA,OAAO;MACL;IAAU;IAAkB,OAAO;;;EAcjC,cACJ,UACA,UACA,OACA;IAEA;IACA;IACA,OAAO,cAAc;IACrB,WAAW;MACZ,QADYA;;EAOP,eAAe,UAAU;IAAgB;IAAkB;MAAoB;;;;;EAS/E,qBACJ,UACA,UACA;IAEA;IACA;IACA;MACE,QAAQ;EAON,cACJ,UACA,UACA;IAEA;IACA;IACA;MACD;;;;;EAWK,oBACJ,UACA,eAAe,kBAAkB,eACjC;IAEA;IACA,aAAa;IACb,OAAO,KAAK;MACb"}
|
package/dist/oauth2/client.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AuthorizationResponse, NativeCredential, OAuth2ClientConfig, OAuth2Token, OidcToken, PkceParameters, UserInfo } from "./types.mjs";
|
|
2
|
-
//#region src/oauth2/client.d.ts
|
|
3
2
|
export declare const oauth2RedirectQuerySchema: import("zod/mini").ZodMiniObject<{
|
|
4
3
|
code: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
|
|
5
4
|
state: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
|
|
@@ -97,5 +96,4 @@ export declare class OAuth2Client {
|
|
|
97
96
|
clientId: string;
|
|
98
97
|
}>;
|
|
99
98
|
}
|
|
100
|
-
//#endregion
|
|
101
99
|
//# sourceMappingURL=client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":["_$__types0.UserInfo"],"sources":["../../src/oauth2/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":["_$__types0.UserInfo"],"sources":["../../src/oauth2/client.ts"],"mappings":";qBAkBa,8CAAyB;;;;;;;yBAQpC;qBAEW,uCAAkB;;;;;;;;;;yBAY7B;qBAEW;mBACM;EACjB,YAAY,QAAQ;MAIhB;MAIA;MAIA;;UAKU;UAUN;;UAKM;;;;;;UAaA;;;;;;UAcA;UAYA;EAIR,yBACJ,UACA,OACA;IAEA;IACA;IACA,OAAO;MACL,QAAQ;;EAYN,4BACJ,UACA,MACA;IAEA;IACA;IACA,OAAO;MACL;IAAU;IAAkB,OAAO;;;EAcjC,cACJ,UACA,UACA,OACA;IAEA;IACA;IACA,OAAO,cAAc;IACrB,WAAW;MACZ,QADYA;;EAOP,eAAe,UAAU;IAAgB;IAAkB;MAAoB;;;;;EAS/E,qBACJ,UACA,UACA;IAEA;IACA;IACA;MACE,QAAQ;EAON,cACJ,UACA,UACA;IAEA;IACA;IACA;MACD;;;;;EAWK,oBACJ,UACA,eAAe,kBAAkB,eACjC;IAEA;IACA,aAAa;IACb,OAAO,KAAK;MACb"}
|
package/dist/oauth2/client.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OAuth2Error } from "./error.mjs";
|
|
2
2
|
import { invariant } from "@shware/utils";
|
|
3
3
|
import { object, optional, string } from "zod/v4-mini";
|
|
4
|
-
|
|
4
|
+
// src/oauth2/client.ts
|
|
5
5
|
const oauth2RedirectQuerySchema = object({
|
|
6
6
|
code: optional(string()),
|
|
7
7
|
state: optional(string()),
|
|
@@ -173,7 +173,6 @@ var OAuth2Client = class {
|
|
|
173
173
|
function isOneTapProvider(provider) {
|
|
174
174
|
return typeof provider.getTokenInfo === "function";
|
|
175
175
|
}
|
|
176
|
-
//#endregion
|
|
177
176
|
export { OAuth2Client, googleOneTapSchema, oauth2RedirectQuerySchema };
|
|
178
177
|
|
|
179
178
|
//# sourceMappingURL=client.mjs.map
|
package/dist/oauth2/error.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/oauth2/error.ts
|
|
3
3
|
/** The registered error codes of `OAuth2ErrorType`, for checking untrusted input at runtime. */
|
|
4
4
|
const OAUTH2_ERROR_TYPES = /* @__PURE__ */ new Set([
|
|
5
5
|
"invalid_request",
|
|
@@ -35,7 +35,6 @@ var AuthenticationError = class AuthenticationError extends Error {
|
|
|
35
35
|
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
exports.AuthenticationError = AuthenticationError;
|
|
40
39
|
exports.OAuth2Error = OAuth2Error;
|
|
41
40
|
exports.isKnownOAuth2ErrorType = isKnownOAuth2ErrorType;
|
package/dist/oauth2/error.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/oauth2/error.d.ts
|
|
2
1
|
export type OAuth2ErrorType = 'invalid_request' | 'invalid_client' | 'invalid_grant' | 'invalid_token' | 'invalid_scope' | 'unauthorized_client' | 'unsupported_grant_type' | 'unsupported_response_type' | 'insufficient_scope' | 'redirect_uri_mismatch' | 'access_denied' | 'server_error' | 'temporarily_unavailable' | (string & {});
|
|
3
2
|
export declare function isKnownOAuth2ErrorType(value: string): boolean;
|
|
4
3
|
export declare class OAuth2Error extends Error {
|
|
@@ -9,5 +8,4 @@ export declare class OAuth2Error extends Error {
|
|
|
9
8
|
export declare class AuthenticationError extends Error {
|
|
10
9
|
constructor(message: string);
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=error.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.cts","names":[],"sources":["../../src/oauth2/error.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.cts","names":[],"sources":["../../src/oauth2/error.ts"],"mappings":"A,YACY;wBAiCI,uBAAuB;qBAI1B,oBAAoB;WACtB;WACA,OAAO;EAEhB,YAAY,gBAAgB,OAAO,iBAAiB;;qBAQzC,4BAA4B;EACvC,YAAY"}
|
package/dist/oauth2/error.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/oauth2/error.d.ts
|
|
2
1
|
export type OAuth2ErrorType = 'invalid_request' | 'invalid_client' | 'invalid_grant' | 'invalid_token' | 'invalid_scope' | 'unauthorized_client' | 'unsupported_grant_type' | 'unsupported_response_type' | 'insufficient_scope' | 'redirect_uri_mismatch' | 'access_denied' | 'server_error' | 'temporarily_unavailable' | (string & {});
|
|
3
2
|
export declare function isKnownOAuth2ErrorType(value: string): boolean;
|
|
4
3
|
export declare class OAuth2Error extends Error {
|
|
@@ -9,5 +8,4 @@ export declare class OAuth2Error extends Error {
|
|
|
9
8
|
export declare class AuthenticationError extends Error {
|
|
10
9
|
constructor(message: string);
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=error.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.mts","names":[],"sources":["../../src/oauth2/error.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.mts","names":[],"sources":["../../src/oauth2/error.ts"],"mappings":"A,YACY;wBAiCI,uBAAuB;qBAI1B,oBAAoB;WACtB;WACA,OAAO;EAEhB,YAAY,gBAAgB,OAAO,iBAAiB;;qBAQzC,4BAA4B;EACvC,YAAY"}
|
package/dist/oauth2/error.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/oauth2/error.ts
|
|
2
2
|
/** The registered error codes of `OAuth2ErrorType`, for checking untrusted input at runtime. */
|
|
3
3
|
const OAUTH2_ERROR_TYPES = /* @__PURE__ */ new Set([
|
|
4
4
|
"invalid_request",
|
|
@@ -34,7 +34,6 @@ var AuthenticationError = class AuthenticationError extends Error {
|
|
|
34
34
|
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { AuthenticationError, OAuth2Error, isKnownOAuth2ErrorType };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=error.mjs.map
|
package/dist/oauth2/name.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/oauth2/name.ts
|
|
3
3
|
/**
|
|
4
4
|
* Upper bound, in characters, on each name part taken from the client. Names that reach us outside
|
|
5
5
|
* a signed token (Apple's form_post `user`, a native login body) are plain client input, so they
|
|
@@ -96,7 +96,6 @@ function isObject(value) {
|
|
|
96
96
|
function withoutUndefined(value) {
|
|
97
97
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
98
98
|
}
|
|
99
|
-
//#endregion
|
|
100
99
|
exports.MAX_NAME_PART_LENGTH = MAX_NAME_PART_LENGTH;
|
|
101
100
|
exports.cleanNamePart = cleanNamePart;
|
|
102
101
|
exports.cleanPersonName = cleanPersonName;
|
package/dist/oauth2/name.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PersonNameComponents, StandardClaims } from "./types.cjs";
|
|
2
|
-
//#region src/oauth2/name.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Upper bound, in characters, on each name part taken from the client. Names that reach us outside
|
|
5
4
|
* a signed token (Apple's form_post `user`, a native login body) are plain client input, so they
|
|
@@ -44,6 +43,5 @@ type NameClaims = Pick<StandardClaims, 'name' | 'given_name' | 'family_name' | '
|
|
|
44
43
|
* Undefined parts are left out, so spreading the result never overwrites a claim with `undefined`.
|
|
45
44
|
*/
|
|
46
45
|
export declare function nameClaims(parts: Omit<NameClaims, 'name'>): NameClaims;
|
|
47
|
-
//#endregion
|
|
48
46
|
export {};
|
|
49
47
|
//# sourceMappingURL=name.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name.d.cts","names":[],"sources":["../../src/oauth2/name.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"name.d.cts","names":[],"sources":["../../src/oauth2/name.ts"],"mappings":";;;;;;qBAOa;;;;;;;wBAaG,cACd,YACA,eACC,KAAK;;;;;;wBAcQ,cAAc;;iBAQb;EACf;IAAS;IAAoB;;EAC7B;;;;;;;wBAQc,eAAe,0BAA0B;;;;;wBAkCzC,gBAAgB,iBAAiB;KAU5C,aAAa,KAChB;;;;;wBAQc,WAAW,OAAO,KAAK,sBAAsB"}
|
package/dist/oauth2/name.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PersonNameComponents, StandardClaims } from "./types.mjs";
|
|
2
|
-
//#region src/oauth2/name.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Upper bound, in characters, on each name part taken from the client. Names that reach us outside
|
|
5
4
|
* a signed token (Apple's form_post `user`, a native login body) are plain client input, so they
|
|
@@ -44,6 +43,5 @@ type NameClaims = Pick<StandardClaims, 'name' | 'given_name' | 'family_name' | '
|
|
|
44
43
|
* Undefined parts are left out, so spreading the result never overwrites a claim with `undefined`.
|
|
45
44
|
*/
|
|
46
45
|
export declare function nameClaims(parts: Omit<NameClaims, 'name'>): NameClaims;
|
|
47
|
-
//#endregion
|
|
48
46
|
export {};
|
|
49
47
|
//# sourceMappingURL=name.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name.d.mts","names":[],"sources":["../../src/oauth2/name.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"name.d.mts","names":[],"sources":["../../src/oauth2/name.ts"],"mappings":";;;;;;qBAOa;;;;;;;wBAaG,cACd,YACA,eACC,KAAK;;;;;;wBAcQ,cAAc;;iBAQb;EACf;IAAS;IAAoB;;EAC7B;;;;;;;wBAQc,eAAe,0BAA0B;;;;;wBAkCzC,gBAAgB,iBAAiB;KAU5C,aAAa,KAChB;;;;;wBAQc,WAAW,OAAO,KAAK,sBAAsB"}
|
package/dist/oauth2/name.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/oauth2/name.ts
|
|
2
2
|
/**
|
|
3
3
|
* Upper bound, in characters, on each name part taken from the client. Names that reach us outside
|
|
4
4
|
* a signed token (Apple's form_post `user`, a native login body) are plain client input, so they
|
|
@@ -95,7 +95,6 @@ function isObject(value) {
|
|
|
95
95
|
function withoutUndefined(value) {
|
|
96
96
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { MAX_NAME_PART_LENGTH, cleanNamePart, cleanPersonName, composeName, nameClaims, parseAppleUser };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=name.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let jose = require("jose");
|
|
3
|
-
|
|
3
|
+
// src/oauth2/provider/apple-client-secret.ts
|
|
4
4
|
/**
|
|
5
5
|
* Sign in with Apple has no static client secret: the secret is a JWT the server signs with its
|
|
6
6
|
* Sign in with Apple key (ES256, `iss` = team, `sub` = client id, `aud` = appleid.apple.com), and
|
|
@@ -40,7 +40,6 @@ function createAppleClientSecret(options) {
|
|
|
40
40
|
return secret;
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
//#endregion
|
|
44
43
|
exports.createAppleClientSecret = createAppleClientSecret;
|
|
45
44
|
|
|
46
45
|
//# sourceMappingURL=apple-client-secret.cjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/oauth2/provider/apple-client-secret.d.ts
|
|
2
1
|
export interface AppleClientSecretOptions {
|
|
3
2
|
/** Apple Developer Team ID (Membership details). */
|
|
4
3
|
teamId: string;
|
|
@@ -23,5 +22,4 @@ export interface AppleClientSecretOptions {
|
|
|
23
22
|
* instead of generating, storing and rotating static ones by hand.
|
|
24
23
|
*/
|
|
25
24
|
export declare function createAppleClientSecret(options: AppleClientSecretOptions): (clientId: string) => Promise<string>;
|
|
26
|
-
//#endregion
|
|
27
25
|
//# sourceMappingURL=apple-client-secret.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-client-secret.d.cts","names":[],"sources":["../../../src/oauth2/provider/apple-client-secret.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"apple-client-secret.d.cts","names":[],"sources":["../../../src/oauth2/provider/apple-client-secret.ts"],"mappings":"A,iBAEiB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;wBAcc,wBAAwB,SAAS,4BAAwB,qBAmBZ"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/oauth2/provider/apple-client-secret.d.ts
|
|
2
1
|
export interface AppleClientSecretOptions {
|
|
3
2
|
/** Apple Developer Team ID (Membership details). */
|
|
4
3
|
teamId: string;
|
|
@@ -23,5 +22,4 @@ export interface AppleClientSecretOptions {
|
|
|
23
22
|
* instead of generating, storing and rotating static ones by hand.
|
|
24
23
|
*/
|
|
25
24
|
export declare function createAppleClientSecret(options: AppleClientSecretOptions): (clientId: string) => Promise<string>;
|
|
26
|
-
//#endregion
|
|
27
25
|
//# sourceMappingURL=apple-client-secret.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-client-secret.d.mts","names":[],"sources":["../../../src/oauth2/provider/apple-client-secret.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"apple-client-secret.d.mts","names":[],"sources":["../../../src/oauth2/provider/apple-client-secret.ts"],"mappings":"A,iBAEiB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;wBAcc,wBAAwB,SAAS,4BAAwB,qBAmBZ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SignJWT, importPKCS8 } from "jose";
|
|
2
|
-
|
|
2
|
+
// src/oauth2/provider/apple-client-secret.ts
|
|
3
3
|
/**
|
|
4
4
|
* Sign in with Apple has no static client secret: the secret is a JWT the server signs with its
|
|
5
5
|
* Sign in with Apple key (ES256, `iss` = team, `sub` = client id, `aud` = appleid.apple.com), and
|
|
@@ -39,7 +39,6 @@ function createAppleClientSecret(options) {
|
|
|
39
39
|
return secret;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { createAppleClientSecret };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=apple-client-secret.mjs.map
|