Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration test for audience validation with API and API products #13520

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17166,6 +17166,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 @@ -17196,6 +17199,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 @@ -17276,6 +17282,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 @@ -17331,6 +17340,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 @@ -17557,6 +17573,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 @@ -17717,6 +17736,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 @@ -18292,6 +18318,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 @@ -18303,6 +18332,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 @@ -18329,6 +18361,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 @@ -18373,6 +18408,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 @@ -18407,6 +18449,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 @@ -18703,6 +18748,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
Loading