@better-auth/sso 1.4.0-beta.12 → 1.4.0-beta.14
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/.turbo/turbo-build.log +12 -12
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/{index-B2BVFq3k.d.ts → index-CL9gq2xe.d.ts} +2 -2
- package/dist/{index-ChbeAG7i.d.cts → index-N2GvRGik.d.cts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-Z1RpfPZt.js → src-BEPbgggK.js} +6 -6
- package/dist/{src-BYOa9Nr6.cjs → src-BsLnNXTo.cjs} +10 -10
- package/package.json +12 -4
- package/src/index.ts +7 -8
- package/src/oidc.test.ts +5 -5
- package/src/saml.test.ts +17 -17
- package/tsconfig.json +6 -4
- package/tsdown.config.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/sso@1.4.0-beta.
|
|
2
|
+
> @better-auth/sso@1.4.0-beta.14 build /home/runner/work/better-auth/better-auth/packages/sso
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
|
-
[34mℹ[39m tsdown [2mv0.15.
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.15.10[22m powered by rolldown [2mv1.0.0-beta.44[22m
|
|
6
6
|
[34mℹ[39m Using tsdown config: [4m/home/runner/work/better-auth/better-auth/packages/sso/tsdown.config.ts[24m
|
|
7
7
|
[34mℹ[39m entry: [34msrc/client.ts, src/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mclient.cjs[22m [2m 0.19 kB[22m [2m│ gzip: 0.
|
|
10
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mclient.cjs[22m [2m 0.19 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
11
11
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.cjs[22m [2m 0.08 kB[22m [2m│ gzip: 0.08 kB[22m
|
|
12
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22msrc-
|
|
12
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22msrc-BsLnNXTo.cjs [2m52.34 kB[22m [2m│ gzip: 9.21 kB[22m
|
|
13
13
|
[34mℹ[39m [33m[CJS][39m 3 files, total: 52.61 kB
|
|
14
14
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mclient.js[22m [2m 0.18 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
15
15
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.js[22m [2m 0.06 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
16
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22msrc-
|
|
17
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m 0.
|
|
16
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22msrc-BEPbgggK.js [2m49.59 kB[22m [2m│ gzip: 8.54 kB[22m
|
|
17
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
18
18
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mclient.d.ts[22m[39m [2m 0.21 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
19
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-
|
|
20
|
-
[34mℹ[39m [34m[ESM][39m 6 files, total: 71.
|
|
21
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m 0.
|
|
19
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-CL9gq2xe.d.ts[39m [2m21.42 kB[22m [2m│ gzip: 3.10 kB[22m
|
|
20
|
+
[34mℹ[39m [34m[ESM][39m 6 files, total: 71.70 kB
|
|
21
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
22
22
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mclient.d.cts[22m[39m [2m 0.21 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
23
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-
|
|
24
|
-
[34mℹ[39m [33m[CJS][39m 3 files, total: 21.
|
|
25
|
-
[32m✔[39m Build complete in [
|
|
23
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-N2GvRGik.d.cts[39m [2m21.42 kB[22m [2m│ gzip: 3.10 kB[22m
|
|
24
|
+
[34mℹ[39m [33m[CJS][39m 3 files, total: 21.88 kB
|
|
25
|
+
[32m✔[39m Build complete in [32m8609ms[39m
|
package/dist/client.cjs
CHANGED
package/dist/client.d.cts
CHANGED
package/dist/client.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -193,8 +193,8 @@ declare const sso: (options?: SSOOptions) => {
|
|
|
193
193
|
query: z.ZodObject<{
|
|
194
194
|
providerId: z.ZodString;
|
|
195
195
|
format: z.ZodDefault<z.ZodEnum<{
|
|
196
|
-
xml: "xml";
|
|
197
196
|
json: "json";
|
|
197
|
+
xml: "xml";
|
|
198
198
|
}>>;
|
|
199
199
|
}, z.core.$strip>;
|
|
200
200
|
metadata: {
|
|
@@ -685,4 +685,4 @@ declare const sso: (options?: SSOOptions) => {
|
|
|
685
685
|
};
|
|
686
686
|
};
|
|
687
687
|
//#endregion
|
|
688
|
-
export {
|
|
688
|
+
export { SSOOptions as a, SAMLMapping as i, OIDCMapping as n, SSOProvider as o, SAMLConfig as r, sso as s, OIDCConfig as t };
|
|
@@ -193,8 +193,8 @@ declare const sso: (options?: SSOOptions) => {
|
|
|
193
193
|
query: z.ZodObject<{
|
|
194
194
|
providerId: z.ZodString;
|
|
195
195
|
format: z.ZodDefault<z.ZodEnum<{
|
|
196
|
-
xml: "xml";
|
|
197
196
|
json: "json";
|
|
197
|
+
xml: "xml";
|
|
198
198
|
}>>;
|
|
199
199
|
}, z.core.$strip>;
|
|
200
200
|
metadata: {
|
|
@@ -685,4 +685,4 @@ declare const sso: (options?: SSOOptions) => {
|
|
|
685
685
|
};
|
|
686
686
|
};
|
|
687
687
|
//#endregion
|
|
688
|
-
export {
|
|
688
|
+
export { SSOOptions as a, SAMLMapping as i, OIDCMapping as n, SSOProvider as o, SAMLConfig as r, sso as s, OIDCConfig as t };
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SSOOptions, i as SAMLMapping, n as OIDCMapping, o as SSOProvider, r as SAMLConfig, s as sso, t as OIDCConfig } from "./index-N2GvRGik.cjs";
|
|
2
2
|
export { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SSOOptions, i as SAMLMapping, n as OIDCMapping, o as SSOProvider, r as SAMLConfig, s as sso, t as OIDCConfig } from "./index-CL9gq2xe.js";
|
|
2
2
|
export { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { BetterFetchError, betterFetch } from "@better-fetch/fetch";
|
|
1
2
|
import { generateState } from "better-auth";
|
|
2
3
|
import { APIError, sessionMiddleware } from "better-auth/api";
|
|
4
|
+
import { setSessionCookie } from "better-auth/cookies";
|
|
3
5
|
import { createAuthorizationURL, handleOAuthUserInfo, parseState, validateAuthorizationCode, validateToken } from "better-auth/oauth2";
|
|
4
6
|
import { createAuthEndpoint } from "better-auth/plugins";
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import * as saml from "samlify";
|
|
7
|
-
import { BetterFetchError, betterFetch } from "@better-fetch/fetch";
|
|
8
|
-
import { decodeJwt } from "jose";
|
|
9
|
-
import { setSessionCookie } from "better-auth/cookies";
|
|
10
7
|
import { XMLValidator } from "fast-xml-parser";
|
|
8
|
+
import { decodeJwt } from "jose";
|
|
9
|
+
import * as saml from "samlify";
|
|
10
|
+
import * as z from "zod/v4";
|
|
11
11
|
|
|
12
12
|
//#region src/index.ts
|
|
13
13
|
saml.setSchemaValidator({ async validate(xml) {
|
|
@@ -1215,4 +1215,4 @@ const sso = (options) => {
|
|
|
1215
1215
|
};
|
|
1216
1216
|
|
|
1217
1217
|
//#endregion
|
|
1218
|
-
export { sso };
|
|
1218
|
+
export { sso as t };
|
|
@@ -21,26 +21,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
|
+
let __better_fetch_fetch = require("@better-fetch/fetch");
|
|
25
|
+
__better_fetch_fetch = __toESM(__better_fetch_fetch);
|
|
24
26
|
let better_auth = require("better-auth");
|
|
25
27
|
better_auth = __toESM(better_auth);
|
|
26
28
|
let better_auth_api = require("better-auth/api");
|
|
27
29
|
better_auth_api = __toESM(better_auth_api);
|
|
30
|
+
let better_auth_cookies = require("better-auth/cookies");
|
|
31
|
+
better_auth_cookies = __toESM(better_auth_cookies);
|
|
28
32
|
let better_auth_oauth2 = require("better-auth/oauth2");
|
|
29
33
|
better_auth_oauth2 = __toESM(better_auth_oauth2);
|
|
30
34
|
let better_auth_plugins = require("better-auth/plugins");
|
|
31
35
|
better_auth_plugins = __toESM(better_auth_plugins);
|
|
32
|
-
let zod_v4 = require("zod/v4");
|
|
33
|
-
zod_v4 = __toESM(zod_v4);
|
|
34
|
-
let samlify = require("samlify");
|
|
35
|
-
samlify = __toESM(samlify);
|
|
36
|
-
let __better_fetch_fetch = require("@better-fetch/fetch");
|
|
37
|
-
__better_fetch_fetch = __toESM(__better_fetch_fetch);
|
|
38
|
-
let jose = require("jose");
|
|
39
|
-
jose = __toESM(jose);
|
|
40
|
-
let better_auth_cookies = require("better-auth/cookies");
|
|
41
|
-
better_auth_cookies = __toESM(better_auth_cookies);
|
|
42
36
|
let fast_xml_parser = require("fast-xml-parser");
|
|
43
37
|
fast_xml_parser = __toESM(fast_xml_parser);
|
|
38
|
+
let jose = require("jose");
|
|
39
|
+
jose = __toESM(jose);
|
|
40
|
+
let samlify = require("samlify");
|
|
41
|
+
samlify = __toESM(samlify);
|
|
42
|
+
let zod_v4 = require("zod/v4");
|
|
43
|
+
zod_v4 = __toESM(zod_v4);
|
|
44
44
|
|
|
45
45
|
//#region src/index.ts
|
|
46
46
|
samlify.setSchemaValidator({ async validate(xml) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/sso",
|
|
3
3
|
"author": "Bereket Engida",
|
|
4
|
-
"version": "1.4.0-beta.
|
|
4
|
+
"version": "1.4.0-beta.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
+
"homepage": "https://www.better-auth.com/docs/plugins/sso",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/better-auth/better-auth",
|
|
11
|
+
"directory": "packages/sso"
|
|
12
|
+
},
|
|
7
13
|
"license": "MIT",
|
|
8
14
|
"keywords": [
|
|
9
15
|
"sso",
|
|
@@ -24,11 +30,13 @@
|
|
|
24
30
|
"description": "SSO plugin for Better Auth",
|
|
25
31
|
"exports": {
|
|
26
32
|
".": {
|
|
33
|
+
"better-auth-dev-source": "./src/index.ts",
|
|
27
34
|
"types": "./dist/index.d.ts",
|
|
28
35
|
"import": "./dist/index.js",
|
|
29
36
|
"require": "./dist/index.cjs"
|
|
30
37
|
},
|
|
31
38
|
"./client": {
|
|
39
|
+
"better-auth-dev-source": "./src/client.ts",
|
|
32
40
|
"types": "./dist/client.d.ts",
|
|
33
41
|
"import": "./dist/client.js",
|
|
34
42
|
"require": "./dist/client.cjs"
|
|
@@ -58,11 +66,11 @@
|
|
|
58
66
|
"better-call": "1.0.24",
|
|
59
67
|
"body-parser": "^2.2.0",
|
|
60
68
|
"express": "^5.1.0",
|
|
61
|
-
"tsdown": "^0.15.
|
|
62
|
-
"better-auth": "^1.4.0-beta.
|
|
69
|
+
"tsdown": "^0.15.10",
|
|
70
|
+
"better-auth": "^1.4.0-beta.14"
|
|
63
71
|
},
|
|
64
72
|
"peerDependencies": {
|
|
65
|
-
"better-auth": "1.4.0-beta.
|
|
73
|
+
"better-auth": "1.4.0-beta.14"
|
|
66
74
|
},
|
|
67
75
|
"scripts": {
|
|
68
76
|
"test": "vitest",
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { BetterFetchError, betterFetch } from "@better-fetch/fetch";
|
|
1
2
|
import {
|
|
2
|
-
generateState,
|
|
3
3
|
type Account,
|
|
4
4
|
type BetterAuthPlugin,
|
|
5
|
+
generateState,
|
|
5
6
|
type OAuth2Tokens,
|
|
6
7
|
type Session,
|
|
7
8
|
type User,
|
|
8
9
|
} from "better-auth";
|
|
9
10
|
import { APIError, sessionMiddleware } from "better-auth/api";
|
|
11
|
+
import { setSessionCookie } from "better-auth/cookies";
|
|
10
12
|
import {
|
|
11
13
|
createAuthorizationURL,
|
|
12
14
|
handleOAuthUserInfo,
|
|
@@ -14,17 +16,14 @@ import {
|
|
|
14
16
|
validateAuthorizationCode,
|
|
15
17
|
validateToken,
|
|
16
18
|
} from "better-auth/oauth2";
|
|
17
|
-
|
|
18
19
|
import { createAuthEndpoint } from "better-auth/plugins";
|
|
19
|
-
import
|
|
20
|
+
import { XMLValidator } from "fast-xml-parser";
|
|
21
|
+
import { decodeJwt } from "jose";
|
|
20
22
|
import * as saml from "samlify";
|
|
21
23
|
import type { BindingContext } from "samlify/types/src/entity";
|
|
22
|
-
import { betterFetch, BetterFetchError } from "@better-fetch/fetch";
|
|
23
|
-
import { decodeJwt } from "jose";
|
|
24
|
-
import { setSessionCookie } from "better-auth/cookies";
|
|
25
|
-
import type { FlowResult } from "samlify/types/src/flow";
|
|
26
|
-
import { XMLValidator } from "fast-xml-parser";
|
|
27
24
|
import type { IdentityProvider } from "samlify/types/src/entity-idp";
|
|
25
|
+
import type { FlowResult } from "samlify/types/src/flow";
|
|
26
|
+
import * as z from "zod/v4";
|
|
28
27
|
|
|
29
28
|
const fastValidator = {
|
|
30
29
|
async validate(xml: string) {
|
package/src/oidc.test.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
2
|
-
import { getTestInstanceMemory as getTestInstance } from "better-auth/test";
|
|
3
|
-
import { sso } from ".";
|
|
4
|
-
import { OAuth2Server } from "oauth2-mock-server";
|
|
5
1
|
import { betterFetch } from "@better-fetch/fetch";
|
|
6
|
-
import { organization } from "better-auth/plugins";
|
|
7
2
|
import { createAuthClient } from "better-auth/client";
|
|
3
|
+
import { organization } from "better-auth/plugins";
|
|
4
|
+
import { getTestInstanceMemory as getTestInstance } from "better-auth/test";
|
|
5
|
+
import { OAuth2Server } from "oauth2-mock-server";
|
|
6
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
7
|
+
import { sso } from ".";
|
|
8
8
|
import { ssoClient } from "./client";
|
|
9
9
|
|
|
10
10
|
let server = new OAuth2Server();
|
package/src/saml.test.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
afterAll,
|
|
3
|
-
beforeAll,
|
|
4
|
-
beforeEach,
|
|
5
|
-
describe,
|
|
6
|
-
expect,
|
|
7
|
-
it,
|
|
8
|
-
vi,
|
|
9
|
-
} from "vitest";
|
|
1
|
+
import { betterFetch } from "@better-fetch/fetch";
|
|
10
2
|
import { betterAuth } from "better-auth";
|
|
11
3
|
import { memoryAdapter } from "better-auth/adapters/memory";
|
|
12
4
|
import { createAuthClient } from "better-auth/client";
|
|
13
|
-
import { betterFetch } from "@better-fetch/fetch";
|
|
14
5
|
import { setCookieToHeader } from "better-auth/cookies";
|
|
15
6
|
import { bearer } from "better-auth/plugins";
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import * as saml from "samlify";
|
|
7
|
+
import { getTestInstanceMemory } from "better-auth/test";
|
|
8
|
+
import bodyParser from "body-parser";
|
|
9
|
+
import { randomUUID } from "crypto";
|
|
20
10
|
import type {
|
|
21
11
|
Application as ExpressApp,
|
|
22
12
|
Request as ExpressRequest,
|
|
23
13
|
Response as ExpressResponse,
|
|
24
14
|
} from "express";
|
|
25
15
|
import express from "express";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
16
|
+
import { createServer } from "http";
|
|
17
|
+
import * as saml from "samlify";
|
|
18
|
+
import {
|
|
19
|
+
afterAll,
|
|
20
|
+
beforeAll,
|
|
21
|
+
beforeEach,
|
|
22
|
+
describe,
|
|
23
|
+
expect,
|
|
24
|
+
it,
|
|
25
|
+
vi,
|
|
26
|
+
} from "vitest";
|
|
27
|
+
import { sso } from ".";
|
|
28
|
+
import { ssoClient } from "./client";
|
|
29
29
|
|
|
30
30
|
const spMetadata = `
|
|
31
31
|
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="http://localhost:3001/api/sso/saml2/sp/metadata">
|
package/tsconfig.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"rootDir": "./src",
|
|
5
|
-
"outDir": "./dist",
|
|
6
4
|
"lib": ["esnext", "dom", "dom.iterable"]
|
|
7
5
|
},
|
|
8
|
-
"
|
|
6
|
+
"references": [
|
|
7
|
+
{
|
|
8
|
+
"path": "../better-auth/tsconfig.json"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
9
11
|
}
|
package/tsdown.config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from "tsdown";
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
dts: true,
|
|
4
|
+
dts: { build: true, incremental: true },
|
|
5
5
|
format: ["esm", "cjs"],
|
|
6
6
|
entry: ["./src/index.ts", "./src/client.ts"],
|
|
7
7
|
external: ["better-auth", "better-call", "@better-fetch/fetch", "stripe"],
|