use of hudson.security.SecurityRealm in project configuration-as-code-plugin by jenkinsci.
the class GithubOAuthTest method testSampleVersionForOAuth.
@Test
@ConfiguredWithCode("GithubOAuth.yml")
public void testSampleVersionForOAuth() {
SecurityRealm realm = Jenkins.getInstance().getSecurityRealm();
assertThat(realm, instanceOf(GithubSecurityRealm.class));
GithubSecurityRealm gsh = (GithubSecurityRealm) realm;
assertEquals("someId", gsh.getClientID());
assertEquals("https://api.github.com", gsh.getGithubApiUri());
assertEquals("https://github.com", gsh.getGithubWebUri());
assertEquals("j985j8fhfhh377", gsh.getClientSecret().getPlainText());
assertEquals("read:org,user:email", gsh.getOauthScopes());
}
use of hudson.security.SecurityRealm in project configuration-as-code-plugin by jenkinsci.
the class Crowd2Test method configure_artifact_manager.
@Test
@ConfiguredWithReadme("crowd2/README.md")
public void configure_artifact_manager() {
SecurityRealm realm = Jenkins.get().getSecurityRealm();
assertThat(realm, instanceOf(CrowdSecurityRealm.class));
CrowdSecurityRealm securityRealm = (CrowdSecurityRealm) realm;
assertThat(securityRealm.applicationName, is("jenkins"));
assertThat(securityRealm.group, is("jenkins-users"));
assertThat(securityRealm.url, is("http://crowd.company.io"));
assertThat(securityRealm.password, hasPlainText(PASSWORD_123));
}
use of hudson.security.SecurityRealm in project configuration-as-code-plugin by jenkinsci.
the class GithubOAuthTest method testSampleVersionForOAuth.
@Test
@ConfiguredWithReadme("github-oauth/README.md")
public void testSampleVersionForOAuth() {
SecurityRealm realm = Jenkins.get().getSecurityRealm();
assertThat(realm, instanceOf(GithubSecurityRealm.class));
GithubSecurityRealm gsh = (GithubSecurityRealm) realm;
assertEquals("someId", gsh.getClientID());
assertEquals("https://api.github.com", gsh.getGithubApiUri());
assertEquals("https://github.com", gsh.getGithubWebUri());
assertEquals("j985j8fhfhh377", gsh.getClientSecret().getPlainText());
assertEquals("read:org,user:email", gsh.getOauthScopes());
}
use of hudson.security.SecurityRealm in project configuration-as-code-plugin by jenkinsci.
the class KeycloakTest method configure_artifact_manager.
@Test
@ConfiguredWithReadme("keycloak/README.md")
public void configure_artifact_manager() {
SecurityRealm realm = j.jenkins.get().getSecurityRealm();
assertThat(realm, instanceOf(KeycloakSecurityRealm.class));
KeycloakSecurityRealm securityRealm = (KeycloakSecurityRealm) realm;
assertThat(securityRealm.getKeycloakJson(), containsString("\"auth-server-url\": \"https://my-keycloak-url/auth\""));
}
Aggregations