Remove TrustedHostClientRegistrationPolicyTest#testGithubDomain
Closes #29271 Signed-off-by: rmartinc <rmartinc@redhat.com>
This commit is contained in:
parent
dbd4079f92
commit
5db3772d45
1 changed files with 0 additions and 16 deletions
|
@ -16,8 +16,6 @@
|
||||||
*/
|
*/
|
||||||
package org.keycloak.services.clientregistration.policy.impl;
|
package org.keycloak.services.clientregistration.policy.impl;
|
||||||
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -101,20 +99,6 @@ public class TrustedHostClientRegistrationPolicyTest {
|
||||||
policy.getTrustedHosts(), policy.getTrustedDomains()));
|
policy.getTrustedHosts(), policy.getTrustedDomains()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGithubDomain() throws UnknownHostException {
|
|
||||||
TrustedHostClientRegistrationPolicyFactory factory = new TrustedHostClientRegistrationPolicyFactory();
|
|
||||||
ComponentModel model = createComponentModel("*.github.com");
|
|
||||||
TrustedHostClientRegistrationPolicy policy = (TrustedHostClientRegistrationPolicy) factory.create(session, model);
|
|
||||||
|
|
||||||
policy.verifyHost(InetAddress.getByName("www.github.com").getHostAddress());
|
|
||||||
policy.verifyHost(InetAddress.getByName("github.com").getHostAddress());
|
|
||||||
policy.checkURLTrusted("https://www.github.com", policy.getTrustedHosts(), policy.getTrustedDomains());
|
|
||||||
policy.checkURLTrusted("https://github.com", policy.getTrustedHosts(), policy.getTrustedDomains());
|
|
||||||
Assert.assertThrows(ClientRegistrationPolicyException.class, () -> policy.checkURLTrusted("https://othergithub.com",
|
|
||||||
policy.getTrustedHosts(), policy.getTrustedDomains()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private ComponentModel createComponentModel(String... hosts) {
|
private ComponentModel createComponentModel(String... hosts) {
|
||||||
ComponentModel model = new ComponentModel();
|
ComponentModel model = new ComponentModel();
|
||||||
model.put(TrustedHostClientRegistrationPolicyFactory.HOST_SENDING_REGISTRATION_REQUEST_MUST_MATCH, "true");
|
model.put(TrustedHostClientRegistrationPolicyFactory.HOST_SENDING_REGISTRATION_REQUEST_MUST_MATCH, "true");
|
||||||
|
|
Loading…
Reference in a new issue