Skip to content

Commit

Permalink
Add integration test for audience validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BiyonFernando committed Aug 6, 2024
1 parent 56fd147 commit 83a9dab
Show file tree
Hide file tree
Showing 13 changed files with 399 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51e2f49c8ea45de5a84d917d28a455ab2094d705fe7c9a8f4a6aaa1fdfc80b7f
932693cf163d497c081af51b44f9825a7ea795ac8a001cc0ebd5e582dab1722d
Original file line number Diff line number Diff line change
Expand Up @@ -16542,6 +16542,9 @@ components:
- securityScheme
name: CalculatorAPI
context: CalculatorAPI
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
createdTime: 2021-02-11 09:57:25
id: 01234567-0123-0123-0123-012345678901
additionalProperties:
Expand Down Expand Up @@ -16572,6 +16575,9 @@ components:
- securityScheme
name: CalculatorAPI
context: CalculatorAPI
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
createdTime: 2021-02-11 09:57:25
id: 01234567-0123-0123-0123-012345678901
additionalProperties:
Expand Down Expand Up @@ -16652,6 +16658,9 @@ components:
- securityScheme
name: CalculatorAPI
context: CalculatorAPI
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
createdTime: 2021-02-11 09:57:25
id: 01234567-0123-0123-0123-012345678901
additionalProperties:
Expand Down Expand Up @@ -16707,6 +16716,13 @@ components:
- SINGLE
example: PUBLIC
type: string
audiences:
description: The audiences of the API for jwt validation. Accepted values
are any String values
items:
example: '["aud1","aud2","aud3"]'
type: string
type: array
lifeCycleStatus:
example: CREATED
type: string
Expand Down Expand Up @@ -16933,6 +16949,9 @@ components:
url: https://localhost:9443/am/sample/pizzashack/v1/api/
production_endpoints:
url: https://localhost:9443/am/sample/pizzashack/v1/api/
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
mediationPolicies:
- name: json_to_xml_in_message
type: in
Expand Down Expand Up @@ -17093,6 +17112,13 @@ components:
- SINGLE
example: PUBLIC
type: string
audiences:
description: The audiences of the API for jwt validation. Accepted values
are any String values
items:
example: '["aud1","aud2","aud3"]'
type: string
type: array
transport:
description: |
Supported transports for the API (http and/or https).
Expand Down Expand Up @@ -17668,6 +17694,9 @@ components:
context: pizzaproduct
description: This is a simple API for Pizza Shack online pizza delivery
store
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
id: 01234567-0123-0123-0123-012345678901
state: state
- hasThumbnail: true
Expand All @@ -17679,6 +17708,9 @@ components:
context: pizzaproduct
description: This is a simple API for Pizza Shack online pizza delivery
store
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
id: 01234567-0123-0123-0123-012345678901
state: state
properties:
Expand All @@ -17705,6 +17737,9 @@ components:
name: PizzaShackAPIProduct
context: pizzaproduct
description: This is a simple API for Pizza Shack online pizza delivery store
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
id: 01234567-0123-0123-0123-012345678901
state: state
properties:
Expand Down Expand Up @@ -17749,6 +17784,13 @@ components:
gatewayVendor:
example: wso2
type: string
audiences:
description: The audiences of the API product for jwt validation. Accepted
values are any String values
items:
example: '["aud1","aud2","aud3"]'
type: string
type: array
title: API Info object with basic API details.
type: object
APIProduct:
Expand Down Expand Up @@ -17783,6 +17825,9 @@ components:
provider: admin
context: pizzaproduct
createdTime: createdTime
audiences:
- '["aud1","aud2","aud3"]'
- '["aud1","aud2","aud3"]'
lastUpdatedTime: lastUpdatedTime
id: 01234567-0123-0123-0123-012345678901
state: CREATED
Expand Down Expand Up @@ -18079,6 +18124,13 @@ components:
workflowStatus:
example: APPROVED
type: string
audiences:
description: The audiences of the API for jwt validation. Accepted values
are any String values
items:
example: '["aud1","aud2","aud3"]'
type: string
type: array
required:
- name
title: API Product object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Name | Type | Description | Notes
**enableSubscriberVerification** | **Boolean** | | [optional]
**type** | [**TypeEnum**](#TypeEnum) | The api creation type to be used. Accepted values are HTTP, WS, SOAPTOREST, GRAPHQL, WEBSUB, SSE, WEBHOOK, ASYNC | [optional]
**audience** | [**AudienceEnum**](#AudienceEnum) | The audience of the API. Accepted values are PUBLIC, SINGLE | [optional]
**audiences** | **List<String>** | The audiences of the API for jwt validation. Accepted values are any String values | [optional]
**transport** | **List<String>** | Supported transports for the API (http and/or https). | [optional]
**tags** | **List<String>** | | [optional]
**policies** | **List<String>** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Name | Type | Description | Notes
**provider** | **String** | If the provider value is not given, the user invoking the API will be used as the provider. | [optional]
**type** | **String** | | [optional]
**audience** | [**AudienceEnum**](#AudienceEnum) | The audience of the API. Accepted values are PUBLIC, SINGLE | [optional]
**audiences** | **List<String>** | The audiences of the API for jwt validation. Accepted values are any String values | [optional]
**lifeCycleStatus** | **String** | | [optional]
**workflowStatus** | **String** | | [optional]
**hasThumbnail** | **Boolean** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Name | Type | Description | Notes
**scopes** | [**List<APIScopeDTO>**](APIScopeDTO.md) | | [optional]
**categories** | **List<String>** | API categories | [optional]
**workflowStatus** | **String** | | [optional]
**audiences** | **List<String>** | The audiences of the API for jwt validation. Accepted values are any String values | [optional]



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**state** | **String** | State of the API product. Only published api products are visible on the Developer Portal | [optional]
**securityScheme** | **List<String>** | Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If it is not set OAuth2 will be set as the security for the current API. | [optional]
**gatewayVendor** | **String** | | [optional]
**audiences** | **List<String>** | The audiences of the API product for jwt validation. Accepted values are any String values | [optional]



Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ public AudienceEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_AUDIENCE)
private AudienceEnum audience;

public static final String SERIALIZED_NAME_AUDIENCES = "audiences";
@SerializedName(SERIALIZED_NAME_AUDIENCES)
private List<String> audiences = null;

public static final String SERIALIZED_NAME_TRANSPORT = "transport";
@SerializedName(SERIALIZED_NAME_TRANSPORT)
private List<String> transport = null;
Expand Down Expand Up @@ -1044,6 +1048,29 @@ public void setAudience(AudienceEnum audience) {
}


public APIDTO audiences(List<String> audiences) {

this.audiences = audiences;
return this;
}

/**
* The audiences of the API for jwt validation. Accepted values are any String values
* @return audiences
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The audiences of the API for jwt validation. Accepted values are any String values")

public List<String> getAudiences() {
return audiences;
}


public void setAudiences(List<String> audiences) {
this.audiences = audiences;
}


public APIDTO transport(List<String> transport) {

this.transport = transport;
Expand Down Expand Up @@ -1970,6 +1997,7 @@ public boolean equals(Object o) {
Objects.equals(this.enableSubscriberVerification, API.enableSubscriberVerification) &&
Objects.equals(this.type, API.type) &&
Objects.equals(this.audience, API.audience) &&
Objects.equals(this.audiences, API.audiences) &&
Objects.equals(this.transport, API.transport) &&
Objects.equals(this.tags, API.tags) &&
Objects.equals(this.policies, API.policies) &&
Expand Down Expand Up @@ -2013,7 +2041,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, description, context, version, provider, lifeCycleStatus, wsdlInfo, wsdlUrl, responseCachingEnabled, cacheTimeout, hasThumbnail, isDefaultVersion, isRevision, revisionedApiId, revisionId, enableSchemaValidation, enableSubscriberVerification, type, audience, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, apiKeyHeader, securityScheme, maxTps, visibility, visibleRoles, visibleTenants, mediationPolicies, apiPolicies, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, accessControl, accessControlRoles, businessInformation, corsConfiguration, websubSubscriptionConfiguration, workflowStatus, createdTime, lastUpdatedTimestamp, lastUpdatedTime, endpointConfig, endpointImplementationType, scopes, operations, threatProtectionPolicies, categories, keyManagers, serviceInfo, advertiseInfo, gatewayVendor, gatewayType, asyncTransportProtocols);
return Objects.hash(id, name, description, context, version, provider, lifeCycleStatus, wsdlInfo, wsdlUrl, responseCachingEnabled, cacheTimeout, hasThumbnail, isDefaultVersion, isRevision, revisionedApiId, revisionId, enableSchemaValidation, enableSubscriberVerification, type, audience, audiences, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, apiKeyHeader, securityScheme, maxTps, visibility, visibleRoles, visibleTenants, mediationPolicies, apiPolicies, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, accessControl, accessControlRoles, businessInformation, corsConfiguration, websubSubscriptionConfiguration, workflowStatus, createdTime, lastUpdatedTimestamp, lastUpdatedTime, endpointConfig, endpointImplementationType, scopes, operations, threatProtectionPolicies, categories, keyManagers, serviceInfo, advertiseInfo, gatewayVendor, gatewayType, asyncTransportProtocols);
}


Expand Down Expand Up @@ -2041,6 +2069,7 @@ public String toString() {
sb.append(" enableSubscriberVerification: ").append(toIndentedString(enableSubscriberVerification)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" audience: ").append(toIndentedString(audience)).append("\n");
sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n");
sb.append(" transport: ").append(toIndentedString(transport)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" policies: ").append(toIndentedString(policies)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public AudienceEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_AUDIENCE)
private AudienceEnum audience;

public static final String SERIALIZED_NAME_AUDIENCES = "audiences";
@SerializedName(SERIALIZED_NAME_AUDIENCES)
private List<String> audiences = null;

public static final String SERIALIZED_NAME_LIFE_CYCLE_STATUS = "lifeCycleStatus";
@SerializedName(SERIALIZED_NAME_LIFE_CYCLE_STATUS)
private String lifeCycleStatus;
Expand Down Expand Up @@ -385,6 +389,29 @@ public void setAudience(AudienceEnum audience) {
}


public APIInfoDTO audiences(List<String> audiences) {

this.audiences = audiences;
return this;
}

/**
* The audiences of the API for jwt validation. Accepted values are any String values
* @return audiences
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The audiences of the API for jwt validation. Accepted values are any String values")

public List<String> getAudiences() {
return audiences;
}


public void setAudiences(List<String> audiences) {
this.audiences = audiences;
}


public APIInfoDTO lifeCycleStatus(String lifeCycleStatus) {

this.lifeCycleStatus = lifeCycleStatus;
Expand Down Expand Up @@ -588,6 +615,7 @@ public boolean equals(Object o) {
Objects.equals(this.provider, apIInfo.provider) &&
Objects.equals(this.type, apIInfo.type) &&
Objects.equals(this.audience, apIInfo.audience) &&
Objects.equals(this.audiences, apIInfo.audiences) &&
Objects.equals(this.lifeCycleStatus, apIInfo.lifeCycleStatus) &&
Objects.equals(this.workflowStatus, apIInfo.workflowStatus) &&
Objects.equals(this.hasThumbnail, apIInfo.hasThumbnail) &&
Expand All @@ -600,7 +628,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, description, context, additionalProperties, additionalPropertiesMap, version, provider, type, audience, lifeCycleStatus, workflowStatus, hasThumbnail, securityScheme, createdTime, updatedTime, gatewayVendor, advertiseOnly);
return Objects.hash(id, name, description, context, additionalProperties, additionalPropertiesMap, version, provider, type, audience, audiences, lifeCycleStatus, workflowStatus, hasThumbnail, securityScheme, createdTime, updatedTime, gatewayVendor, advertiseOnly);
}


Expand All @@ -618,6 +646,7 @@ public String toString() {
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" audience: ").append(toIndentedString(audience)).append("\n");
sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n");
sb.append(" lifeCycleStatus: ").append(toIndentedString(lifeCycleStatus)).append("\n");
sb.append(" workflowStatus: ").append(toIndentedString(workflowStatus)).append("\n");
sb.append(" hasThumbnail: ").append(toIndentedString(hasThumbnail)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ public SubscriptionAvailabilityEnum read(final JsonReader jsonReader) throws IOE
@SerializedName(SERIALIZED_NAME_WORKFLOW_STATUS)
private String workflowStatus;

public static final String SERIALIZED_NAME_AUDIENCES = "audiences";
@SerializedName(SERIALIZED_NAME_AUDIENCES)
private List<String> audiences = null;


public APIProductDTO id(String id) {

Expand Down Expand Up @@ -1393,6 +1397,29 @@ public void setWorkflowStatus(String workflowStatus) {
}


public APIProductDTO audiences(List<String> audiences) {

this.audiences = audiences;
return this;
}

/**
* The audiences of the API for jwt validation. Accepted values are any String values
* @return audiences
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The audiences of the API for jwt validation. Accepted values are any String values")

public List<String> getAudiences() {
return audiences;
}


public void setAudiences(List<String> audiences) {
this.audiences = audiences;
}


@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down Expand Up @@ -1444,12 +1471,13 @@ public boolean equals(Object o) {
Objects.equals(this.apis, apIProduct.apis) &&
Objects.equals(this.scopes, apIProduct.scopes) &&
Objects.equals(this.categories, apIProduct.categories) &&
Objects.equals(this.workflowStatus, apIProduct.workflowStatus);
Objects.equals(this.workflowStatus, apIProduct.workflowStatus) &&
Objects.equals(this.audiences, apIProduct.audiences);
}

@Override
public int hashCode() {
return Objects.hash(id, name, context, version, description, provider, hasThumbnail, state, enableSchemaValidation, isDefaultVersion, isRevision, revisionedApiProductId, revisionId, responseCachingEnabled, cacheTimeout, visibility, visibleRoles, visibleTenants, accessControl, accessControlRoles, apiType, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, apiKeyHeader, securityScheme, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, businessInformation, corsConfiguration, createdTime, lastUpdatedTimestamp, lastUpdatedTime, gatewayVendor, apis, scopes, categories, workflowStatus);
return Objects.hash(id, name, context, version, description, provider, hasThumbnail, state, enableSchemaValidation, isDefaultVersion, isRevision, revisionedApiProductId, revisionId, responseCachingEnabled, cacheTimeout, visibility, visibleRoles, visibleTenants, accessControl, accessControlRoles, apiType, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, apiKeyHeader, securityScheme, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, businessInformation, corsConfiguration, createdTime, lastUpdatedTimestamp, lastUpdatedTime, gatewayVendor, apis, scopes, categories, workflowStatus, audiences);
}


Expand Down Expand Up @@ -1500,6 +1528,7 @@ public String toString() {
sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n");
sb.append(" categories: ").append(toIndentedString(categories)).append("\n");
sb.append(" workflowStatus: ").append(toIndentedString(workflowStatus)).append("\n");
sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
Loading

0 comments on commit 83a9dab

Please sign in to comment.