Files
upstream-mirror 30810eecd7
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
snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:21:02 +05:00

155 lines
4.9 KiB
TypeScript

import bannersConfigSchema from '@rocket.chat/abac/docs/classification-banners.schema.json';
import { settingsRegistry } from '../../../server/settings';
const abacEnabledQuery = { _id: 'ABAC_Enabled', value: true };
const virtruPdpQuery = [abacEnabledQuery, { _id: 'ABAC_PDP_Type', value: 'virtru' }];
export function addSettings(): Promise<void> {
return settingsRegistry.addGroup('General', async function () {
await this.with(
{
enterprise: true,
modules: ['abac'],
},
async function () {
await this.add('ABAC_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
section: 'ABAC',
i18nDescription: 'ABAC_Enabled_Description',
});
await this.add('ABAC_PDP_Type', 'local', {
type: 'select',
public: true,
section: 'ABAC',
invalidValue: 'local',
values: [
{ key: 'local', i18nLabel: 'ABAC_PDP_Type_Local' },
{ key: 'virtru', i18nLabel: 'ABAC_PDP_Type_Virtru' },
],
alert: 'ABAC_PDP_Type_Switch_Alert',
enableQuery: abacEnabledQuery,
});
await this.add('ABAC_Attribute_Store', 'local', {
type: 'select',
public: true,
section: 'ABAC_Virtru_PDP_Configuration',
invalidValue: 'local',
values: [
{ key: 'local', i18nLabel: 'ABAC_Attribute_Store_Local' },
{ key: 'virtru', i18nLabel: 'ABAC_Attribute_Store_Virtru' },
],
i18nDescription: 'ABAC_Attribute_Store_Description',
alert: 'ABAC_Attribute_Store_Switch_Alert',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_ShowAttributesInRooms', false, {
type: 'boolean',
public: true,
invalidValue: false,
section: 'ABAC',
enableQuery: abacEnabledQuery,
});
await this.add('ABAC_Classification_Banners_Enabled', false, {
type: 'boolean',
public: true,
invalidValue: false,
section: 'ABAC_Classification_Banners',
enableQuery: abacEnabledQuery,
i18nDescription: 'ABAC_Classification_Banners_Enabled_Description',
});
await this.add('ABAC_Classification_Banners_Config', '', {
type: 'code',
code: 'application/json',
multiline: true,
public: true,
invalidValue: '',
section: 'ABAC_Classification_Banners',
enableQuery: [abacEnabledQuery, { _id: 'ABAC_Classification_Banners_Enabled', value: true }],
i18nDescription: 'ABAC_Classification_Banners_Config_Description',
schema: bannersConfigSchema,
});
await this.add('Abac_Cache_Decision_Time_Seconds', 300, {
type: 'int',
public: true,
section: 'ABAC',
invalidValue: 0,
enableQuery: abacEnabledQuery,
});
// Virtru PDP Configuration
await this.add('ABAC_Virtru_Base_URL', '', {
type: 'string',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Client_ID', '', {
type: 'string',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Client_Secret', '', {
type: 'password',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_OIDC_Endpoint', '', {
type: 'string',
public: false,
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_OIDC_Endpoint_Description',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Default_Entity_Key', 'emailAddress', {
type: 'select',
public: false,
invalidValue: 'emailAddress',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_Default_Entity_Key_Description',
values: [
{ key: 'emailAddress', i18nLabel: 'ABAC_Virtru_Entity_Key_Email' },
{ key: 'oidcIdentifier', i18nLabel: 'ABAC_Virtru_Entity_Key_OIDC' },
],
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Attribute_Namespace', 'example.com', {
type: 'string',
public: false,
invalidValue: 'example.com',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_Attribute_Namespace_Description',
enableQuery: virtruPdpQuery,
});
await this.add('ABAC_Virtru_Sync_Interval', '*/5 * * * *', {
type: 'string',
public: false,
invalidValue: '*/5 * * * *',
section: 'ABAC_Virtru_PDP_Configuration',
i18nDescription: 'ABAC_Virtru_Sync_Interval_Description',
enableQuery: virtruPdpQuery,
});
await this.add(
'ABAC_Virtru_Test_Connection',
{ method: 'GET', path: '/v1/abac/pdp/health' },
{
type: 'action',
actionText: 'ABAC_Virtru_Test_Connection_Action',
invalidValue: '',
section: 'ABAC_Virtru_PDP_Configuration',
enableQuery: virtruPdpQuery,
},
);
},
);
});
}