Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename tag CUSTOM to Custom. #6216

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading