Skip to content

Commit

Permalink
adding gatewayType config and REST API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CrowleyRajapakse committed Feb 6, 2024
1 parent ca9f7a6 commit 1c41c57
Show file tree
Hide file tree
Showing 20 changed files with 325 additions and 18 deletions.
1 change: 1 addition & 0 deletions modules/distribution/product/src/main/conf/deployment.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ key_password = "wso2carbon"
[[apim.gateway.environment]]
name = "Default"
type = "hybrid"
gateway_type = "Regular"
provider = "wso2"
display_in_api_console = true
description = "This is a hybrid gateway that handles both production and sandbox token traffic."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ key_password = "wso2carbon"
[[apim.gateway.environment]]
name = "Default"
type = "hybrid"
gateway_type = "Regular"
provider = "wso2"
display_in_api_console = true
description = "This is a hybrid gateway that handles both production and sandbox token traffic."
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
913b0f99d03f27dee037609be7975aca8be768047cea3b7c8598dd11a5a89a6a
79b51370beba8f507666fe239fea0c86a211fc9f1f8dbf97264d13f09f0c147a
60 changes: 60 additions & 0 deletions modules/integration/tests-common/clients/admin/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7962,6 +7962,18 @@ components:
- type
title: Throttle Limit
type: object
BurstLimit:
properties:
rateLimitCount:
description: Burst control request count
example: 10
type: integer
rateLimitTimeUnit:
description: Burst control time unit
example: min
type: string
title: Burst Limit object
type: object
MonetizationInfo:
properties:
monetizationPlan:
Expand Down Expand Up @@ -8346,6 +8358,7 @@ components:
endpointURI: default
- protocol: default
endpointURI: default
gatewayType: Regular
isReadOnly: false
provider: wso2
displayName: US Region
Expand Down Expand Up @@ -8393,6 +8406,10 @@ components:
provider:
example: wso2
type: string
gatewayType:
default: Regular
example: Regular
type: string
isReadOnly:
example: false
readOnly: true
Expand Down Expand Up @@ -8424,6 +8441,7 @@ components:
endpointURI: default
- protocol: default
endpointURI: default
gatewayType: Regular
isReadOnly: false
provider: wso2
displayName: US Region
Expand Down Expand Up @@ -8453,6 +8471,7 @@ components:
endpointURI: default
- protocol: default
endpointURI: default
gatewayType: Regular
isReadOnly: false
provider: wso2
displayName: US Region
Expand Down Expand Up @@ -8786,6 +8805,9 @@ components:
mask: true
defaultScopesClaim: scope
type: default
gatewayTypes:
- gatewayTypes
- gatewayTypes
scopes:
- scopes
- scopes
Expand All @@ -8794,6 +8816,10 @@ components:
items:
type: string
type: array
gatewayTypes:
items:
type: string
type: array
keyManagerConfiguration:
items:
$ref: '#/components/schemas/Settings_keyManagerConfiguration'
Expand Down Expand Up @@ -8884,6 +8910,11 @@ components:
tokenEndpoint: https://localhost:9444/oauth2/token
consumerKeyClaim: azp
scopesClaim: scp
permissions:
permissionType: ALLOW
roles:
- Internal/subscriber
- Internal/subscriber
alias: https://localhost:9443/oauth2/token
id: 01234567-0123-0123-0123-012345678901
userInfoEndpoint: https://localhost:9444/oauth2/userinfo?schema=openid
Expand Down Expand Up @@ -8946,6 +8977,11 @@ components:
tokenEndpoint: https://localhost:9444/oauth2/token
consumerKeyClaim: azp
scopesClaim: scp
permissions:
permissionType: ALLOW
roles:
- Internal/subscriber
- Internal/subscriber
alias: https://localhost:9443/oauth2/token
id: 01234567-0123-0123-0123-012345678901
userInfoEndpoint: https://localhost:9444/oauth2/userinfo?schema=openid
Expand Down Expand Up @@ -9104,6 +9140,8 @@ components:
Password: admin
properties: {}
type: object
permissions:
$ref: '#/components/schemas/KeyManager_permissions'
tokenType:
default: DIRECT
description: The type of the tokens to be used (exchanged or without exchanged).
Expand Down Expand Up @@ -9628,6 +9666,8 @@ components:
properties:
defaultLimit:
$ref: '#/components/schemas/ThrottleLimit'
burstLimit:
$ref: '#/components/schemas/BurstLimit'
required:
- defaultLimit
SubscriptionThrottlePolicy_allOf:
Expand Down Expand Up @@ -9783,6 +9823,26 @@ components:
type: string
value:
type: string
KeyManager_permissions:
example:
permissionType: ALLOW
roles:
- Internal/subscriber
- Internal/subscriber
properties:
permissionType:
default: PUBLIC
enum:
- PUBLIC
- ALLOW
- DENY
example: ALLOW
type: string
roles:
items:
example: Internal/subscriber
type: string
type: array
securitySchemes:
OAuth2Security:
flows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public class EnvironmentDTO {
@SerializedName(SERIALIZED_NAME_PROVIDER)
private String provider;

public static final String SERIALIZED_NAME_GATEWAY_TYPE = "gatewayType";
@SerializedName(SERIALIZED_NAME_GATEWAY_TYPE)
private String gatewayType = "Regular";

public static final String SERIALIZED_NAME_IS_READ_ONLY = "isReadOnly";
@SerializedName(SERIALIZED_NAME_IS_READ_ONLY)
private Boolean isReadOnly;
Expand Down Expand Up @@ -185,6 +189,29 @@ public void setProvider(String provider) {
}


public EnvironmentDTO gatewayType(String gatewayType) {

this.gatewayType = gatewayType;
return this;
}

/**
* Get gatewayType
* @return gatewayType
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "Regular", value = "")

public String getGatewayType() {
return gatewayType;
}


public void setGatewayType(String gatewayType) {
this.gatewayType = gatewayType;
}


public EnvironmentDTO isReadOnly(Boolean isReadOnly) {

this.isReadOnly = isReadOnly;
Expand Down Expand Up @@ -290,6 +317,7 @@ public boolean equals(Object o) {
Objects.equals(this.displayName, environment.displayName) &&
Objects.equals(this.description, environment.description) &&
Objects.equals(this.provider, environment.provider) &&
Objects.equals(this.gatewayType, environment.gatewayType) &&
Objects.equals(this.isReadOnly, environment.isReadOnly) &&
Objects.equals(this.vhosts, environment.vhosts) &&
Objects.equals(this.endpointURIs, environment.endpointURIs) &&
Expand All @@ -298,7 +326,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, displayName, description, provider, isReadOnly, vhosts, endpointURIs, additionalProperties);
return Objects.hash(id, name, displayName, description, provider, gatewayType, isReadOnly, vhosts, endpointURIs, additionalProperties);
}


Expand All @@ -311,6 +339,7 @@ public String toString() {
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
sb.append(" gatewayType: ").append(toIndentedString(gatewayType)).append("\n");
sb.append(" isReadOnly: ").append(toIndentedString(isReadOnly)).append("\n");
sb.append(" vhosts: ").append(toIndentedString(vhosts)).append("\n");
sb.append(" endpointURIs: ").append(toIndentedString(endpointURIs)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class SettingsDTO {
@SerializedName(SERIALIZED_NAME_SCOPES)
private List<String> scopes = null;

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

public static final String SERIALIZED_NAME_KEY_MANAGER_CONFIGURATION = "keyManagerConfiguration";
@SerializedName(SERIALIZED_NAME_KEY_MANAGER_CONFIGURATION)
private List<SettingsKeyManagerConfigurationDTO> keyManagerConfiguration = null;
Expand Down Expand Up @@ -68,6 +72,29 @@ public void setScopes(List<String> scopes) {
}


public SettingsDTO gatewayTypes(List<String> gatewayTypes) {

this.gatewayTypes = gatewayTypes;
return this;
}

/**
* Get gatewayTypes
* @return gatewayTypes
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")

public List<String> getGatewayTypes() {
return gatewayTypes;
}


public void setGatewayTypes(List<String> gatewayTypes) {
this.gatewayTypes = gatewayTypes;
}


public SettingsDTO keyManagerConfiguration(List<SettingsKeyManagerConfigurationDTO> keyManagerConfiguration) {

this.keyManagerConfiguration = keyManagerConfiguration;
Expand Down Expand Up @@ -124,13 +151,14 @@ public boolean equals(Object o) {
}
SettingsDTO settings = (SettingsDTO) o;
return Objects.equals(this.scopes, settings.scopes) &&
Objects.equals(this.gatewayTypes, settings.gatewayTypes) &&
Objects.equals(this.keyManagerConfiguration, settings.keyManagerConfiguration) &&
Objects.equals(this.analyticsEnabled, settings.analyticsEnabled);
}

@Override
public int hashCode() {
return Objects.hash(scopes, keyManagerConfiguration, analyticsEnabled);
return Objects.hash(scopes, gatewayTypes, keyManagerConfiguration, analyticsEnabled);
}


Expand All @@ -139,6 +167,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SettingsDTO {\n");
sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n");
sb.append(" gatewayTypes: ").append(toIndentedString(gatewayTypes)).append("\n");
sb.append(" keyManagerConfiguration: ").append(toIndentedString(keyManagerConfiguration)).append("\n");
sb.append(" analyticsEnabled: ").append(toIndentedString(analyticsEnabled)).append("\n");
sb.append("}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5153,6 +5153,10 @@ components:
provider:
type: string
example: wso2
gatewayType:
type: string
example: Regular
default: Regular
isReadOnly:
type: boolean
readOnly: true
Expand Down Expand Up @@ -5384,6 +5388,10 @@ components:
type: array
items:
type: string
gatewayTypes:
type: array
items:
type: string
keyManagerConfiguration:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
391b6c495dd81ff0bce5c843cc2eee5079b934390ab6a51a0241e883cb34d575
51e2f49c8ea45de5a84d917d28a455ab2094d705fe7c9a8f4a6aaa1fdfc80b7f
Original file line number Diff line number Diff line change
Expand Up @@ -16718,6 +16718,7 @@ components:
responseCachingEnabled: true
type: HTTP
enableSchemaValidation: false
gatewayType: wso2/synapse
context: pizza
createdTime: createdTime
id: 01234567-0123-0123-0123-012345678901
Expand Down Expand Up @@ -17314,6 +17315,13 @@ components:
example: wso2
title: field to identify gateway vendor
type: string
gatewayType:
default: wso2/synapse
description: The gateway type selected for the API policies. Accepts one
of the following. wso2/synapse, wso2/apk.
example: wso2/synapse
title: Field to identify gateway type.
type: string
asyncTransportProtocols:
description: |
Supported transports for the async API (http and/or https).
Expand Down Expand Up @@ -20421,6 +20429,9 @@ components:
websubHttpsPort: 8021
httpsPort: 443
crossTenantSubscriptionEnabled: false
gatewayTypes:
- Regular
- APK
defaultSubscriptionPolicy: defaultSubscriptionPolicy
securityAuditProperties: '{}'
scopes:
Expand All @@ -20439,6 +20450,13 @@ components:
items:
$ref: '#/components/schemas/Environment'
type: array
gatewayTypes:
example:
- Regular
- APK
items:
type: string
type: array
scopes:
example:
- apim:api_create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Name | Type | Description | Notes
**serviceInfo** | [**APIServiceInfoDTO**](APIServiceInfoDTO.md) | | [optional]
**advertiseInfo** | [**AdvertiseInfoDTO**](AdvertiseInfoDTO.md) | | [optional]
**gatewayVendor** | **String** | | [optional]
**gatewayType** | **String** | The gateway type selected for the API policies. Accepts one of the following. wso2/synapse, wso2/apk. | [optional]
**asyncTransportProtocols** | **List&lt;String&gt;** | Supported transports for the async API (http and/or https). | [optional]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**devportalUrl** | **String** | The Developer Portal URL | [optional]
**environment** | [**List&lt;EnvironmentDTO&gt;**](EnvironmentDTO.md) | | [optional]
**gatewayTypes** | **List&lt;String&gt;** | | [optional]
**scopes** | **List&lt;String&gt;** | | [optional]
**monetizationAttributes** | [**List&lt;MonetizationAttributeDTO&gt;**](MonetizationAttributeDTO.md) | | [optional]
**securityAuditProperties** | [**Object**](.md) | | [optional]
Expand Down
Loading

0 comments on commit 1c41c57

Please sign in to comment.