Skip to content

Commit

Permalink
Merge pull request #20452 from Thumimku/impersonation-Rest
Browse files Browse the repository at this point in the history
[Rest API] Test Fixes for impersonation
  • Loading branch information
Thumimku authored Jun 12, 2024
2 parents b05efbb + b5367c3 commit 2bbedd9
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static StateEnum fromValue(String value) {
private OAuth2PKCEConfiguration pkce;
private AccessTokenConfiguration accessToken;
private RefreshTokenConfiguration refreshToken;
private SubjectTokenConfiguration subjectToken;
private IdTokenConfiguration idToken;
private OIDCLogoutConfiguration logout;
private Boolean validateRequestObjectSignature = false;
Expand Down Expand Up @@ -293,6 +294,24 @@ public void setRefreshToken(RefreshTokenConfiguration refreshToken) {
this.refreshToken = refreshToken;
}

/**
**/
public OpenIDConnectConfiguration subjectToken(SubjectTokenConfiguration subjectToken) {

this.subjectToken = subjectToken;
return this;
}

@ApiModelProperty(value = "")
@JsonProperty("subjectToken")
@Valid
public SubjectTokenConfiguration getSubjectToken() {
return subjectToken;
}
public void setSubjectToken(SubjectTokenConfiguration subjectToken) {
this.subjectToken = subjectToken;
}

/**
**/
public OpenIDConnectConfiguration idToken(IdTokenConfiguration idToken) {
Expand Down Expand Up @@ -502,6 +521,7 @@ public boolean equals(Object o) {
Objects.equals(this.pkce, openIDConnectConfiguration.pkce) &&
Objects.equals(this.accessToken, openIDConnectConfiguration.accessToken) &&
Objects.equals(this.refreshToken, openIDConnectConfiguration.refreshToken) &&
Objects.equals(this.subjectToken, openIDConnectConfiguration.subjectToken) &&
Objects.equals(this.idToken, openIDConnectConfiguration.idToken) &&
Objects.equals(this.logout, openIDConnectConfiguration.logout) &&
Objects.equals(this.validateRequestObjectSignature, openIDConnectConfiguration.validateRequestObjectSignature) &&
Expand All @@ -516,7 +536,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(clientId, clientSecret, state, grantTypes, callbackURLs, allowedOrigins, publicClient, pkce, accessToken, refreshToken, idToken, logout, validateRequestObjectSignature, scopeValidators, clientAuthentication, requestObject, pushAuthorizationRequest, subject, isFAPIApplication, fapiMetadata);
return Objects.hash(clientId, clientSecret, state, grantTypes, callbackURLs, allowedOrigins, publicClient, pkce, accessToken, refreshToken, subjectToken, idToken, logout, validateRequestObjectSignature, scopeValidators, clientAuthentication, requestObject, pushAuthorizationRequest, subject, isFAPIApplication, fapiMetadata);
}

@Override
Expand All @@ -535,6 +555,7 @@ public String toString() {
sb.append(" pkce: ").append(toIndentedString(pkce)).append("\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n");
sb.append(" subjectToken: ").append(toIndentedString(subjectToken)).append("\n");
sb.append(" idToken: ").append(toIndentedString(idToken)).append("\n");
sb.append(" logout: ").append(toIndentedString(logout)).append("\n");
sb.append(" validateRequestObjectSignature: ").append(toIndentedString(validateRequestObjectSignature)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Copyright (c) 2024, 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.ApiModelProperty;

import javax.validation.Valid;
import java.util.Objects;

public class SubjectTokenConfiguration {

private Boolean enable;
private Integer applicationSubjectTokenExpiryInSeconds;

/**
* If enabled, subject token can be issued for token exchange grant type.
**/
public SubjectTokenConfiguration enable(Boolean enable) {

this.enable = enable;
return this;
}

@ApiModelProperty(value = "If enabled, subject token can be issued for token exchange grant type.")
@JsonProperty("enable")
@Valid
public Boolean getEnable() {
return enable;
}
public void setEnable(Boolean enable) {
this.enable = enable;
}

/**
**/
public SubjectTokenConfiguration applicationSubjectTokenExpiryInSeconds(Integer applicationSubjectTokenExpiryInSeconds) {

this.applicationSubjectTokenExpiryInSeconds = applicationSubjectTokenExpiryInSeconds;
return this;
}

@ApiModelProperty(example = "3600", value = "")
@JsonProperty("applicationSubjectTokenExpiryInSeconds")
@Valid
public Integer getApplicationSubjectTokenExpiryInSeconds() {
return applicationSubjectTokenExpiryInSeconds;
}
public void setApplicationSubjectTokenExpiryInSeconds(Integer applicationSubjectTokenExpiryInSeconds) {
this.applicationSubjectTokenExpiryInSeconds = applicationSubjectTokenExpiryInSeconds;
}



@Override
public boolean equals(Object o) {

if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SubjectTokenConfiguration subjectTokenConfiguration = (SubjectTokenConfiguration) o;
return Objects.equals(this.enable, subjectTokenConfiguration.enable) &&
Objects.equals(this.applicationSubjectTokenExpiryInSeconds, subjectTokenConfiguration.applicationSubjectTokenExpiryInSeconds);
}

@Override
public int hashCode() {
return Objects.hash(enable, applicationSubjectTokenExpiryInSeconds);
}

@Override
public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class SubjectTokenConfiguration {\n");

sb.append(" enable: ").append(toIndentedString(enable)).append("\n");
sb.append(" applicationSubjectTokenExpiryInSeconds: ").append(toIndentedString(applicationSubjectTokenExpiryInSeconds)).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");
}
}

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@
<!-- Identity REST API feature -->
<identity.api.dispatcher.version>2.0.17</identity.api.dispatcher.version>
<identity.user.api.version>1.3.37</identity.user.api.version>
<identity.server.api.version>1.2.196</identity.server.api.version>
<identity.server.api.version>1.2.198</identity.server.api.version>

<identity.agent.sso.version>5.5.9</identity.agent.sso.version>
<identity.tool.samlsso.validator.version>5.5.8</identity.tool.samlsso.validator.version>
Expand Down

0 comments on commit 2bbedd9

Please sign in to comment.