Skip to content

Commit

Permalink
Rename tag CUSTOM to Custom.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Dec 17, 2024
1 parent 8960263 commit 691edd7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType;

import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_CUSTOM;

/**
* The user defined federated authenticator configuration model.
*/
public class UserDefinedFederatedAuthenticatorConfig extends FederatedAuthenticatorConfig {

private static final String TAG_CUSTOM = "CUSTOM";

private UserDefinedAuthenticatorEndpointConfig endpointConfig;

public UserDefinedFederatedAuthenticatorConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.AuthenticationType;
import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType;

import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_2FA;
import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_CUSTOM;

/**
* The user defined local authenticator configuration model.
*/
public class UserDefinedLocalAuthenticatorConfig extends LocalAuthenticatorConfig {

private static final String TAG_2FA = "2FA";
private static final String TAG_CUSTOM = "CUSTOM";
private AuthenticationType authenticationType;
private UserDefinedAuthenticatorEndpointConfig endpointConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.util.HashMap;

import static org.testng.Assert.assertEquals;
import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_2FA;
import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_CUSTOM;

public class UserDefinedAuthenticatorTest {

Expand All @@ -39,7 +41,7 @@ public void createUserDefinedLocalVerificationAuthenticator() {

UserDefinedLocalAuthenticatorConfig config =
new UserDefinedLocalAuthenticatorConfig(AuthenticatorPropertyConstants.AuthenticationType.VERIFICATION);
assertEquals(config.getTags(), new String[]{"CUSTOM", "2FA"});
assertEquals(config.getTags(), new String[]{TAG_CUSTOM, TAG_2FA});
assertEquals(config.getDefinedByType(), AuthenticatorPropertyConstants.DefinedByType.USER);
}

Expand All @@ -49,15 +51,15 @@ public void createUserDefinedLocalIdentificationAuthenticator() {
UserDefinedLocalAuthenticatorConfig config =
new UserDefinedLocalAuthenticatorConfig(
AuthenticatorPropertyConstants.AuthenticationType.IDENTIFICATION);
assertEquals(config.getTags(), new String[]{"CUSTOM"});
assertEquals(config.getTags(), new String[]{TAG_CUSTOM});
assertEquals(config.getDefinedByType(), AuthenticatorPropertyConstants.DefinedByType.USER);
}

@Test
public void createUserDefinedFederatedAuthenticator() {

UserDefinedFederatedAuthenticatorConfig config = new UserDefinedFederatedAuthenticatorConfig();
assertEquals(config.getTags(), new String[]{"CUSTOM"});
assertEquals(config.getTags(), new String[]{TAG_CUSTOM});
assertEquals(config.getDefinedByType(), AuthenticatorPropertyConstants.DefinedByType.USER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

public class AuthenticatorPropertyConstants {

public static final String TAG_2FA = "2FA";
public static final String TAG_CUSTOM = "Custom";

/**
* The Defined by Types - SYSTEM: system define authenticator, USER: user defined authentication extension.
*/
Expand Down

0 comments on commit 691edd7

Please sign in to comment.