Browse Source

SONAR-20923 Unclear message in case GitHub OAuth App is used for Authentication

tags/10.3.0.82913
guillaume-peoch-sonarsource 7 months ago
parent
commit
ee6605024d

+ 2
- 2
server/sonar-web/src/main/js/apps/settings/components/authentication/GithubAuthenticationTab.tsx View File

@@ -124,7 +124,7 @@ export default function GithubAuthenticationTab(props: GithubAuthenticationProps
</div>
)}
</div>
{enabled && (
{enabled && !hasLegacyConfiguration && (
<GitHubConfigurationValidity
selectedOrganizations={
(values['sonar.auth.github.organizations']?.value as string[]) ?? []
@@ -146,7 +146,7 @@ export default function GithubAuthenticationTab(props: GithubAuthenticationProps
values={{
documentation: (
<DocLink to="/instance-administration/authentication/github">
{translate('documentation')}
{translate('settings.authentication.github.form.legacy_configured.link')}
</DocLink>
),
}}

+ 6
- 2
server/sonar-web/src/main/js/apps/settings/components/authentication/__tests__/Authentication-it.tsx View File

@@ -134,6 +134,8 @@ const ui = {
noGithubConfiguration: byText('settings.authentication.github.form.not_configured'),
createConfigButton: byRole('button', { name: 'settings.authentication.form.create' }),
clientId: byRole('textbox', { name: 'property.sonar.auth.github.clientId.secured.name' }),
appId: byRole('textbox', { name: 'property.sonar.auth.github.appId.name' }),
privateKey: byRole('textbox', { name: 'property.sonar.auth.github.privateKey.secured.name' }),
clientSecret: byRole('textbox', {
name: 'property.sonar.auth.github.clientSecret.secured.name',
}),
@@ -235,6 +237,8 @@ const ui = {
await act(async () => {
await user.type(await github.clientId.find(), 'Awsome GITHUB config');
await user.type(github.clientSecret.get(), 'Client shut');
await user.type(github.appId.get(), 'App id');
await user.type(github.privateKey.get(), 'Private Key');
await user.type(github.githubApiUrl.get(), 'API Url');
await user.type(github.githubWebUrl.get(), 'WEb Url');
await user.type(github.organizations.get(), 'organization1');
@@ -356,7 +360,7 @@ describe('SAML tab', () => {
await user.click(saml.scimProvisioningButton.get());
expect(saml.saveScim.get()).toBeEnabled();
await user.click(saml.saveScim.get());
await user.click(saml.confirmProvisioningButton.get());
await act(() => user.click(saml.confirmProvisioningButton.get()));

expect(await saml.scimProvisioningButton.find()).toBeChecked();
expect(await saml.saveScim.find()).toBeDisabled();
@@ -480,7 +484,7 @@ describe('Github tab', () => {

expect(github.saveGithubProvisioning.get()).toBeEnabled();
await user.click(github.saveGithubProvisioning.get());
await user.click(github.confirmProvisioningButton.get());
await act(() => user.click(github.confirmProvisioningButton.get()));

expect(await github.githubProvisioningButton.find()).toBeChecked();
expect(github.disableConfigButton.get()).toBeDisabled();

+ 21
- 0
server/sonar-web/src/main/js/helpers/mocks/definitions-list.ts View File

@@ -147,6 +147,27 @@ export const definitions: ExtendedSettingDefinition[] = [
options: [],
fields: [],
},
{
key: 'sonar.auth.github.appId',
name: 'App ID',
description:
'The App ID is found on your GitHub App\u0027s page on GitHub at Settings \u003e Developer Settings \u003e GitHub Apps.',
category: 'authentication',
subCategory: 'github',
options: [],
fields: [],
},
{
key: 'sonar.auth.github.privateKey.secured',
name: 'Private Key',
description:
'Your GitHub App\u0027s private key. You can generate a .pem file from your GitHub App\u0027s page under Private keys.\nCopy and paste the whole contents of the file here.',
type: SettingType.TEXT,
category: 'authentication',
subCategory: 'github',
options: [],
fields: [],
},
{
key: 'sonar.auth.github.clientSecret.secured',
name: 'Client Secret',

+ 2
- 1
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

@@ -1511,7 +1511,8 @@ settings.authentication.github.confirm_auto_provisioning.switch_jit=Just-in-Time
settings.authentication.github.provisioning_change.confirm_changes=Confirm Changes
settings.authentication.github.configuration=GitHub Configuration
settings.authentication.github.form.not_configured=GitHub App is not configured
settings.authentication.github.form.legacy_configured=Compatibility with GitHub OAuth App is deprecated and will be removed in a future release. Your configuration will continue to work but with limited support. We recommend using GitHub Apps. Check out the {documentation} for more information.
settings.authentication.github.form.legacy_configured=Compatibility with GitHub OAuth Apps is deprecated and will be removed in a future release. As such, your current configuration will continue to work but some features will no longer be available. We recommend that you create a new GitHub App configuration. This will automatically replace your current GitHub OAuth App configuration. {documentation}
settings.authentication.github.form.legacy_configured.link=Learn more about how to create a GitHub App configuration
settings.authentication.github.enable_first=Enable your GitHub configuration for more provisioning options.
settings.authentication.github.form.provisioning_with_github=Automatic user, group, and permission provisioning
settings.authentication.github.form.provisioning_with_github_short.autoProvisioning=Automatic provisioning

Loading…
Cancel
Save