Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 2s
131 lines
4.8 KiB
TypeScript
131 lines
4.8 KiB
TypeScript
import {
|
|
defaultAuthnContextTemplate,
|
|
defaultAuthRequestTemplate,
|
|
defaultLogoutResponseTemplate,
|
|
defaultLogoutRequestTemplate,
|
|
defaultNameIDTemplate,
|
|
defaultIdentifierFormat,
|
|
defaultAuthnContext,
|
|
defaultMetadataTemplate,
|
|
defaultMetadataCertificateTemplate,
|
|
} from '../../../server/lib/saml/lib/constants';
|
|
import { settingsRegistry } from '../../../server/settings';
|
|
|
|
export const addSettings = async function (name: string): Promise<void> {
|
|
await settingsRegistry.addGroup('SAML', async function () {
|
|
await this.with(
|
|
{
|
|
tab: 'SAML_Enterprise',
|
|
enterprise: true,
|
|
modules: ['saml-enterprise'],
|
|
},
|
|
async function () {
|
|
await this.section('SAML_Section_4_Roles', async function () {
|
|
// Roles Settings
|
|
await this.add(`SAML_Custom_${name}_role_attribute_sync`, false, {
|
|
type: 'boolean',
|
|
i18nLabel: 'SAML_Role_Attribute_Sync',
|
|
i18nDescription: 'SAML_Role_Attribute_Sync_Description',
|
|
invalidValue: false,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_role_attribute_name`, '', {
|
|
type: 'string',
|
|
i18nLabel: 'SAML_Role_Attribute_Name',
|
|
i18nDescription: 'SAML_Role_Attribute_Name_Description',
|
|
invalidValue: '',
|
|
});
|
|
});
|
|
|
|
await this.section('SAML_Section_6_Advanced', async function () {
|
|
await this.add(`SAML_Custom_${name}_identifier_format`, defaultIdentifierFormat, {
|
|
type: 'string',
|
|
invalidValue: defaultIdentifierFormat,
|
|
i18nLabel: 'SAML_Identifier_Format',
|
|
i18nDescription: 'SAML_Identifier_Format_Description',
|
|
});
|
|
await this.add(`SAML_Custom_${name}_NameId_template`, defaultNameIDTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultNameIDTemplate,
|
|
i18nLabel: 'SAML_NameIdPolicy_Template',
|
|
i18nDescription: 'SAML_NameIdPolicy_Template_Description',
|
|
multiline: true,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_custom_authn_context`, defaultAuthnContext, {
|
|
type: 'string',
|
|
invalidValue: defaultAuthnContext,
|
|
i18nLabel: 'SAML_Custom_Authn_Context',
|
|
i18nDescription: 'SAML_Custom_Authn_Context_description',
|
|
});
|
|
await this.add(`SAML_Custom_${name}_authn_context_comparison`, 'exact', {
|
|
type: 'select',
|
|
values: [
|
|
{ key: 'better', i18nLabel: 'Better' },
|
|
{ key: 'exact', i18nLabel: 'Exact' },
|
|
{ key: 'maximum', i18nLabel: 'Maximum' },
|
|
{ key: 'minimum', i18nLabel: 'Minimum' },
|
|
],
|
|
invalidValue: 'exact',
|
|
i18nLabel: 'SAML_Custom_Authn_Context_Comparison',
|
|
});
|
|
await this.add(`SAML_Custom_${name}_AuthnContext_template`, defaultAuthnContextTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultAuthnContextTemplate,
|
|
i18nLabel: 'SAML_AuthnContext_Template',
|
|
i18nDescription: 'SAML_AuthnContext_Template_Description',
|
|
multiline: true,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_AuthRequest_template`, defaultAuthRequestTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultAuthRequestTemplate,
|
|
i18nLabel: 'SAML_AuthnRequest_Template',
|
|
i18nDescription: 'SAML_AuthnRequest_Template_Description',
|
|
multiline: true,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_LogoutResponse_template`, defaultLogoutResponseTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultLogoutResponseTemplate,
|
|
i18nLabel: 'SAML_LogoutResponse_Template',
|
|
i18nDescription: 'SAML_LogoutResponse_Template_Description',
|
|
multiline: true,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_LogoutRequest_template`, defaultLogoutRequestTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultLogoutRequestTemplate,
|
|
i18nLabel: 'SAML_LogoutRequest_Template',
|
|
i18nDescription: 'SAML_LogoutRequest_Template_Description',
|
|
multiline: true,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_MetadataCertificate_template`, defaultMetadataCertificateTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultMetadataCertificateTemplate,
|
|
i18nLabel: 'SAML_MetadataCertificate_Template',
|
|
i18nDescription: 'SAML_Metadata_Certificate_Template_Description',
|
|
multiline: true,
|
|
});
|
|
await this.add(`SAML_Custom_${name}_Metadata_template`, defaultMetadataTemplate, {
|
|
type: 'string',
|
|
invalidValue: defaultMetadataTemplate,
|
|
i18nLabel: 'SAML_Metadata_Template',
|
|
i18nDescription: 'SAML_Metadata_Template_Description',
|
|
multiline: true,
|
|
});
|
|
});
|
|
await this.section('SAML_Section_5_Mapping', async function () {
|
|
// Data Mapping Settings
|
|
await this.add(
|
|
`SAML_Custom_${name}_user_data_custom_fieldmap`,
|
|
'{"custom1":"custom1", "custom2":"custom2", "custom3":"custom3"}',
|
|
{
|
|
type: 'string',
|
|
invalidValue: '',
|
|
i18nLabel: 'SAML_Custom_user_data_custom_fieldmap',
|
|
i18nDescription: 'SAML_Custom_user_data_custom_fieldmap_description',
|
|
multiline: true,
|
|
},
|
|
);
|
|
});
|
|
},
|
|
);
|
|
});
|
|
};
|