Skip to content

Commit 97aaabf

Browse files
authored
Merge branch 'master' into 4.3.0-kernel-upgrade
2 parents dfff0ae + 292c4e1 commit 97aaabf

File tree

192 files changed

+27512
-3252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+27512
-3252
lines changed

.github/workflows/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
segment: group1
6161
- id: 2
6262
segment: group2
63+
- id: 3
64+
segment: group3
65+
- id: 4
66+
segment: group4
6367
fail-fast: false
6468
steps:
6569
- name: Run hostname

components/apimgt/org.wso2.carbon.apimgt.api/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>org.wso2.carbon.apimgt</groupId>
1313
<artifactId>apimgt</artifactId>
14-
<version>9.29.14-SNAPSHOT</version>
14+
<version>9.29.34-SNAPSHOT</version>
1515
<relativePath>../pom.xml</relativePath>
1616
</parent>
1717

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIAdmin.java

+45
Original file line numberDiff line numberDiff line change
@@ -484,4 +484,49 @@ boolean isScopeExists(String username, String scopeName)
484484
Policy[] getPolicies(int tenantId, String level) throws APIManagementException;
485485

486486
Policy getPolicyByNameAndType(int tenantId, String level, String name) throws APIManagementException;
487+
488+
/**
489+
* Update the Api Provider of a given Api Id
490+
*
491+
* @param apiId Api ID
492+
* @param provider New ProviderName/Owner of the Api
493+
* @param organisation Organisation
494+
* @throws APIManagementException
495+
*/
496+
void updateApiProvider(String apiId, String provider, String organisation) throws APIManagementException;
497+
498+
/**
499+
* Get/Search All Apis in admin portal
500+
*
501+
* @param searchQuery Api name search query
502+
* @param organization organization
503+
* @param start
504+
* @param end
505+
* @return
506+
* @throws APIManagementException
507+
*/
508+
Map<String, Object> searchPaginatedApis(String searchQuery, String organization, int start, int end)
509+
throws APIManagementException;
510+
511+
/**
512+
* This method used to retrieve global key manager configurations
513+
* @return KeyManagerConfigurationDTO list
514+
* @throws APIManagementException if error occurred
515+
*/
516+
List<KeyManagerConfigurationDTO> getGlobalKeyManagerConfigurations() throws APIManagementException;
517+
518+
/**
519+
* This method used to retrieve global key manager with Id
520+
* @param id uuid of key manager
521+
* @return KeyManagerConfigurationDTO for retrieved data
522+
* @throws APIManagementException
523+
*/
524+
KeyManagerConfigurationDTO getGlobalKeyManagerConfigurationById(String id) throws APIManagementException;
525+
526+
/**
527+
* This method used to delete global key manager
528+
* @param id uuid of key manager
529+
* @throws APIManagementException
530+
*/
531+
void deleteGlobalKeyManagerConfigurationById(String id) throws APIManagementException;
487532
}

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/ExceptionCodes.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,13 @@ public enum ExceptionCodes implements ErrorHandler {
541541
REVISION_ALREADY_DEPLOYED(902005, "Revision deployment state conflicted", 409,
542542
"Revision deployment request conflicted with the current deployment state of the revision %s. Please try again later", false),
543543
INVALID_API_ID(902006, "Invalid API ID", 404, "The provided API ID is not found %s", false),
544+
INVALID_GATEWAY_TYPE(902007, "Invalid Gateway Type", 400, "Invalid Gateway Type. %s", false),
544545
INVALID_ENDPOINT_CONFIG(902012, "Endpoint config value(s) is(are) not valid", 400, "Endpoint config value(s) is(are) not valid"),
546+
ARTIFACT_SYNC_HTTP_REQUEST_FAILED(903009, "Error while retrieving from remote endpoint", 500, "Error while executing HTTP request to retrieve from remote endpoint"),
545547
KEY_MANAGER_RESTRICTED_FOR_USER(902013, "Unauthorized Access to Key Manager", 403, "Key Manager is Restricted for this user"),
546-
ARTIFACT_SYNC_HTTP_REQUEST_FAILED(903009, "Error while retrieving from remote endpoint", 500, "Error while executing HTTP request to retrieve from remote endpoint");
548+
// Admin portal get apis and api provider change related errors
549+
CHANGE_API_PROVIDER_FAILED(903011, "Error while changing the API provider", 500, "Error while changing the API provider in the registry or DB"),
550+
GET_SEARCH_APIS_IN_ADMIN_FAILED(903012, "Error while getting the apis", 500, "Error while getting/searching the apis from registry");
547551

548552
private final long errorCode;
549553
private final String errorMessage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
3+
*
4+
* WSO2 LLC. licenses this file to you under the Apache License,
5+
* Version 2.0 (the "License"); you may not use this file except
6+
* in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.
17+
*/
18+
package org.wso2.carbon.apimgt.api.model;
19+
20+
/**
21+
* This class represent the minimized view of the Application in api model for Key manager operations in admin REST API.
22+
*/
23+
public class ApplicationInfoKeyManager extends ApplicationInfo {
24+
25+
private String organization;
26+
27+
public String getOrganization() {
28+
29+
return organization;
30+
}
31+
32+
public void setOrganization(String organization) {
33+
34+
this.organization = organization;
35+
}
36+
37+
}

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/Environment.java

+9
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class Environment implements Serializable {
5252
private boolean isReadOnly;
5353
private List<VHost> vhosts = new ArrayList<>();
5454
private String provider;
55+
private String gatewayType;
5556
private Map<String, String> additionalProperties = new HashMap<>();
5657

5758
public boolean isDefault() {
@@ -216,6 +217,14 @@ public void setProvider(String provider) {
216217
this.provider = provider;
217218
}
218219

220+
public String getGatewayType() {
221+
return gatewayType;
222+
}
223+
224+
public void setGatewayType(String gatewayType) {
225+
this.gatewayType = gatewayType;
226+
}
227+
219228
public Map<String, String> getAdditionalProperties() {
220229
return additionalProperties;
221230
}

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/OperationPolicy.java

+16-3
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ public boolean equals(Object o) {
9898
if (o == null || getClass() != o.getClass())
9999
return false;
100100
OperationPolicy policyObj = (OperationPolicy) o;
101-
return policyId == policyObj.policyId && policyName == policyObj.policyName && policyVersion == policyObj.policyVersion
102-
&& direction.equals(policyObj.direction) && parameters.equals(policyObj.parameters);
101+
return Objects.equals(policyName, policyObj.policyName) && Objects.equals(policyVersion,
102+
policyObj.policyVersion) && Objects.equals(direction, policyObj.direction) && Objects.equals(
103+
parameters, policyObj.parameters) && Objects.equals(policyId, policyObj.policyId);
103104
}
104105

105106
@Override
106107
public int hashCode() {
107-
108108
return Objects.hash(policyName, policyVersion, direction, parameters, policyId);
109109
}
110110

@@ -113,4 +113,17 @@ public int compareTo(OperationPolicy o) {
113113

114114
return this.order - o.getOrder();
115115
}
116+
117+
@Override
118+
public String toString() {
119+
120+
return "operationPolicies {" +
121+
", policyName ='" + policyName + '\'' +
122+
", policyVersion ='" + policyVersion + '\'' +
123+
", direction ='" + direction + '\'' +
124+
", order ='" + order + '\'' +
125+
", policyId ='" + policyId + '\'' +
126+
", parameters ='" + parameters + '\'' +
127+
'}';
128+
}
116129
}

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/subscription/API.java

+14
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818

1919
package org.wso2.carbon.apimgt.api.model.subscription;
2020

21+
import org.wso2.carbon.apimgt.api.model.OperationPolicy;
22+
import org.wso2.carbon.apimgt.api.model.policy.APIPolicy;
23+
2124
import java.util.HashMap;
25+
import java.util.HashSet;
2226
import java.util.Map;
27+
import java.util.Set;
2328

2429
/**
2530
* Entity for keeping API related information.
@@ -39,6 +44,7 @@ public class API implements CacheableEntity<String> {
3944
private String status;
4045
private String revision;
4146
private String organization;
47+
private Set<OperationPolicy> apiPolicies = new HashSet<>();
4248

4349
public String getRevision() {
4450

@@ -199,4 +205,12 @@ public String getOrganization() {
199205
public void setOrganization(String organization) {
200206
this.organization = organization;
201207
}
208+
209+
public void setApiPolicy(OperationPolicy apiPolicy) {
210+
this.apiPolicies.add(apiPolicy);
211+
}
212+
213+
public Set<OperationPolicy> getApiPolicies() {
214+
return apiPolicies;
215+
}
202216
}

components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/subscription/URLMapping.java

+13
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818

1919
package org.wso2.carbon.apimgt.api.model.subscription;
2020

21+
import org.wso2.carbon.apimgt.api.model.OperationPolicy;
22+
2123
import java.util.ArrayList;
24+
import java.util.HashSet;
2225
import java.util.List;
2326
import java.util.Objects;
27+
import java.util.Set;
2428

2529
public class URLMapping {
2630

@@ -29,6 +33,7 @@ public class URLMapping {
2933
private String httpMethod;
3034
private String urlPattern;
3135
private List<String> scopes = new ArrayList<>();
36+
private Set<OperationPolicy> operationPolicies = new HashSet<>();
3237

3338

3439
public String getHttpMethod() {
@@ -79,6 +84,13 @@ public List<String> getScopes() {
7984
return scopes;
8085
}
8186

87+
public void setOperationPolicies(OperationPolicy operationPolicy){
88+
this.operationPolicies.add(operationPolicy);
89+
}
90+
public Set<OperationPolicy> getOperationPolicies(){
91+
return operationPolicies;
92+
}
93+
8294
@Override
8395
public boolean equals(Object o) {
8496

@@ -105,6 +117,7 @@ public String toString() {
105117
", authScheme ='" + authScheme + '\'' +
106118
", httpMethod ='" + httpMethod + '\'' +
107119
", urlPattern ='" + urlPattern + '\'' +
120+
", operationPolicies ='" + operationPolicies + '\'' +
108121
'}';
109122
}
110123
}

components/apimgt/org.wso2.carbon.apimgt.broker.lifecycle/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>apimgt</artifactId>
66
<groupId>org.wso2.carbon.apimgt</groupId>
7-
<version>9.29.14-SNAPSHOT</version>
7+
<version>9.29.34-SNAPSHOT</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

components/apimgt/org.wso2.carbon.apimgt.cache.invalidation/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>apimgt</artifactId>
2121
<groupId>org.wso2.carbon.apimgt</groupId>
22-
<version>9.29.14-SNAPSHOT</version>
22+
<version>9.29.34-SNAPSHOT</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

components/apimgt/org.wso2.carbon.apimgt.cleanup.service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>org.wso2.carbon.apimgt</groupId>
2121
<artifactId>apimgt</artifactId>
22-
<version>9.29.14-SNAPSHOT</version>
22+
<version>9.29.34-SNAPSHOT</version>
2323
<relativePath>../pom.xml</relativePath>
2424
</parent>
2525

components/apimgt/org.wso2.carbon.apimgt.common.analytics/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.wso2.carbon.apimgt</groupId>
55
<artifactId>apimgt</artifactId>
6-
<version>9.29.14-SNAPSHOT</version>
6+
<version>9.29.34-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

components/apimgt/org.wso2.carbon.apimgt.common.analytics/src/main/java/org/wso2/carbon/apimgt/common/analytics/publishers/dto/API.java

+21
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
package org.wso2.carbon.apimgt.common.analytics.publishers.dto;
1919

20+
import java.util.ArrayList;
21+
import java.util.List;
22+
2023
/**
2124
* Api attribute in analytics event.
2225
*/
@@ -27,6 +30,8 @@ public class API {
2730
private String apiVersion;
2831
private String apiCreator;
2932
private String apiCreatorTenantDomain;
33+
private List<URITemplate> uriTemplates = new ArrayList<>();
34+
private List<OperationPolicy> apiPolicies = new ArrayList<>();
3035

3136
public String getApiId() {
3237
return apiId;
@@ -75,4 +80,20 @@ public String getApiCreatorTenantDomain() {
7580
public void setApiCreatorTenantDomain(String apiCreatorTenantDomain) {
7681
this.apiCreatorTenantDomain = apiCreatorTenantDomain;
7782
}
83+
84+
public List<URITemplate> getUriTemplates() {
85+
return new ArrayList(uriTemplates);
86+
}
87+
88+
public void setUriTemplates(List<URITemplate> uriTemplates) {
89+
this.uriTemplates = new ArrayList(uriTemplates);
90+
}
91+
92+
public void setApiPolicies(List<OperationPolicy> apiPolicies) {
93+
this.apiPolicies = new ArrayList(apiPolicies);
94+
}
95+
96+
public List<OperationPolicy> getApiPolicies() {
97+
return new ArrayList(apiPolicies);
98+
}
7899
}

0 commit comments

Comments
 (0)