Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into java17-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yogyagamage committed Sep 28, 2022
2 parents 73c786c + 0ca8f70 commit ad1582b
Show file tree
Hide file tree
Showing 76 changed files with 749 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.application.management</artifactId>
<version>1.1.26-SNAPSHOT</version>
<version>1.2.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>org.wso2.carbon.identity.api.server.application.management.common</artifactId>
<version>1.1.26-SNAPSHOT</version>
<version>1.2.12-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.wso2.carbon.identity.oauth.common.GrantType;
import org.wso2.carbon.identity.oauth.common.OAuthConstants;
import org.wso2.carbon.identity.oauth2.device.constants.Constants;

import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -47,6 +48,9 @@ private ApplicationManagementConstants() {
public static final String DEFAULT_CERTIFICATE_ALIAS = "wso2carbon";
public static final String ADVANCED_CONFIGURATIONS = "advancedConfigurations";
public static final String TEMPLATE_ID = "templateId";
public static final String NAME = "name";
public static final String CLIENT_ID = "clientId";
public static final String ISSUER = "issuer";

public static final String NON_EXISTING_USER_CODE = "30007 - ";

Expand All @@ -59,15 +63,14 @@ public enum ErrorMessage {
UNSUPPORTED_FILTER_ATTRIBUTE("60004",
"Filtering using the attempted attribute is not supported.",
"Filtering cannot be done with the '%s' attribute. " +
"Filtering is only supported with the 'name', and the 'clientID' attributes."),
"Filtering is only supported with 'name', 'clientId', and 'issuer' attributes."),
INVALID_FILTER_FORMAT("60004",
"Invalid format user for filtering.",
"Invalid filter query format.",
"Filter needs to be in the format <attribute>+<operation>+<value>. Eg: name+eq+john"),
INVALID_FILTER_OPERATION("60004",
"Attempted filtering operation is invalid.",
"Attempted filtering operation '%s' is invalid. " +
"Please use one of the supported filtering operations such as 'eq', 'co', 'sw', 'ew', 'and' " +
"or 'or'."),
"Attempted filtering operation '%s' is invalid. Please use one of the supported " +
"filtering operations such as 'eq', 'co', 'sw', 'ew', 'and', 'or'."),
APPLICATION_NOT_FOUND("60006",
"Application not found.",
"Application cannot be found for the provided id: %s in the tenantDomain: %s."),
Expand Down Expand Up @@ -175,6 +178,8 @@ public String toString() {
OAUTH_GRANT_TYPE_NAMES.put("urn:ietf:params:oauth:grant-type:saml1-bearer", "SAML1");
OAUTH_GRANT_TYPE_NAMES.put(GrantType.SAML20_BEARER.toString(), "SAML2");
OAUTH_GRANT_TYPE_NAMES.put(OAuthConstants.GrantTypes.IWA_NTLM, "IWA-NTLM");
OAUTH_GRANT_TYPE_NAMES.put("organization_switch", "Organization Switch");
OAUTH_GRANT_TYPE_NAMES.put(Constants.DEVICE_FLOW_GRANT_TYPE, "Device Code");
}

public static Map<String, String> getOAuthGrantTypeNames() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.application.management</artifactId>
<version>1.1.26-SNAPSHOT</version>
<version>1.2.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>WSO2 Identity Server - Applications Rest API</name>
<description>WSO2 Identity Server - Applications Rest API</description>
<artifactId>org.wso2.carbon.identity.api.server.application.management.v1</artifactId>
<version>1.1.26-SNAPSHOT</version>
<version>1.2.12-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class ApplicationListItem {
private String description;
private String image;
private String accessUrl;
private String inboundKey;

@XmlType(name="AccessEnum")
@XmlEnum(String.class)
Expand Down Expand Up @@ -73,6 +72,8 @@ public static AccessEnum fromValue(String value) {
private AccessEnum access = AccessEnum.READ;
private String self;
private AdvancedApplicationConfiguration advancedConfigurations;
private String clientId;
private String issuer;
private String templateId;

/**
Expand Down Expand Up @@ -165,23 +166,6 @@ public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl;
}

public ApplicationListItem inboundKey(String inboundKey) {

this.inboundKey = inboundKey;
return this;
}

@ApiModelProperty(example = "sampleRandomString", value = "")
@JsonProperty("inboundKey")
@Valid
public String getInboundKey() {
return inboundKey;
}

public void setInboundKey(String inboundKey) {
this.inboundKey = inboundKey;
}

/**
**/
public ApplicationListItem access(AccessEnum access) {
Expand Down Expand Up @@ -236,6 +220,44 @@ public void setAdvancedConfigurations(AdvancedApplicationConfiguration advancedC
this.advancedConfigurations = advancedConfigurations;
}

/**
**/
public ApplicationListItem clientId(String clientId) {

this.clientId = clientId;
return this;
}

@ApiModelProperty(example = "SmrrDNXRYf1lMmDlnleeHTuXx_Ea", value = "")
@JsonProperty("clientId")
@Valid
public String getClientId() {
return clientId;
}

public void setClientId(String clientId) {
this.clientId = clientId;
}

/**
**/
public ApplicationListItem issuer(String issuer) {

this.issuer = issuer;
return this;
}

@ApiModelProperty(example = "http://idp.example.com/metadata.php", value = "")
@JsonProperty("issuer")
@Valid
public String getIssuer() {
return issuer;
}

public void setIssuer(String issuer) {
this.issuer = issuer;
}

/**
**/
public ApplicationListItem templateId(String templateId) {
Expand Down Expand Up @@ -271,7 +293,8 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.description, applicationListItem.description) &&
Objects.equals(this.image, applicationListItem.image) &&
Objects.equals(this.accessUrl, applicationListItem.accessUrl) &&
Objects.equals(this.inboundKey, applicationListItem.inboundKey) &&
Objects.equals(this.clientId, applicationListItem.clientId) &&
Objects.equals(this.issuer, applicationListItem.issuer) &&
Objects.equals(this.access, applicationListItem.access) &&
Objects.equals(this.self, applicationListItem.self) &&
Objects.equals(this.advancedConfigurations, applicationListItem.advancedConfigurations) &&
Expand All @@ -281,7 +304,7 @@ public boolean equals(java.lang.Object o) {
@Override
public int hashCode() {

return Objects.hash(id, name, description, image, accessUrl, inboundKey, access, self,
return Objects.hash(id, name, description, image, accessUrl, clientId, issuer, access, self,
advancedConfigurations, templateId);
}

Expand All @@ -296,7 +319,8 @@ public String toString() {
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" image: ").append(toIndentedString(image)).append("\n");
sb.append(" accessUrl: ").append(toIndentedString(accessUrl)).append("\n");
sb.append(" inboundKey: ").append(toIndentedString(inboundKey)).append("\n");
sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n");
sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n");
sb.append(" access: ").append(toIndentedString(access)).append("\n");
sb.append(" self: ").append(toIndentedString(self)).append("\n");
sb.append(" advancedConfigurations: ").append(toIndentedString(advancedConfigurations)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class ApplicationResponseModel {
private String description;
private String imageUrl;
private String accessUrl;
private String clientId;
private String issuer;
private String templateId;
private Boolean isManagementApp;
private ClaimConfiguration claimConfiguration;
Expand Down Expand Up @@ -177,6 +179,42 @@ public void setAccessUrl(String accessUrl) {
this.accessUrl = accessUrl;
}

/**
**/
public ApplicationResponseModel clientId(String clientId) {

this.clientId = clientId;
return this;
}

@ApiModelProperty(example = "SmrrDNXRYf1lMmDlnleeHTuXx_Ea", value = "")
@JsonProperty("clientId")
@Valid
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}

/**
**/
public ApplicationResponseModel issuer(String issuer) {

this.issuer = issuer;
return this;
}

@ApiModelProperty(example = "http://idp.example.com/metadata.php", value = "")
@JsonProperty("issuer")
@Valid
public String getIssuer() {
return issuer;
}
public void setIssuer(String issuer) {
this.issuer = issuer;
}

/**
**/
public ApplicationResponseModel templateId(String templateId) {
Expand Down Expand Up @@ -344,6 +382,8 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.description, applicationResponseModel.description) &&
Objects.equals(this.imageUrl, applicationResponseModel.imageUrl) &&
Objects.equals(this.accessUrl, applicationResponseModel.accessUrl) &&
Objects.equals(this.clientId, applicationResponseModel.clientId) &&
Objects.equals(this.issuer, applicationResponseModel.issuer) &&
Objects.equals(this.templateId, applicationResponseModel.templateId) &&
Objects.equals(this.isManagementApp, applicationResponseModel.isManagementApp) &&
Objects.equals(this.claimConfiguration, applicationResponseModel.claimConfiguration) &&
Expand All @@ -356,7 +396,7 @@ public boolean equals(java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, description, imageUrl, accessUrl, templateId, isManagementApp, claimConfiguration, inboundProtocols, authenticationSequence, advancedConfigurations, provisioningConfigurations, access);
return Objects.hash(id, name, description, imageUrl, accessUrl, clientId, issuer, templateId, isManagementApp, claimConfiguration, inboundProtocols, authenticationSequence, advancedConfigurations, provisioningConfigurations, access);
}

@Override
Expand All @@ -370,6 +410,8 @@ public String toString() {
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n");
sb.append(" accessUrl: ").append(toIndentedString(accessUrl)).append("\n");
sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n");
sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n");
sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n");
sb.append(" isManagementApp: ").append(toIndentedString(isManagementApp)).append("\n");
sb.append(" claimConfiguration: ").append(toIndentedString(claimConfiguration)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,30 @@ public Response getApplication(@ApiParam(value = "ID of the application.",requir
return delegate.getApplication(applicationId );
}

@Valid
@GET
@Path("/{applicationId}/authenticators")

@Produces({ "application/json" })
@ApiOperation(value = "Get configured authenticators ", notes = "This API provides the capability to retrieve the configured authenticators. ", response = ConfiguredAuthenticatorsModal.class, responseContainer = "List", authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "Authenticators", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "OK", response = org.wso2.carbon.identity.api.server.application.management.v1.ConfiguredAuthenticatorsModal.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Bad Request", response = Error.class),
@ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@ApiResponse(code = 404, message = "Not Found", response = Error.class),
@ApiResponse(code = 500, message = "Server Error", response = Error.class)
})
public Response getConfiguredAuthenticators(@ApiParam(value = "ID of the application.",required=true) @PathParam("applicationId") String applicationId) {

return delegate.getConfiguredAuthenticators(applicationId );
}

@Valid
@GET
@Path("/templates/{template-id}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public interface ApplicationsApiService {

public Response getApplication(String applicationId);

public Response getConfiguredAuthenticators(String applicationId);

public Response getApplicationTemplate(String templateId);

public Response getCustomInboundConfiguration(String applicationId, String inboundProtocolId);
Expand Down
Loading

0 comments on commit ad1582b

Please sign in to comment.