Remove plugin center login without url (#1978)

This removes the "login" button for the plugin center, when the authentication url is not set.
This commit is contained in:
René Pfeuffer
2022-03-21 08:21:36 +01:00
committed by GitHub
parent 9ec38a858d
commit 4bba593714
7 changed files with 37 additions and 15 deletions

View File

@@ -147,6 +147,16 @@ class PluginCenterAuthResourceTest {
assertThat(root.get("_links").get("login").get("href").asText()).isEqualTo("/v2/plugins/auth/login");
}
@Test
@SubjectAware(value = "marvin", permissions = "plugin:write")
void shouldNotReturnLoginLinkIfPermittedButNotConfigured() throws URISyntaxException, IOException {
scmConfiguration.setPluginAuthUrl(null);
JsonNode root = getJson("/v2/plugins/auth");
assertThat(root.get("_links").get("login")).isNull();
}
@Test
@SubjectAware(value = "marvin", permissions = "plugin:write")
void shouldReturnReconnectAndLogoutLinkForFailedAuthentication() throws URISyntaxException, IOException {