From 3b62bd58c264be0225a74ae0eb35c4761c419b79 Mon Sep 17 00:00:00 2001 From: Danny Martini Date: Thu, 14 Nov 2024 14:33:37 +0100 Subject: [PATCH] fix(core): Allow Azure's SAML metadata XML containing WS-Federation nodes to pass validation (#11724) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ --- .../sso/saml/__tests__/saml-validator.test.ts | 352 +++++ .../saml/__tests__/saml.service.ee.test.ts | 2 +- packages/cli/src/sso/saml/saml-validator.ts | 73 +- .../sso/saml/schema/metadata-exchange.xsd.ts | 117 ++ ...is-200401-wss-wssecurity-secext-1.0.xsd.ts | 200 +++ ...s-200401-wss-wssecurity-utility-1.0.xsd.ts | 113 ++ .../schema/saml-schema-assertion-2.0.xsd.ts | 9 +- .../schema/saml-schema-metadata-2.0.xsd.ts | 11 +- .../schema/saml-schema-protocol-2.0.xsd.ts | 9 +- .../cli/src/sso/saml/schema/ws-addr.xsd.ts | 142 ++ .../sso/saml/schema/ws-authorization.xsd.ts | 150 ++ .../src/sso/saml/schema/ws-federation.xsd.ts | 475 +++++++ .../saml/schema/ws-securitypolicy-1.2.xsd.ts | 1210 +++++++++++++++++ .../src/sso/saml/schema/xenc-schema.xsd.ts | 9 +- packages/cli/src/sso/saml/schema/xml.xsd.ts | 9 +- .../saml/schema/xmldsig-core-schema.xsd.ts | 9 +- 16 files changed, 2828 insertions(+), 62 deletions(-) create mode 100644 packages/cli/src/sso/saml/__tests__/saml-validator.test.ts create mode 100644 packages/cli/src/sso/saml/schema/metadata-exchange.xsd.ts create mode 100644 packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.ts create mode 100644 packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.ts create mode 100644 packages/cli/src/sso/saml/schema/ws-addr.xsd.ts create mode 100644 packages/cli/src/sso/saml/schema/ws-authorization.xsd.ts create mode 100644 packages/cli/src/sso/saml/schema/ws-federation.xsd.ts create mode 100644 packages/cli/src/sso/saml/schema/ws-securitypolicy-1.2.xsd.ts diff --git a/packages/cli/src/sso/saml/__tests__/saml-validator.test.ts b/packages/cli/src/sso/saml/__tests__/saml-validator.test.ts new file mode 100644 index 0000000000..8594676ab2 --- /dev/null +++ b/packages/cli/src/sso/saml/__tests__/saml-validator.test.ts @@ -0,0 +1,352 @@ +import { Logger } from '@/logging/logger.service'; +import { mockInstance } from '@test/mocking'; + +import { validateMetadata, validateResponse } from '../saml-validator'; + +describe('saml-validator', () => { + mockInstance(Logger); + + describe('validateMetadata', () => { + test('successfully validates metadata containing ws federation tags', async () => { + // ARRANGE + const metadata = ` + + + + + + + + + + + + hoeupPMPzijHu6caNarGYjsG0eKm4DOFUhjo0bPo0Ls= + + + + DQnnT/5se4dqYN86R35MCdbyKVl64lGPLSIVrxFxrOQ9YRK1br7Z1Bt1/LQD4f92z+GwAl+9tZTWhuoy6OGHCV6LlqBEztW43KnlCKw6eaNg4/6NluzJ/XeknXYLURDnfFVyGbLQAYWGND4Qm8CUXO/GjGfWTZuArvrDDC36/2FA41jKXtf1InxGFx1Bbaskx3n3KCFFth/V9knbnc1zftEe022aQluPRoGccROOI4ZeLUFL6+1gYlxjx0gFIOTRiuvrzR765lHNrF7iZ4aD+XukqtkGEtxTkiLoB+Bnr8Fd7IF5rV5FKTZWSxo+ZFcLimrDGtFPItVrC/oKRc+MGA== + + + + MIIC8DCCAdigAwIBAgIQf+iroClVKohAtsyk0Ne13TANBgkqhkiG9w0BAQsFADA0MTIwMAYDVQQDEylNaWNyb3NvZnQgQXp1cmUgRmVkZXJhdGVkIFNTTyBDZXJ0aWZpY2F0ZTAeFw0yNDExMTMxMDEwNTNaFw0yNzExMTMxMDEwNTNaMDQxMjAwBgNVBAMTKU1pY3Jvc29mdCBBenVyZSBGZWRlcmF0ZWQgU1NPIENlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwE8Ad1OMQKfaHi6YrsEcmMNwIAQ86h7JmnuABf5xLNd27jaMF4FVxHbEtC/BYxtcmwld5zbkCVXQ6PT6VoeYIjHMVnptFXg15EGgjnqpxWsjLDQNoSdSQu8VhG+8Yb5M7KPt+UEZfsRZVrgqMjdSEMVrOzPMD8KMB7wnghYX6npcZhn7D5w/F9gVDpI1Um8M/FIUKYVSYFjky1i24WvKmcBf71mAacZp48Zuj5by/ELIb6gAjpW5xpd02smpLthy/Yo4XDIQQurFOfjqyZd8xAZu/SfPsbjtymWw59tgd9RdYISl6O/241kY9h6Ojtx6WShOVDi6q+bJrfj9Z8WKcQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCiVxiQ9KpjihliQzIW45YO0EvRJtoPtyVAh9RiSGozbTl4otfrUJf8nbRtj7iZBRuuW4rrtRAH5kDb+i1wNUUQED2Pl/l4x5cN0oBytP3GSymq6NJx1gUOBO1BrNY+c3r5yHOUyj5qpbw9UkqpG1AqQkLLeZqB/yVCyOBQT7SKTbXVYhGefFM/+6z0/rGsWZN5OF6/2NC06ws1v4In28Atgpg4XxFh5TL7rPMJ11ca5MN9lHJoIUsvls053eQBcd7vJneqzd904B6WtPld6KOJK4dzIt9edHzPhaz158awWwx3iHsMn1Y/T0WVy5/4ZTzxY/i4U3t1Yt8ktxewVJYT + + + + + + + + + MIIC8DCCAdigAwIBAgIQf+iroClVKohAtsyk0Ne13TANBgkqhkiG9w0BAQsFADA0MTIwMAYDVQQDEylNaWNyb3NvZnQgQXp1cmUgRmVkZXJhdGVkIFNTTyBDZXJ0aWZpY2F0ZTAeFw0yNDExMTMxMDEwNTNaFw0yNzExMTMxMDEwNTNaMDQxMjAwBgNVBAMTKU1pY3Jvc29mdCBBenVyZSBGZWRlcmF0ZWQgU1NPIENlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwE8Ad1OMQKfaHi6YrsEcmMNwIAQ86h7JmnuABf5xLNd27jaMF4FVxHbEtC/BYxtcmwld5zbkCVXQ6PT6VoeYIjHMVnptFXg15EGgjnqpxWsjLDQNoSdSQu8VhG+8Yb5M7KPt+UEZfsRZVrgqMjdSEMVrOzPMD8KMB7wnghYX6npcZhn7D5w/F9gVDpI1Um8M/FIUKYVSYFjky1i24WvKmcBf71mAacZp48Zuj5by/ELIb6gAjpW5xpd02smpLthy/Yo4XDIQQurFOfjqyZd8xAZu/SfPsbjtymWw59tgd9RdYISl6O/241kY9h6Ojtx6WShOVDi6q+bJrfj9Z8WKcQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCiVxiQ9KpjihliQzIW45YO0EvRJtoPtyVAh9RiSGozbTl4otfrUJf8nbRtj7iZBRuuW4rrtRAH5kDb+i1wNUUQED2Pl/l4x5cN0oBytP3GSymq6NJx1gUOBO1BrNY+c3r5yHOUyj5qpbw9UkqpG1AqQkLLeZqB/yVCyOBQT7SKTbXVYhGefFM/+6z0/rGsWZN5OF6/2NC06ws1v4In28Atgpg4XxFh5TL7rPMJ11ca5MN9lHJoIUsvls053eQBcd7vJneqzd904B6WtPld6KOJK4dzIt9edHzPhaz158awWwx3iHsMn1Y/T0WVy5/4ZTzxY/i4U3t1Yt8ktxewVJYT + + + + + + Name + The mutable display name of the user. + + + Subject + An immutable, globally unique, non-reusable identifier of the user that is + unique to the application for which a token is issued. + + + Given Name + First name of the user. + + + Surname + Last name of the user. + + + Display Name + Display name of the user. + + + Nick Name + Nick name of the user. + + + Authentication Instant + The time (UTC) when the user is authenticated to Windows Azure Active + Directory. + + + Authentication Method + The method that Windows Azure Active Directory uses to authenticate users. + + + ObjectIdentifier + Primary identifier for the user in the directory. Immutable, globally + unique, non-reusable. + + + TenantId + Identifier for the user's tenant. + + + IdentityProvider + Identity provider for the user. + + + Email + Email address of the user. + + + Groups + Groups of the user. + + + External Access Token + Access token issued by external identity provider. + + + External Access Token Expiration + UTC expiration time of access token issued by external identity provider. + + + External OpenID 2.0 Identifier + OpenID 2.0 identifier issued by external identity provider. + + + GroupsOverageClaim + Issued when number of user's group claims exceeds return limit. + + + Role Claim + Roles that the user or Service Principal is attached to + + + RoleTemplate Id Claim + Role template id of the Built-in Directory Roles that the user is a member + of + + + + + https://login.microsoftonline.com/random-issuer/wsfed + + + + + https://login.microsoftonline.com/random-issuer/wsfed + + + + + + + + + MIIC8DCCAdigAwIBAgIQf+iroClVKohAtsyk0Ne13TANBgkqhkiG9w0BAQsFADA0MTIwMAYDVQQDEylNaWNyb3NvZnQgQXp1cmUgRmVkZXJhdGVkIFNTTyBDZXJ0aWZpY2F0ZTAeFw0yNDExMTMxMDEwNTNaFw0yNzExMTMxMDEwNTNaMDQxMjAwBgNVBAMTKU1pY3Jvc29mdCBBenVyZSBGZWRlcmF0ZWQgU1NPIENlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwE8Ad1OMQKfaHi6YrsEcmMNwIAQ86h7JmnuABf5xLNd27jaMF4FVxHbEtC/BYxtcmwld5zbkCVXQ6PT6VoeYIjHMVnptFXg15EGgjnqpxWsjLDQNoSdSQu8VhG+8Yb5M7KPt+UEZfsRZVrgqMjdSEMVrOzPMD8KMB7wnghYX6npcZhn7D5w/F9gVDpI1Um8M/FIUKYVSYFjky1i24WvKmcBf71mAacZp48Zuj5by/ELIb6gAjpW5xpd02smpLthy/Yo4XDIQQurFOfjqyZd8xAZu/SfPsbjtymWw59tgd9RdYISl6O/241kY9h6Ojtx6WShOVDi6q+bJrfj9Z8WKcQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCiVxiQ9KpjihliQzIW45YO0EvRJtoPtyVAh9RiSGozbTl4otfrUJf8nbRtj7iZBRuuW4rrtRAH5kDb+i1wNUUQED2Pl/l4x5cN0oBytP3GSymq6NJx1gUOBO1BrNY+c3r5yHOUyj5qpbw9UkqpG1AqQkLLeZqB/yVCyOBQT7SKTbXVYhGefFM/+6z0/rGsWZN5OF6/2NC06ws1v4In28Atgpg4XxFh5TL7rPMJ11ca5MN9lHJoIUsvls053eQBcd7vJneqzd904B6WtPld6KOJK4dzIt9edHzPhaz158awWwx3iHsMn1Y/T0WVy5/4ZTzxY/i4U3t1Yt8ktxewVJYT + + + + + + https://sts.windows.net/random-issuer/ + + + + + https://login.microsoftonline.com/random-issuer/wsfed + + + + + https://login.microsoftonline.com/random-issuer/wsfed + + + + + + + + + MIIC8DCCAdigAwIBAgIQf+iroClVKohAtsyk0Ne13TANBgkqhkiG9w0BAQsFADA0MTIwMAYDVQQDEylNaWNyb3NvZnQgQXp1cmUgRmVkZXJhdGVkIFNTTyBDZXJ0aWZpY2F0ZTAeFw0yNDExMTMxMDEwNTNaFw0yNzExMTMxMDEwNTNaMDQxMjAwBgNVBAMTKU1pY3Jvc29mdCBBenVyZSBGZWRlcmF0ZWQgU1NPIENlcnRpZmljYXRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwE8Ad1OMQKfaHi6YrsEcmMNwIAQ86h7JmnuABf5xLNd27jaMF4FVxHbEtC/BYxtcmwld5zbkCVXQ6PT6VoeYIjHMVnptFXg15EGgjnqpxWsjLDQNoSdSQu8VhG+8Yb5M7KPt+UEZfsRZVrgqMjdSEMVrOzPMD8KMB7wnghYX6npcZhn7D5w/F9gVDpI1Um8M/FIUKYVSYFjky1i24WvKmcBf71mAacZp48Zuj5by/ELIb6gAjpW5xpd02smpLthy/Yo4XDIQQurFOfjqyZd8xAZu/SfPsbjtymWw59tgd9RdYISl6O/241kY9h6Ojtx6WShOVDi6q+bJrfj9Z8WKcQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCiVxiQ9KpjihliQzIW45YO0EvRJtoPtyVAh9RiSGozbTl4otfrUJf8nbRtj7iZBRuuW4rrtRAH5kDb+i1wNUUQED2Pl/l4x5cN0oBytP3GSymq6NJx1gUOBO1BrNY+c3r5yHOUyj5qpbw9UkqpG1AqQkLLeZqB/yVCyOBQT7SKTbXVYhGefFM/+6z0/rGsWZN5OF6/2NC06ws1v4In28Atgpg4XxFh5TL7rPMJ11ca5MN9lHJoIUsvls053eQBcd7vJneqzd904B6WtPld6KOJK4dzIt9edHzPhaz158awWwx3iHsMn1Y/T0WVy5/4ZTzxY/i4U3t1Yt8ktxewVJYT + + + + + + + + `; + + // ACT + const result = await validateMetadata(metadata); + + // ASSERT + expect(result).toBe(true); + }); + + test('rejects invalid metadata', async () => { + // ARRANGE + // Invalid because required children are missing + const metadata = ` + + `; + + // ACT + const result = await validateMetadata(metadata); + + // ASSERT + expect(result).toBe(false); + }); + }); + + describe('validateResponse', () => { + test('successfully validates response', async () => { + // ARRANGE + const response = ` + + https://sts.windows.net/random-issuer/ + + + + + https://sts.windows.net/random-issuer/ + + + + + + + + + + + random_digest + + + + cmFuZG9tX3NpZ25hdHVyZQo= + + + + cmFuZG9tX3NpZ25hdHVyZQo= + + + + + + random_name_id + + + + + + + http://localhost:5678/rest/sso/saml/metadata + + + + + random-issuer + + + 4663f730-51c5-4490-a38a-19dda804865a + + + Danny n8n + + + mail + + + Danny + + + Martini + + + danny@n8n.io + + + random_name_id + + + Danny + + + Martini + + + danny@n8n.io + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:Unspecified + + + +`; + + // ACT + const result = await validateResponse(response); + + // ASSERT + expect(result).toBe(true); + }); + + test('rejects invalidate response', async () => { + // ARRANGE + // Invalid because required children are missing + const response = ` +`; + + // ACT + const result = await validateResponse(response); + + // ASSERT + expect(result).toBe(false); + }); + }); +}); diff --git a/packages/cli/src/sso/saml/__tests__/saml.service.ee.test.ts b/packages/cli/src/sso/saml/__tests__/saml.service.ee.test.ts index 9692cb9ec7..8bd5e32da2 100644 --- a/packages/cli/src/sso/saml/__tests__/saml.service.ee.test.ts +++ b/packages/cli/src/sso/saml/__tests__/saml.service.ee.test.ts @@ -98,7 +98,7 @@ describe('SamlService', () => { expect(samlService.reset).toHaveBeenCalledTimes(0); }); - test('does not call reset if no error is trown', async () => { + test('does not call reset if no error is thrown', async () => { // ARRANGE jest.spyOn(samlService, 'reset'); diff --git a/packages/cli/src/sso/saml/saml-validator.ts b/packages/cli/src/sso/saml/saml-validator.ts index 06a93cc4fb..07e9853f90 100644 --- a/packages/cli/src/sso/saml/saml-validator.ts +++ b/packages/cli/src/sso/saml/saml-validator.ts @@ -3,61 +3,36 @@ import type { XMLFileInfo } from 'xmllint-wasm'; import { Logger } from '@/logging/logger.service'; -let xml: XMLFileInfo; -let xmldsigCore: XMLFileInfo; -let xmlXenc: XMLFileInfo; let xmlMetadata: XMLFileInfo; -let xmlAssertion: XMLFileInfo; let xmlProtocol: XMLFileInfo; +let preload: XMLFileInfo[] = []; + // eslint-disable-next-line @typescript-eslint/consistent-type-imports let xmllintWasm: typeof import('xmllint-wasm') | undefined; // dynamically load schema files async function loadSchemas(): Promise { - if (!xml || xml.contents === '') { - Container.get(Logger).debug('Loading XML schema files for SAML validation into memory'); - const f = await import('./schema/xml.xsd'); - xml = { - fileName: 'xml.xsd', - contents: f.xsdXml, - }; - } - if (!xmldsigCore || xmldsigCore.contents === '') { - const f = await import('./schema/xmldsig-core-schema.xsd'); - xmldsigCore = { - fileName: 'xmldsig-core-schema.xsd', - contents: f.xsdXmldsigCore, - }; - } - if (!xmlXenc || xmlXenc.contents === '') { - const f = await import('./schema/xenc-schema.xsd'); - xmlXenc = { - fileName: 'xenc-schema.xsd', - contents: f.xsdXenc, - }; - } - if (!xmlMetadata || xmlMetadata.contents === '') { - const f = await import('./schema/saml-schema-metadata-2.0.xsd'); - xmlMetadata = { - fileName: 'saml-schema-metadata-2.0.xsd', - contents: f.xsdSamlSchemaMetadata20, - }; - } - if (!xmlAssertion || xmlAssertion.contents === '') { - const f = await import('./schema/saml-schema-assertion-2.0.xsd'); - xmlAssertion = { - fileName: 'saml-schema-assertion-2.0.xsd', - contents: f.xsdSamlSchemaAssertion20, - }; - } - if (!xmlProtocol || xmlProtocol.contents === '') { - const f = await import('./schema/saml-schema-protocol-2.0.xsd'); - xmlProtocol = { - fileName: 'saml-schema-protocol-2.0.xsd', - contents: f.xsdSamlSchemaProtocol20, - }; - } + xmlProtocol = (await import('./schema/saml-schema-protocol-2.0.xsd')).xmlFileInfo; + xmlMetadata = (await import('./schema/saml-schema-metadata-2.0.xsd')).xmlFileInfo; + preload = ( + await Promise.all([ + // SAML + import('./schema/saml-schema-assertion-2.0.xsd'), + import('./schema/xmldsig-core-schema.xsd'), + import('./schema/xenc-schema.xsd'), + import('./schema/xml.xsd'), + + // WS-Federation + import('./schema/ws-federation.xsd'), + import('./schema/oasis-200401-wss-wssecurity-secext-1.0.xsd'), + import('./schema/oasis-200401-wss-wssecurity-utility-1.0.xsd'), + import('./schema/ws-addr.xsd'), + import('./schema/metadata-exchange.xsd'), + import('./schema/ws-securitypolicy-1.2.xsd'), + import('./schema/ws-authorization.xsd'), + ]) + ).map((m) => m.xmlFileInfo); } // dynamically load xmllint-wasm @@ -82,7 +57,7 @@ export async function validateMetadata(metadata: string): Promise { ], extension: 'schema', schema: [xmlMetadata], - preload: [xmlProtocol, xmlAssertion, xmldsigCore, xmlXenc, xml], + preload: [xmlProtocol, ...preload], }); if (validationResult?.valid) { logger.debug('SAML Metadata is valid'); @@ -118,7 +93,7 @@ export async function validateResponse(response: string): Promise { ], extension: 'schema', schema: [xmlProtocol], - preload: [xmlMetadata, xmlAssertion, xmldsigCore, xmlXenc, xml], + preload: [xmlMetadata, ...preload], }); if (validationResult?.valid) { logger.debug('SAML Response is valid'); diff --git a/packages/cli/src/sso/saml/schema/metadata-exchange.xsd.ts b/packages/cli/src/sso/saml/schema/metadata-exchange.xsd.ts new file mode 100644 index 0000000000..d24876d682 --- /dev/null +++ b/packages/cli/src/sso/saml/schema/metadata-exchange.xsd.ts @@ -0,0 +1,117 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'MetadataExchange.xsd', + contents: ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.ts b/packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.ts new file mode 100644 index 0000000000..7a823c060b --- /dev/null +++ b/packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.ts @@ -0,0 +1,200 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'oasis-200401-wss-wssecurity-secext-1.0.xsd', + contents: ` + + + + + + + + This type represents an element with arbitrary attributes. + + + + + + + + + + + This type is used for password elements per Section 4.1. + + + + + + + + + + This type is used for elements containing stringified binary data. + + + + + + + + + + This type represents a username token per Section 4.1 + + + + + + + + + + + A security token that is encoded in binary + + + + + + + + + + A security token key identifier + + + + + + + + + + Typedef to allow a list of usages (as URIs). + + + + + + This global attribute is used to indicate the usage of a referenced or indicated token within the containing context + + + + + This type represents a reference to an external security token. + + + + + + + + This type represents a reference to an embedded security token. + + + + + + + + + + This type is used reference a security token. + + + + + + + + + + + This complexType defines header block to use for security-relevant data directed at a specific SOAP actor. + + + + + The use of "any" is to allow extensibility and different forms of security data. + + + + + + + + This complexType defines a container for elements to be specified from any namespace as properties/parameters of a DSIG transformation. + + + + + The use of "any" is to allow extensibility from any namespace. + + + + + + + + This element defines the wsse:UsernameToken element per Section 4.1. + + + + + This element defines the wsse:BinarySecurityToken element per Section 4.2. + + + + + This element defines a security token reference + + + + + This element defines a security token embedded reference + + + + + This element defines a key identifier reference + + + + + This element defines the wsse:SecurityTokenReference per Section 4.3. + + + + + This element defines the wsse:Security SOAP header element per Section 4. + + + + + This element contains properties for transformations from any namespace, including DSIG. + + + + + + + + + + + + + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.ts b/packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.ts new file mode 100644 index 0000000000..b6238e39c2 --- /dev/null +++ b/packages/cli/src/sso/saml/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.ts @@ -0,0 +1,113 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'oasis-200401-wss-wssecurity-utility-1.0.xsd', + contents: ` + + + + + + +This type defines the fault code value for Timestamp message expiration. + + + + + + + + + + +This global attribute supports annotating arbitrary elements with an ID. + + + + + + +Convenience attribute group used to simplify this schema. + + + + + + + + + +This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes. + + + + + + + + + + + +This type is for elements whose [children] is an anyURI and can have arbitrary attributes. + + + + + + + + + + + + +This complex type ties together the timestamp related elements into a composite type. + + + + + + + + + + + + + + +This element allows Timestamps to be applied anywhere element wildcards are present, +including as a SOAP header. + + + + + + + +This element allows an expiration time to be applied anywhere element wildcards are present. + + + + + + +This element allows a creation time to be applied anywhere element wildcards are present. + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/saml-schema-assertion-2.0.xsd.ts b/packages/cli/src/sso/saml/schema/saml-schema-assertion-2.0.xsd.ts index 5000484753..7121427920 100644 --- a/packages/cli/src/sso/saml/schema/saml-schema-assertion-2.0.xsd.ts +++ b/packages/cli/src/sso/saml/schema/saml-schema-assertion-2.0.xsd.ts @@ -1,4 +1,8 @@ -export const xsdSamlSchemaAssertion20 = ` +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'saml-schema-assertion-2.0.xsd', + contents: ` -`; + `, +}; diff --git a/packages/cli/src/sso/saml/schema/saml-schema-metadata-2.0.xsd.ts b/packages/cli/src/sso/saml/schema/saml-schema-metadata-2.0.xsd.ts index 6ed44930af..677872c03d 100644 --- a/packages/cli/src/sso/saml/schema/saml-schema-metadata-2.0.xsd.ts +++ b/packages/cli/src/sso/saml/schema/saml-schema-metadata-2.0.xsd.ts @@ -1,4 +1,8 @@ -export const xsdSamlSchemaMetadata20 = ` +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'saml-schema-metadata-2.0.xsd', + contents: ` schemaLocation="saml-schema-assertion-2.0.xsd"/> + Document identifier: saml-schema-metadata-2.0 @@ -333,4 +339,5 @@ export const xsdSamlSchemaMetadata20 = ` -`; +`, +}; diff --git a/packages/cli/src/sso/saml/schema/saml-schema-protocol-2.0.xsd.ts b/packages/cli/src/sso/saml/schema/saml-schema-protocol-2.0.xsd.ts index e8bb9d0aae..ffc5a11640 100644 --- a/packages/cli/src/sso/saml/schema/saml-schema-protocol-2.0.xsd.ts +++ b/packages/cli/src/sso/saml/schema/saml-schema-protocol-2.0.xsd.ts @@ -1,4 +1,8 @@ -export const xsdSamlSchemaProtocol20 = ` +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'saml-schema-protocol-2.0.xsd', + contents: ` -`; +`, +}; diff --git a/packages/cli/src/sso/saml/schema/ws-addr.xsd.ts b/packages/cli/src/sso/saml/schema/ws-addr.xsd.ts new file mode 100644 index 0000000000..9a275a5dcc --- /dev/null +++ b/packages/cli/src/sso/saml/schema/ws-addr.xsd.ts @@ -0,0 +1,142 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'ws-addr.xsd', + contents: ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/ws-authorization.xsd.ts b/packages/cli/src/sso/saml/schema/ws-authorization.xsd.ts new file mode 100644 index 0000000000..e12fb570fa --- /dev/null +++ b/packages/cli/src/sso/saml/schema/ws-authorization.xsd.ts @@ -0,0 +1,150 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'ws-authorization.xsd', + contents: ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/ws-federation.xsd.ts b/packages/cli/src/sso/saml/schema/ws-federation.xsd.ts new file mode 100644 index 0000000000..5006c633ed --- /dev/null +++ b/packages/cli/src/sso/saml/schema/ws-federation.xsd.ts @@ -0,0 +1,475 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'ws-federation.xsd', + contents: ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/ws-securitypolicy-1.2.xsd.ts b/packages/cli/src/sso/saml/schema/ws-securitypolicy-1.2.xsd.ts new file mode 100644 index 0000000000..6beb4a7c86 --- /dev/null +++ b/packages/cli/src/sso/saml/schema/ws-securitypolicy-1.2.xsd.ts @@ -0,0 +1,1210 @@ +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'ws-securitypolicy-1.2.xsd', + contents: ` + + + + + + + + + + 4.1.1 SignedParts Assertion + + + + + + + 4.2.1 EncryptedParts Assertion + + + + + + + + + + + + + + + + + + + + + + + 4.1.2 SignedElements Assertion + + + + + + + 4.2.2 EncryptedElements Assertion + + + + + + + 4.3.1 RequiredElements Assertion + + + + + + + + + + + + + + + + + 5.1 Token Inclusion + + + + + + + + + + + + + + + + + + + + 5.4.1 UsernameToken Assertion + + + + + + + + + + + + + + + + + + + + 5.4.1 UsernameToken Assertion + + + + + + + 5.4.1 UsernameToken Assertion + + + + + + + 5.4.1 UsernameToken Assertion + + + + + + + 5.4.1 UsernameToken Assertion + + + + + + + + + + + + + + + 5.4.2 IssuedToken Assertion + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.4.2 IssuedToken Assertion + + + + + + + 5.4.2 IssuedToken Assertion + + + + + + + 5.4.2 IssuedToken Assertion + + + + + + + 5.4.2 IssuedToken Assertion + + + + + + + 5.4.2 IssuedToken Assertion + + + + + + + + 5.4.3 X509Token Assertion + + + + + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + 5.4.3 X509Token Assertion + + + + + + + + 5.4.4 KerberosToken Assertion + + + + + + + + + + + + 5.4.4 KerberosToken Assertion + + + + + + + 5.4.4 KerberosToken Assertion + + + + + + + + 5.4.5 SpnegoContextToken Assertion + + + + + + + + + + + + + + + + + + + + + + 5.4.5 SpnegoContextToken Assertion + + + + + + + 5.4.5 SpnegoContextToken Assertion + + + + + + + 5.4.5 SpnegoContextToken Assertion + + + + + + + + 5.4.6 SecurityContextToken Assertion + + + + + + + + + + + 5.4.6 SecurityContextToken Assertion + + + + + + + 5.4.6 SecurityContextToken Assertion + + + + + + + + 5.4.7 SecureConversationToken Assertion + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.4.7 SecureConversationToken Assertion + + + + + + + + 5.4.8 SamlToken Assertion + + + + + + + + + + + + 5.4.8 SamlToken Assertion + + + + + + + 5.4.8 SamlToken Assertion + + + + + + + 5.4.8 SamlToken Assertion + + + + + + + + 5.4.9 RelToken Assertion + + + + + + + + + + + + 5.4.9 RelToken Assertion + + + + + + + 5.4.9 RelToken Assertion + + + + + + + 5.4.9 RelToken Assertion + + + + + + + 5.4.9 RelToken Assertion + + + + + + + + 5.4.10 HttpsToken Assertion + + + + + + + 5.4.10 HttpsToken Assertion + + + + + + + 5.4.10 HttpsToken Assertion + + + + + + + 5.4.10 HttpsToken Assertion + + + + + + + + 5.4.11 KeyValueToken Assertion + + + + + + + + + + + + + + + 5.4.11 KeyValueToken Assertion + + + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + 7.1 AlgorithmSuite Assertion + + + + + + + + 7.2 Layout Assertion + + + + + + + + 7.2 Layout Assertion + + + + + + + 7.2 Layout Assertion + + + + + + + 7.2 Layout Assertion + + + + + + + 7.2 Layout Assertion + + + + + + + + 7.3 TransportBinding Assertion + + + + + + + + 7.3 TransportBinding Assertion + + + + + + + + + + 7.3 TransportBinding Assertion + + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + 8=7.4 SymmetricBinding Assertion + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + 7.4 SymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + 7.5 AsymmetricBinding Assertion + + + + + + + + + + + + + + + + 8.1 SupportingTokens Assertion + + + + + + + + + + + + + 8.2 SignedSupportingTokens Assertion + + + + + + + + + + + + + 8.3 EndorsingSupportingTokens Assertion + + + + + + + + + + + + + 8.4 SignedEndorsingSupportingTokens Assertion + + + + + + + + + + + + + 8.5 SignedEncryptedSupportingTokens Assertion + + + + + + + + + + + + + 8.6 EncryptedSupportingTokens Assertion + + + + + + + + + + + + + 8.7 EndorsingEncryptedSupportingTokens Assertion + + + + + + + + + + + + + 8.8 SignedEndorsingEncryptedSupportingTokens Assertion + + + + + + + + + + + + + + 9.1 Wss10 Assertion + + + + + + + + 9.1 Wss10 Assertion + + + + + + + 9.1 Wss10 Assertion + + + + + + + 9.1 Wss10 Assertion + + + + + + + 9.1 Wss10 Assertion + + + + + + + + 9.2 Wss11 Assertion + + + + + + + + + + + + 9.2 Wss11 Assertion + + + + + + + 9.2 Wss11 Assertion + + + + + + + 9.2 Wss11 Assertion + + + + + + + + + 10.1 Trust13 Assertion + + + + + + + + 10.1 Trust13 Assertion + + + + + + + 10.1 Trust13 Assertion + + + + + + + 10.1 Trust13 Assertion + + + + + + + 10.1 Trust13 Assertion + + + + + + + 10.1 Trust13 Assertion + + + + + + + 10.1 Trust13 Assertion + + + + + + + 10.1 Trust13 Assertion + + + + +`, +}; diff --git a/packages/cli/src/sso/saml/schema/xenc-schema.xsd.ts b/packages/cli/src/sso/saml/schema/xenc-schema.xsd.ts index de9d3ca34e..1630937858 100644 --- a/packages/cli/src/sso/saml/schema/xenc-schema.xsd.ts +++ b/packages/cli/src/sso/saml/schema/xenc-schema.xsd.ts @@ -1,4 +1,8 @@ -export const xsdXenc = ` +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'xenc-schema.xsd', + contents: ` -`; +`, +}; diff --git a/packages/cli/src/sso/saml/schema/xml.xsd.ts b/packages/cli/src/sso/saml/schema/xml.xsd.ts index 4487356ea5..d07b490c2e 100644 --- a/packages/cli/src/sso/saml/schema/xml.xsd.ts +++ b/packages/cli/src/sso/saml/schema/xml.xsd.ts @@ -1,4 +1,8 @@ -export const xsdXml = ` +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'xml.xsd', + contents: ` @@ -114,4 +118,5 @@ export const xsdXml = ` -`; +`, +}; diff --git a/packages/cli/src/sso/saml/schema/xmldsig-core-schema.xsd.ts b/packages/cli/src/sso/saml/schema/xmldsig-core-schema.xsd.ts index 9cd615b616..ea0014b889 100644 --- a/packages/cli/src/sso/saml/schema/xmldsig-core-schema.xsd.ts +++ b/packages/cli/src/sso/saml/schema/xmldsig-core-schema.xsd.ts @@ -1,4 +1,8 @@ -export const xsdXmldsigCore = ` +import type { XMLFileInfo } from 'xmllint-wasm'; + +export const xmlFileInfo: XMLFileInfo = { + fileName: 'xmldsig-core-schema.xsd', + contents: ` -`; +`, +};