From 040c3c2cd18805015596dc1045cb7e1e1b1eb6a2 Mon Sep 17 00:00:00 2001 From: Thumimku Date: Fri, 10 Nov 2023 11:47:47 +0530 Subject: [PATCH 1/2] add attestation meta data model --- .../AdvancedApplicationConfiguration.java | 46 ++++- ...ationConfigurationAttestationMetaData.java | 160 ++++++++++++++++++ 2 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfigurationAttestationMetaData.java diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfiguration.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfiguration.java index db44e54519e..13a2aaad363 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfiguration.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfiguration.java @@ -39,6 +39,8 @@ public class AdvancedApplicationConfiguration { private Boolean fragment; private List additionalSpProperties; + private Boolean enableAPIBasedAuthentication; + private AdvancedApplicationConfigurationAttestationMetaData attestationMetaData; private Boolean useExternalConsentPage; @@ -189,7 +191,43 @@ public void setFragment(Boolean fragment) { } /** - * + * Decides whether API Based Authentication is enabled for this application. + **/ + public AdvancedApplicationConfiguration enableAPIBasedAuthentication(Boolean enableAPIBasedAuthentication) { + + this.enableAPIBasedAuthentication = enableAPIBasedAuthentication; + return this; + } + + @ApiModelProperty(example = "false", value = "Decides whether API Based Authentication is enabled for this application.") + @JsonProperty("enableAPIBasedAuthentication") + @Valid + public Boolean getEnableAPIBasedAuthentication() { + return enableAPIBasedAuthentication; + } + public void setEnableAPIBasedAuthentication(Boolean enableAPIBasedAuthentication) { + this.enableAPIBasedAuthentication = enableAPIBasedAuthentication; + } + + /** + **/ + public AdvancedApplicationConfiguration attestationMetaData(AdvancedApplicationConfigurationAttestationMetaData attestationMetaData) { + + this.attestationMetaData = attestationMetaData; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("attestationMetaData") + @Valid + public AdvancedApplicationConfigurationAttestationMetaData getAttestationMetaData() { + return attestationMetaData; + } + public void setAttestationMetaData(AdvancedApplicationConfigurationAttestationMetaData attestationMetaData) { + this.attestationMetaData = attestationMetaData; + } + + /** **/ public AdvancedApplicationConfiguration additionalSpProperties(List additionalSpProperties) { @@ -245,12 +283,14 @@ public boolean equals(Object o) { Objects.equals(this.enableAuthorization, advancedApplicationConfiguration.enableAuthorization) && Objects.equals(this.fragment, advancedApplicationConfiguration.fragment) && Objects.equals(this.additionalSpProperties, advancedApplicationConfiguration.additionalSpProperties) && + Objects.equals(this.enableAPIBasedAuthentication, advancedApplicationConfiguration.enableAPIBasedAuthentication) && + Objects.equals(this.attestationMetaData, advancedApplicationConfiguration.attestationMetaData) && Objects.equals(this.useExternalConsentPage, advancedApplicationConfiguration.useExternalConsentPage); } @Override public int hashCode() { - return Objects.hash(saas, discoverableByEndUsers, certificate, skipLoginConsent, skipLogoutConsent, returnAuthenticatedIdpList, enableAuthorization, fragment, additionalSpProperties, useExternalConsentPage); + return Objects.hash(saas, discoverableByEndUsers, certificate, skipLoginConsent, skipLogoutConsent, returnAuthenticatedIdpList, enableAuthorization, fragment, enableAPIBasedAuthentication, attestationMetaData, additionalSpProperties, useExternalConsentPage); } @Override @@ -267,6 +307,8 @@ public String toString() { sb.append(" returnAuthenticatedIdpList: ").append(toIndentedString(returnAuthenticatedIdpList)).append("\n"); sb.append(" enableAuthorization: ").append(toIndentedString(enableAuthorization)).append("\n"); sb.append(" fragment: ").append(toIndentedString(fragment)).append("\n"); + sb.append(" enableAPIBasedAuthentication: ").append(toIndentedString(enableAPIBasedAuthentication)).append("\n"); + sb.append(" attestationMetaData: ").append(toIndentedString(attestationMetaData)).append("\n"); sb.append(" additionalSpProperties: ").append(toIndentedString(additionalSpProperties)).append("\n"); sb.append(" useExternalConsentPage: ").append(toIndentedString(useExternalConsentPage)).append("\n"); sb.append("}"); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfigurationAttestationMetaData.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfigurationAttestationMetaData.java new file mode 100644 index 00000000000..8169bcbbb2d --- /dev/null +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/application/management/v1/model/AdvancedApplicationConfigurationAttestationMetaData.java @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.identity.integration.test.rest.api.server.application.management.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.Valid; +import java.util.Objects; + +public class AdvancedApplicationConfigurationAttestationMetaData { + + private Boolean enableClientAttestation; + private String androidPackageName; + private Object androidAttestationServiceCredentials; + private String appleAppId; + + /** + * Decides whether client attestation enabled for this application. + **/ + public AdvancedApplicationConfigurationAttestationMetaData enableClientAttestation(Boolean enableClientAttestation) { + + this.enableClientAttestation = enableClientAttestation; + return this; + } + + @ApiModelProperty(example = "false", value = "Decides whether client attestation enabled for this application.") + @JsonProperty("enableClientAttestation") + @Valid + public Boolean getEnableClientAttestation() { + return enableClientAttestation; + } + public void setEnableClientAttestation(Boolean enableClientAttestation) { + this.enableClientAttestation = enableClientAttestation; + } + + /** + * Decides the android package name of the application. + **/ + public AdvancedApplicationConfigurationAttestationMetaData androidPackageName(String androidPackageName) { + + this.androidPackageName = androidPackageName; + return this; + } + + @ApiModelProperty(example = "com.wso2.mobile.sample", value = "Decides the android package name of the application.") + @JsonProperty("androidPackageName") + @Valid + public String getAndroidPackageName() { + return androidPackageName; + } + public void setAndroidPackageName(String androidPackageName) { + this.androidPackageName = androidPackageName; + } + + /** + * Decides the credentials for the service account to access Google Play Integrity Service. + **/ + public AdvancedApplicationConfigurationAttestationMetaData androidAttestationServiceCredentials(Object androidAttestationServiceCredentials) { + + this.androidAttestationServiceCredentials = androidAttestationServiceCredentials; + return this; + } + + @ApiModelProperty(value = "Decides the credentials for the service account to access Google Play Integrity Service.") + @JsonProperty("androidAttestationServiceCredentials") + @Valid + public Object getAndroidAttestationServiceCredentials() { + return androidAttestationServiceCredentials; + } + public void setAndroidAttestationServiceCredentials(Object androidAttestationServiceCredentials) { + this.androidAttestationServiceCredentials = androidAttestationServiceCredentials; + } + + /** + * Decides the apple app id which denotes {apple-teamId}.{bundleId}. + **/ + public AdvancedApplicationConfigurationAttestationMetaData appleAppId(String appleAppId) { + + this.appleAppId = appleAppId; + return this; + } + + @ApiModelProperty(example = "APPLETEAMID.com.wso2.mobile.sample", value = "Decides the apple app id which denotes {apple-teamId}.{bundleId}.") + @JsonProperty("appleAppId") + @Valid + public String getAppleAppId() { + return appleAppId; + } + public void setAppleAppId(String appleAppId) { + this.appleAppId = appleAppId; + } + + + + @Override + public boolean equals(Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvancedApplicationConfigurationAttestationMetaData advancedApplicationConfigurationAttestationMetaData = (AdvancedApplicationConfigurationAttestationMetaData) o; + return Objects.equals(this.enableClientAttestation, advancedApplicationConfigurationAttestationMetaData.enableClientAttestation) && + Objects.equals(this.androidPackageName, advancedApplicationConfigurationAttestationMetaData.androidPackageName) && + Objects.equals(this.androidAttestationServiceCredentials, advancedApplicationConfigurationAttestationMetaData.androidAttestationServiceCredentials) && + Objects.equals(this.appleAppId, advancedApplicationConfigurationAttestationMetaData.appleAppId); + } + + @Override + public int hashCode() { + return Objects.hash(enableClientAttestation, androidPackageName, androidAttestationServiceCredentials, appleAppId); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AdvancedApplicationConfigurationAttestationMetaData {\n"); + + sb.append(" enableClientAttestation: ").append(toIndentedString(enableClientAttestation)).append("\n"); + sb.append(" androidPackageName: ").append(toIndentedString(androidPackageName)).append("\n"); + sb.append(" androidAttestationServiceCredentials: ").append(toIndentedString(androidAttestationServiceCredentials)).append("\n"); + sb.append(" appleAppId: ").append(toIndentedString(appleAppId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + From 643609062c2dfe22607413d9304a071252d4a5c7 Mon Sep 17 00:00:00 2001 From: Thumimku Date: Fri, 10 Nov 2023 12:35:46 +0530 Subject: [PATCH 2/2] bump api server version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d3525f34a0..a870d94aa5e 100755 --- a/pom.xml +++ b/pom.xml @@ -2435,7 +2435,7 @@ 2.0.13 1.3.24 - 1.2.116 + 1.2.117 5.5.9 5.5.7