Skip to content

Commit 647fbcb

Browse files
committed
Minor changes
1 parent 2ef15c4 commit 647fbcb

File tree

8 files changed

+18
-55
lines changed

8 files changed

+18
-55
lines changed

components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/ApplicationAuthenticatorService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ private UserDefinedLocalAuthenticatorConfig resolveExistingAuthenticator(String
430430
}
431431

432432
private LocalAuthenticatorConfig resolveExistingSystemLocalAuthenticator(String authenticatorName,
433-
String tenantDomain) throws AuthenticatorMgtException{
433+
String tenantDomain) throws AuthenticatorMgtException {
434+
434435
return dao.getSystemLocalAuthenticator(authenticatorName, IdentityTenantUtil.getTenantId(tenantDomain));
435436
}
436437

components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/constant/AuthenticatorMgtSQLConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static class Column {
4747
public static final String IS_SECRET = "IS_SECRET";
4848
public static final String IMAGE_URL = "IMAGE_URL";
4949
public static final String DESCRIPTION = "DESCRIPTION";
50-
public static final String AMR_VALUE = "AMR_VALUE";
50+
public static final String AMR_VALUE = "AMR_VALUE";
5151

5252
private Column() {
5353

components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/dao/impl/AuthenticatorManagementDAOImpl.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ public UserDefinedLocalAuthenticatorConfig getUserDefinedLocalAuthenticator(
177177
@Override
178178
public LocalAuthenticatorConfig getSystemLocalAuthenticator(String authenticatorConfigName, int tenantId)
179179
throws AuthenticatorMgtException {
180-
try{
180+
181+
try {
181182
return getSystemLocalAuthenticatorByName(authenticatorConfigName, tenantId);
182183
} catch (TransactionException e) {
183184
throw buildServerException(AuthenticatorMgtError.ERROR_WHILE_RETRIEVING_AUTHENTICATOR_BY_NAME, e);
184-
185185
}
186186
}
187187

@@ -263,7 +263,9 @@ public boolean isExistingAuthenticatorName(String authenticatorName, int tenantI
263263
}
264264

265265
@Override
266-
public LocalAuthenticatorConfig addSystemLocalAuthenticator(LocalAuthenticatorConfig authenticatorConfig, int tenantId) throws AuthenticatorMgtServerException {
266+
public LocalAuthenticatorConfig addSystemLocalAuthenticator
267+
(LocalAuthenticatorConfig authenticatorConfig, int tenantId) throws AuthenticatorMgtServerException {
268+
267269
NamedJdbcTemplate jdbcTemplate = new NamedJdbcTemplate(IdentityDatabaseUtil.getDataSource());
268270
try {
269271
jdbcTemplate.withTransaction(template ->
@@ -287,7 +289,9 @@ public LocalAuthenticatorConfig addSystemLocalAuthenticator(LocalAuthenticatorCo
287289
}
288290

289291
@Override
290-
public boolean isExistingAuthenticatorNameDB(String authenticatorName, int tenantId) throws AuthenticatorMgtException {
292+
public boolean isExistingAuthenticatorNameDB(String authenticatorName, int tenantId)
293+
throws AuthenticatorMgtException {
294+
291295
NamedJdbcTemplate jdbcTemplate = new NamedJdbcTemplate(IdentityDatabaseUtil.getDataSource());
292296
try {
293297
ResultSet results = jdbcTemplate.withTransaction(template ->
@@ -422,13 +426,13 @@ public UserDefinedLocalAuthenticatorConfig getConfig() {
422426
}
423427
}
424428

425-
private static class LocalAuthenticatorConfigDaoModel{
429+
private static class LocalAuthenticatorConfigDaoModel {
426430

427431
private final int entryId;
428432
private final LocalAuthenticatorConfig config;
429433

430434

431-
private LocalAuthenticatorConfigDaoModel(int entryId, LocalAuthenticatorConfig config){
435+
private LocalAuthenticatorConfigDaoModel(int entryId, LocalAuthenticatorConfig config) {
432436
this.entryId = entryId;
433437
this.config = config;
434438
}

components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/dao/impl/AuthenticatorManagementFacade.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public UserDefinedLocalAuthenticatorConfig updateUserDefinedLocalAuthenticator(U
124124
public LocalAuthenticatorConfig updateSystemLocalAuthenticatorAmrValue(
125125
LocalAuthenticatorConfig existingAuthenticatorConfig, LocalAuthenticatorConfig updatedConfig, int tenantId)
126126
throws AuthenticatorMgtException {
127+
127128
NamedJdbcTemplate jdbcTemplate = new NamedJdbcTemplate(IdentityDatabaseUtil.getDataSource());
128129
try {
129130
return jdbcTemplate.withTransaction(template -> dao.updateSystemLocalAuthenticatorAmrValue(
@@ -161,6 +162,7 @@ public UserDefinedLocalAuthenticatorConfig getUserDefinedLocalAuthenticator(
161162
@Override
162163
public LocalAuthenticatorConfig getSystemLocalAuthenticator(String authenticatorConfigName, int tenantId)
163164
throws AuthenticatorMgtException {
165+
164166
NamedJdbcTemplate jdbcTemplate = new NamedJdbcTemplate(IdentityDatabaseUtil.getDataSource());
165167
try {
166168
return jdbcTemplate.withTransaction(template -> dao.getSystemLocalAuthenticator(authenticatorConfigName,
@@ -252,7 +254,9 @@ public LocalAuthenticatorConfig addSystemLocalAuthenticator(LocalAuthenticatorCo
252254
}
253255

254256
@Override
255-
public boolean isExistingAuthenticatorNameDB(String authenticatorName, int tenantId) throws AuthenticatorMgtException {
257+
public boolean isExistingAuthenticatorNameDB(String authenticatorName, int tenantId)
258+
throws AuthenticatorMgtException {
259+
256260
NamedJdbcTemplate jdbcTemplate = new NamedJdbcTemplate(IdentityDatabaseUtil.getDataSource());
257261
try {
258262
return jdbcTemplate.withTransaction(

components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/internal/ApplicationManagementServiceComponent.java

-20
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,6 @@ protected void activate(ComponentContext context) {
170170
// Register the Authorized API Management Listener.
171171
bundleContext.registerService(AuthorizedAPIManagementListener.class, new ConsoleAuthorizedAPIListener(),
172172
null);
173-
174-
List<LocalAuthenticatorConfig> authenticator =
175-
new ArrayList<>(ApplicationAuthenticatorService.getInstance().getAllSystemDefinedLocalAuthenticators());
176-
ApplicationDAOImpl dao = new ApplicationDAOImpl();
177-
178-
// Connection conn = IdentityDatabaseUtil.getDBConnection(true);
179-
// String isEnabled = fileBasedConfig.isEnabled() ? "1" : "0";
180-
// String amrValue = dao.getAmrValue(conn, authenticator.);
181-
//
182-
//
183-
// if(amrValue == null){
184-
// dao.insertAuthenticator(conn, authenticator.getName(),
185-
// authenticator.getFriendlyName(),
186-
// isEnabled,
187-
// fileBasedConfig.getAmrValue());
188-
// }
189-
// else if(amrValue.isEmpty()){
190-
// dao.updateAmrValue(conn, authenticator.getName(), fileBasedConfig.getAmrValue());
191-
// }
192-
193173
if (log.isDebugEnabled()) {
194174
log.debug("Identity ApplicationManagementComponent bundle is activated");
195175
}

components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/config/model/OptimizedAuthenticatorConfig.java

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public class OptimizedAuthenticatorConfig implements Serializable {
5454
private final String tenantDomain;
5555
private final String amrValue;
5656

57-
5857
private static final Log LOG = LogFactory.getLog(OptimizedAuthenticatorConfig.class);
5958

6059
public OptimizedAuthenticatorConfig(AuthenticatorConfig authenticatorConfig) {

components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/config/model/OptimizedStepConfig.java

-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public class OptimizedStepConfig implements Serializable {
4141
private final boolean subjectIdentifierStep;
4242
private final boolean subjectAttributeStep;
4343
private final String authenticatedIdP;
44-
// private final String amrValue;
4544
private final String authenticatedAuthenticatorName;
4645
private final List<OptimizedAuthenticatorConfig> optimizedAuthenticatorList;
4746
private final List<String> authenticatorMappings;
@@ -63,7 +62,6 @@ public OptimizedStepConfig(StepConfig stepConfig) {
6362
this.subjectIdentifierStep = stepConfig.isSubjectIdentifierStep();
6463
this.subjectAttributeStep = stepConfig.isSubjectAttributeStep();
6564
this.authenticatedIdP = stepConfig.getAuthenticatedIdP();
66-
// this.amrValue = stepConfig.getAmrValues(); //check
6765
this.authenticatedAuthenticatorName = stepConfig.getAuthenticatedAutenticator() != null ?
6866
stepConfig.getAuthenticatedAutenticator().getName() : null;
6967
this.optimizedAuthenticatorList = getOptimizedAuthenticatorList(stepConfig.getAuthenticatorList());
@@ -101,7 +99,6 @@ public StepConfig getStepConfig() throws SessionDataStorageOptimizationException
10199
stepConfig.setSubjectIdentifierStep(this.subjectIdentifierStep);
102100
stepConfig.setSubjectAttributeStep(this.subjectAttributeStep);
103101
stepConfig.setAuthenticatedIdP(this.authenticatedIdP);
104-
// stepConfig.setAmrValues(this.amrValue);
105102
List<AuthenticatorConfig> authenticatorList = new ArrayList<>();
106103
for (OptimizedAuthenticatorConfig optimizedAuthenticatorConfig : this.optimizedAuthenticatorList) {
107104
AuthenticatorConfig authConfig = optimizedAuthenticatorConfig.getAuthenticatorConfig();

components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/step/impl/DefaultStepHandler.java

-22
Original file line numberDiff line numberDiff line change
@@ -1496,11 +1496,6 @@ private static Map<String, String> getAuthenticatorPropertyMap(ApplicationAuthen
14961496
return getAuthenticatorPropertyMapForUserDefinedLocalAuthenticators(
14971497
authenticator.getName(), context.getTenantDomain());
14981498
}
1499-
// else if(authenticator instanceof LocalApplicationAuthenticator &&
1500-
// AuthenticatorPropertyConstants.DefinedByType.SYSTEM.equals(authenticator.getDefinedByType())) {
1501-
// return getAuthenticatorPropertyMapForSystemDefinedLocalAuthenticators(authenticator.getName(),
1502-
// context.getTenantDomain());
1503-
// }
15041499

15051500
return FrameworkUtils.getAuthenticatorPropertyMapFromIdP(
15061501
context.getExternalIdP(), authenticator.getName());
@@ -1522,21 +1517,4 @@ private static Map<String, String> getAuthenticatorPropertyMapForUserDefinedLoca
15221517
}
15231518
return propertyMap;
15241519
}
1525-
1526-
// private static Map<String, String> getAuthenticatorPropertyMapForSystemDefinedLocalAuthenticators(
1527-
// String name, String tenantDomain) {
1528-
//
1529-
// Map<String, String> propertyMap = new HashMap<>();
1530-
// try {
1531-
// LocalAuthenticatorConfig authenticatorConfig = ApplicationAuthenticatorService.getInstance()
1532-
// .getSystemLocalAuthenticator(name, tenantDomain);
1533-
// for (Property property : authenticatorConfig.getProperties()) {
1534-
// propertyMap.put(property.getName(), property.getValue());
1535-
// }
1536-
// } catch (AuthenticatorMgtException e) {
1537-
// LOG.error(String.format("Error while resolving the system defined local authenticator properties:%s",
1538-
// name), e);
1539-
// }
1540-
// return propertyMap;
1541-
// }
15421520
}

0 commit comments

Comments
 (0)