@better-auth/sso 1.5.0-beta.13 → 1.5.0-beta.15
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 +11 -11
- package/dist/client.d.mts +3 -2
- package/dist/client.mjs +1 -1
- package/dist/client.mjs.map +1 -1
- package/dist/{index-DCUy0gtM.d.mts → index-CbKvQr9M.d.mts} +129 -65
- package/dist/index.d.mts +56 -2
- package/dist/index.mjs +635 -236
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/client.ts +1 -1
- package/src/constants.ts +21 -0
- package/src/domain-verification.test.ts +46 -5
- package/src/index.ts +43 -2
- package/src/oidc/discovery.test.ts +7 -12
- package/src/oidc.test.ts +302 -1
- package/src/providers.test.ts +39 -45
- package/src/routes/domain-verification.ts +34 -12
- package/src/routes/helpers.ts +126 -0
- package/src/routes/providers.ts +16 -14
- package/src/routes/sso.ts +930 -359
- package/src/saml/algorithms.test.ts +1 -9
- package/src/saml/error-codes.ts +11 -0
- package/src/saml.test.ts +736 -4
- package/src/types.ts +53 -2
- package/src/utils.test.ts +3 -0
- package/vitest.config.ts +6 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* cspell:ignore xenc */
|
|
2
|
-
import {
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
import * as alg from "./algorithms";
|
|
4
4
|
|
|
5
5
|
const encryptedAssertionXml = `
|
|
@@ -41,10 +41,6 @@ const plainAssertionXml = `
|
|
|
41
41
|
`;
|
|
42
42
|
|
|
43
43
|
describe("validateSAMLAlgorithms", () => {
|
|
44
|
-
afterEach(() => {
|
|
45
|
-
vi.restoreAllMocks();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
44
|
describe("signature validation", () => {
|
|
49
45
|
it("should accept secure signature algorithms", () => {
|
|
50
46
|
expect(() =>
|
|
@@ -205,10 +201,6 @@ describe("algorithm constants", () => {
|
|
|
205
201
|
});
|
|
206
202
|
|
|
207
203
|
describe("validateConfigAlgorithms", () => {
|
|
208
|
-
afterEach(() => {
|
|
209
|
-
vi.restoreAllMocks();
|
|
210
|
-
});
|
|
211
|
-
|
|
212
204
|
describe("signature algorithm validation", () => {
|
|
213
205
|
it("should accept secure signature algorithms", () => {
|
|
214
206
|
expect(() =>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineErrorCodes } from "@better-auth/core/utils/error-codes";
|
|
2
|
+
|
|
3
|
+
export const SAML_ERROR_CODES = defineErrorCodes({
|
|
4
|
+
// SLO errors
|
|
5
|
+
SINGLE_LOGOUT_NOT_ENABLED: "Single Logout is not enabled",
|
|
6
|
+
INVALID_LOGOUT_RESPONSE: "Invalid LogoutResponse",
|
|
7
|
+
INVALID_LOGOUT_REQUEST: "Invalid LogoutRequest",
|
|
8
|
+
LOGOUT_FAILED_AT_IDP: "Logout failed at IdP",
|
|
9
|
+
IDP_SLO_NOT_SUPPORTED: "IdP does not support Single Logout Service",
|
|
10
|
+
SAML_PROVIDER_NOT_FOUND: "SAML provider not found",
|
|
11
|
+
});
|