aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts
diff options
context:
space:
mode:
authorguillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com>2023-08-30 18:07:04 +0200
committersonartech <sonartech@sonarsource.com>2023-08-31 20:02:57 +0000
commit6b1a8f86a739be06752d99ad35e925d5f66b2ccc (patch)
tree7fbc8cff3f07967e7f8e9cc2efc72d5e6c4b2613 /server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts
parentc49d282950cbccbbdd39ba8bc92dbf3370efbbee (diff)
downloadsonarqube-6b1a8f86a739be06752d99ad35e925d5f66b2ccc.tar.gz
sonarqube-6b1a8f86a739be06752d99ad35e925d5f66b2ccc.zip
SONAR-20309 Do not sync GH permissions when admins did not explicitly consent to it
Diffstat (limited to 'server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts')
-rw-r--r--server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts
index 41ff5481689..2505f1661a0 100644
--- a/server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts
+++ b/server/sonar-web/src/main/js/api/mocks/SettingsServiceMock.ts
@@ -177,7 +177,11 @@ export default class SettingsServiceMock {
const definition = this.#definitions.find(
(d) => d.key === data.keys
) as ExtendedSettingDefinition;
- if (definition.type === SettingType.PROPERTY_SET) {
+ if (data.keys === 'sonar.auth.github.userConsentForPermissionProvisioningRequired') {
+ this.#settingValues = this.#settingValues.filter(
+ (s) => s.key !== 'sonar.auth.github.userConsentForPermissionProvisioningRequired'
+ );
+ } else if (definition.type === SettingType.PROPERTY_SET) {
setting.fieldValues = [];
} else if (definition.multiValues === true) {
setting.values = definition.defaultValue?.split(',') ?? [];
@@ -230,6 +234,16 @@ export default class SettingsServiceMock {
this.#secretKeyAvailable = val;
};
+ presetGithubAutoProvisioning = () => {
+ this.set('sonar.auth.github.enabled', 'true');
+ this.set('sonar.auth.github.clientId.secured', 'client ID');
+ this.set('sonar.auth.github.clientSecret.secured', 'shut');
+ this.set('sonar.auth.github.appId', 'Appid');
+ this.set('sonar.auth.github.privateKey.secured', 'private key');
+ this.set('sonar.auth.github.apiUrl', 'API url');
+ this.set('sonar.auth.github.webUrl', 'web URL');
+ };
+
reset = () => {
this.#settingValues = cloneDeep(this.#defaultValues);
this.#definitions = cloneDeep(DEFAULT_DEFINITIONS_MOCK);