Skip to content

Commit

Permalink
Add config to enable jwt for portals
Browse files Browse the repository at this point in the history
  • Loading branch information
chamilaadhi committed Mar 3, 2024
1 parent 448687f commit bc3869d
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,7 @@ private OAuthConstants() {
public static final String API_STORE_GROUP_EXTRACTOR_IMPLEMENTATION = API_STORE + "GroupingExtractor";
public static final String API_STORE_REST_API_GROUP_EXTRACTOR_IMPLEMENTATION =
API_STORE + "RESTApiGroupingExtractor";
public static final String IS_ENABLE_JWT_FOR_PORTALS = OAUTH_CONFIGS + "EnableJWTForPortals";
public static final String API_CUSTOM_SEQUENCES_FOLDER_LOCATION =
"repository" + File.separator + "resources" + File.separator + "customsequences";
public static final String WORKFLOW_EXTENSION_LOCATION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7052,6 +7052,24 @@ public static boolean isMultiGroupAppSharingEnabled() {
return Boolean.valueOf(multiGrpAppSharing);
}

/**
* Enable jwt for portal logins
*
* @return boolean value of the config
*/
public static boolean isJWTEnabledForPortals() {

APIManagerConfiguration config = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService()
.getAPIManagerConfiguration();

Check warning on line 7063 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java#L7062-L7063

Added lines #L7062 - L7063 were not covered by tests

String isEnabledJwtForPortals = config.getFirstProperty(APIConstants.IS_ENABLE_JWT_FOR_PORTALS);

Check warning on line 7065 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java#L7065

Added line #L7065 was not covered by tests
if (isEnabledJwtForPortals != null) {
return Boolean.valueOf(isEnabledJwtForPortals);

Check warning on line 7067 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java#L7067

Added line #L7067 was not covered by tests
}

return false;

Check warning on line 7070 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java#L7070

Added line #L7070 was not covered by tests

}
/**
* Used to check whether Provisioning Out-of-Band OAuth Clients feature is enabled
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class SettingsDTO {

private List<String> scopes = new ArrayList<String>();
private List<String> gatewayTypes = new ArrayList<String>();
private Boolean isJWTEnabledForLoginTokens = false;

Check warning on line 28 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java#L28

Added line #L28 was not covered by tests
private List<SettingsKeyManagerConfigurationDTO> keyManagerConfiguration = new ArrayList<SettingsKeyManagerConfigurationDTO>();
private Boolean analyticsEnabled = null;

Expand Down Expand Up @@ -62,6 +63,23 @@ public void setGatewayTypes(List<String> gatewayTypes) {
this.gatewayTypes = gatewayTypes;
}

/**
**/
public SettingsDTO isJWTEnabledForLoginTokens(Boolean isJWTEnabledForLoginTokens) {
this.isJWTEnabledForLoginTokens = isJWTEnabledForLoginTokens;
return this;

Check warning on line 70 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java#L69-L70

Added lines #L69 - L70 were not covered by tests
}


@ApiModelProperty(value = "")
@JsonProperty("IsJWTEnabledForLoginTokens")
public Boolean isIsJWTEnabledForLoginTokens() {
return isJWTEnabledForLoginTokens;

Check warning on line 77 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java#L77

Added line #L77 was not covered by tests
}
public void setIsJWTEnabledForLoginTokens(Boolean isJWTEnabledForLoginTokens) {
this.isJWTEnabledForLoginTokens = isJWTEnabledForLoginTokens;
}

Check warning on line 81 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java#L80-L81

Added lines #L80 - L81 were not covered by tests

/**
**/
public SettingsDTO keyManagerConfiguration(List<SettingsKeyManagerConfigurationDTO> keyManagerConfiguration) {
Expand Down Expand Up @@ -110,13 +128,14 @@ public boolean equals(java.lang.Object o) {
SettingsDTO settings = (SettingsDTO) o;
return Objects.equals(scopes, settings.scopes) &&
Objects.equals(gatewayTypes, settings.gatewayTypes) &&
Objects.equals(isJWTEnabledForLoginTokens, settings.isJWTEnabledForLoginTokens) &&
Objects.equals(keyManagerConfiguration, settings.keyManagerConfiguration) &&
Objects.equals(analyticsEnabled, settings.analyticsEnabled);
}

@Override
public int hashCode() {
return Objects.hash(scopes, gatewayTypes, keyManagerConfiguration, analyticsEnabled);
return Objects.hash(scopes, gatewayTypes, isJWTEnabledForLoginTokens, keyManagerConfiguration, analyticsEnabled);

Check warning on line 138 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java#L138

Added line #L138 was not covered by tests
}

@Override
Expand All @@ -126,6 +145,7 @@ public String toString() {

sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n");
sb.append(" gatewayTypes: ").append(toIndentedString(gatewayTypes)).append("\n");
sb.append(" isJWTEnabledForLoginTokens: ").append(toIndentedString(isJWTEnabledForLoginTokens)).append("\n");

Check warning on line 148 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/admin/v1/dto/SettingsDTO.java#L148

Added line #L148 was not covered by tests
sb.append(" keyManagerConfiguration: ").append(toIndentedString(keyManagerConfiguration)).append("\n");
sb.append(" analyticsEnabled: ").append(toIndentedString(analyticsEnabled)).append("\n");
sb.append("}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public SettingsDTO fromSettingsToDTO(Boolean isUserAvailable) throws APIManageme
}
settingsDTO.setScopes(getScopeList());
settingsDTO.setGatewayTypes(APIUtil.getGatewayTypes());
settingsDTO.setIsJWTEnabledForLoginTokens(APIUtil.isJWTEnabledForPortals());

Check warning on line 64 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/utils/mappings/SettingsMappingUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/utils/mappings/SettingsMappingUtil.java#L64

Added line #L64 was not covered by tests
return settingsDTO;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4594,6 +4594,9 @@ components:
type: array
items:
type: string
IsJWTEnabledForLoginTokens:
type: boolean
default: false
keyManagerConfiguration:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4594,6 +4594,9 @@ components:
type: array
items:
type: string
IsJWTEnabledForLoginTokens:
type: boolean
default: false
keyManagerConfiguration:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5290,6 +5290,9 @@ components:
IsPasswordChangeEnabled:
type: boolean
default: true
IsJWTEnabledForLoginTokens:
type: boolean
default: false
userStorePasswordPattern:
type: string
description: The 'PasswordJavaRegEx' cofigured in the UserStoreManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11915,6 +11915,9 @@ components:
type: string
description: Authorization Header
example: authorization
IsJWTEnabledForLoginTokens:
type: boolean
default: false
customProperties:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class SettingsDTO {
private String defaultAdvancePolicy = null;
private String defaultSubscriptionPolicy = null;
private String authorizationHeader = null;
private Boolean isJWTEnabledForLoginTokens = false;

Check warning on line 42 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java#L42

Added line #L42 was not covered by tests
private List<SettingsCustomPropertiesDTO> customProperties = new ArrayList<SettingsCustomPropertiesDTO>();

/**
Expand Down Expand Up @@ -273,6 +274,23 @@ public void setAuthorizationHeader(String authorizationHeader) {
this.authorizationHeader = authorizationHeader;
}

/**
**/
public SettingsDTO isJWTEnabledForLoginTokens(Boolean isJWTEnabledForLoginTokens) {
this.isJWTEnabledForLoginTokens = isJWTEnabledForLoginTokens;
return this;

Check warning on line 281 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java#L280-L281

Added lines #L280 - L281 were not covered by tests
}


@ApiModelProperty(value = "")
@JsonProperty("IsJWTEnabledForLoginTokens")
public Boolean isIsJWTEnabledForLoginTokens() {
return isJWTEnabledForLoginTokens;

Check warning on line 288 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java#L288

Added line #L288 was not covered by tests
}
public void setIsJWTEnabledForLoginTokens(Boolean isJWTEnabledForLoginTokens) {
this.isJWTEnabledForLoginTokens = isJWTEnabledForLoginTokens;
}

Check warning on line 292 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java#L291-L292

Added lines #L291 - L292 were not covered by tests

/**
**/
public SettingsDTO customProperties(List<SettingsCustomPropertiesDTO> customProperties) {
Expand Down Expand Up @@ -314,12 +332,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(defaultAdvancePolicy, settings.defaultAdvancePolicy) &&
Objects.equals(defaultSubscriptionPolicy, settings.defaultSubscriptionPolicy) &&
Objects.equals(authorizationHeader, settings.authorizationHeader) &&
Objects.equals(isJWTEnabledForLoginTokens, settings.isJWTEnabledForLoginTokens) &&
Objects.equals(customProperties, settings.customProperties);
}

@Override
public int hashCode() {
return Objects.hash(devportalUrl, environment, gatewayTypes, scopes, monetizationAttributes, subscriberContactAttributes, securityAuditProperties, externalStoresEnabled, docVisibilityEnabled, crossTenantSubscriptionEnabled, defaultAdvancePolicy, defaultSubscriptionPolicy, authorizationHeader, customProperties);
return Objects.hash(devportalUrl, environment, gatewayTypes, scopes, monetizationAttributes, subscriberContactAttributes, securityAuditProperties, externalStoresEnabled, docVisibilityEnabled, crossTenantSubscriptionEnabled, defaultAdvancePolicy, defaultSubscriptionPolicy, authorizationHeader, isJWTEnabledForLoginTokens, customProperties);

Check warning on line 341 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java#L341

Added line #L341 was not covered by tests
}

@Override
Expand All @@ -340,6 +359,7 @@ public String toString() {
sb.append(" defaultAdvancePolicy: ").append(toIndentedString(defaultAdvancePolicy)).append("\n");
sb.append(" defaultSubscriptionPolicy: ").append(toIndentedString(defaultSubscriptionPolicy)).append("\n");
sb.append(" authorizationHeader: ").append(toIndentedString(authorizationHeader)).append("\n");
sb.append(" isJWTEnabledForLoginTokens: ").append(toIndentedString(isJWTEnabledForLoginTokens)).append("\n");

Check warning on line 362 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/SettingsDTO.java#L362

Added line #L362 was not covered by tests
sb.append(" customProperties: ").append(toIndentedString(customProperties)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public SettingsDTO fromSettingstoDTO(Boolean isUserAvailable, String organizatio
APIUtil.isExternalStoresEnabled(RestApiCommonUtil.getLoggedInUserTenantDomain()));
settingsDTO.setDocVisibilityEnabled(APIUtil.isDocVisibilityLevelsEnabled());
settingsDTO.setCrossTenantSubscriptionEnabled(APIUtil.isCrossTenantSubscriptionsEnabled());
settingsDTO.setIsJWTEnabledForLoginTokens(APIUtil.isJWTEnabledForPortals());

Check warning on line 90 in components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/SettingsMappingUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/SettingsMappingUtil.java#L90

Added line #L90 was not covered by tests
Map<String, Environment> gatewayEnvironments = APIUtil.getReadOnlyGatewayEnvironments();
String authorizationHeader = APIUtil.getOAuthConfiguration(loggedInUserTenantDomain,
APIConstants.AUTHORIZATION_HEADER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11915,6 +11915,9 @@ components:
type: string
description: Authorization Header
example: authorization
IsJWTEnabledForLoginTokens:
type: boolean
default: false
customProperties:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class SettingsDTO {
private SettingsIdentityProviderDTO identityProvider = null;
private Boolean isAnonymousModeEnabled = true;
private Boolean isPasswordChangeEnabled = true;
private Boolean isJWTEnabledForLoginTokens = false;

Check warning on line 37 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java#L37

Added line #L37 was not covered by tests
private String userStorePasswordPattern = null;
private String passwordPolicyPattern = null;
private Integer passwordPolicyMinLength = null;
Expand Down Expand Up @@ -227,6 +228,23 @@ public void setIsPasswordChangeEnabled(Boolean isPasswordChangeEnabled) {
this.isPasswordChangeEnabled = isPasswordChangeEnabled;
}

/**
**/
public SettingsDTO isJWTEnabledForLoginTokens(Boolean isJWTEnabledForLoginTokens) {
this.isJWTEnabledForLoginTokens = isJWTEnabledForLoginTokens;
return this;

Check warning on line 235 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java#L234-L235

Added lines #L234 - L235 were not covered by tests
}


@ApiModelProperty(value = "")
@JsonProperty("IsJWTEnabledForLoginTokens")
public Boolean isIsJWTEnabledForLoginTokens() {
return isJWTEnabledForLoginTokens;

Check warning on line 242 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java#L242

Added line #L242 was not covered by tests
}
public void setIsJWTEnabledForLoginTokens(Boolean isJWTEnabledForLoginTokens) {
this.isJWTEnabledForLoginTokens = isJWTEnabledForLoginTokens;
}

Check warning on line 246 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java#L245-L246

Added lines #L245 - L246 were not covered by tests

/**
* The &#39;PasswordJavaRegEx&#39; cofigured in the UserStoreManager
**/
Expand Down Expand Up @@ -320,6 +338,7 @@ public boolean equals(java.lang.Object o) {
Objects.equals(identityProvider, settings.identityProvider) &&
Objects.equals(isAnonymousModeEnabled, settings.isAnonymousModeEnabled) &&
Objects.equals(isPasswordChangeEnabled, settings.isPasswordChangeEnabled) &&
Objects.equals(isJWTEnabledForLoginTokens, settings.isJWTEnabledForLoginTokens) &&
Objects.equals(userStorePasswordPattern, settings.userStorePasswordPattern) &&
Objects.equals(passwordPolicyPattern, settings.passwordPolicyPattern) &&
Objects.equals(passwordPolicyMinLength, settings.passwordPolicyMinLength) &&
Expand All @@ -328,7 +347,7 @@ public boolean equals(java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(grantTypes, scopes, applicationSharingEnabled, mapExistingAuthApps, apiGatewayEndpoint, monetizationEnabled, recommendationEnabled, isUnlimitedTierPaid, identityProvider, isAnonymousModeEnabled, isPasswordChangeEnabled, userStorePasswordPattern, passwordPolicyPattern, passwordPolicyMinLength, passwordPolicyMaxLength);
return Objects.hash(grantTypes, scopes, applicationSharingEnabled, mapExistingAuthApps, apiGatewayEndpoint, monetizationEnabled, recommendationEnabled, isUnlimitedTierPaid, identityProvider, isAnonymousModeEnabled, isPasswordChangeEnabled, isJWTEnabledForLoginTokens, userStorePasswordPattern, passwordPolicyPattern, passwordPolicyMinLength, passwordPolicyMaxLength);

Check warning on line 350 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java#L350

Added line #L350 was not covered by tests
}

@Override
Expand All @@ -347,6 +366,7 @@ public String toString() {
sb.append(" identityProvider: ").append(toIndentedString(identityProvider)).append("\n");
sb.append(" isAnonymousModeEnabled: ").append(toIndentedString(isAnonymousModeEnabled)).append("\n");
sb.append(" isPasswordChangeEnabled: ").append(toIndentedString(isPasswordChangeEnabled)).append("\n");
sb.append(" isJWTEnabledForLoginTokens: ").append(toIndentedString(isJWTEnabledForLoginTokens)).append("\n");

Check warning on line 369 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/SettingsDTO.java#L369

Added line #L369 was not covered by tests
sb.append(" userStorePasswordPattern: ").append(toIndentedString(userStorePasswordPattern)).append("\n");
sb.append(" passwordPolicyPattern: ").append(toIndentedString(passwordPolicyPattern)).append("\n");
sb.append(" passwordPolicyMinLength: ").append(toIndentedString(passwordPolicyMinLength)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public SettingsDTO fromSettingstoDTO(Boolean isUserAvailable, Boolean moneatizat
SettingsDTO settingsDTO = new SettingsDTO();
settingsDTO.setScopes(GetScopeList());
settingsDTO.setApplicationSharingEnabled(APIUtil.isMultiGroupAppSharingEnabled());
settingsDTO.setIsJWTEnabledForLoginTokens(APIUtil.isJWTEnabledForPortals());

Check warning on line 63 in components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/SettingsMappingUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/SettingsMappingUtil.java#L63

Added line #L63 was not covered by tests
settingsDTO.setRecommendationEnabled(recommendationEnabled);
settingsDTO.setMapExistingAuthApps(APIUtil.isMapExistingAuthAppsEnabled());
settingsDTO.setMonetizationEnabled(moneatizationEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5290,6 +5290,9 @@ components:
IsPasswordChangeEnabled:
type: boolean
default: true
IsJWTEnabledForLoginTokens:
type: boolean
default: false
userStorePasswordPattern:
type: string
description: The 'PasswordJavaRegEx' cofigured in the UserStoreManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@
<!-- Whether to validate certificate bound access tokens-->
<EnableCertificateBoundAccessToken>{{apim.oauth_config.enable_certificate_bound_access_token}}</EnableCertificateBoundAccessToken>

{% if apim.oauth_config.enable_jwt_for_portals is defined %}
<EnableJWTForPortals>{{apim.oauth_config.enable_jwt_for_portals}}</EnableJWTForPortals>
{% endif %}
</OAuthConfigurations>

<AccessTokenBinding>
Expand Down

0 comments on commit bc3869d

Please sign in to comment.