Skip to content

Commit 2af0dc8

Browse files
author
Chris Wiechmann
committed
Merge branch 'develop' into test-with-7.7-20200130
2 parents b4cfecd + 5348715 commit 2af0dc8

13 files changed

Lines changed: 59 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Added
9+
- Added new CSV-Export for applications (See issue [#70](https://github.com/Axway-API-Management-Plus/apim-cli/issues/70))
10+
811
### Fixed
912
- apim.sh now starts the CLI in the current directory (See issue [#60](https://github.com/Axway-API-Management-Plus/apim-cli/issues/60))
13+
- ErrorHandling improved when API-Config file can't be found
14+
- HTTP-Basic Outbound handling fixed, if no password is given
15+
- CSRF-Token handling improved (See issue [#67](https://github.com/Axway-API-Management-Plus/apim-cli/issues/67))
16+
- Error when updating organization (See issue [#69](https://github.com/Axway-API-Management-Plus/apim-cli/issues/69))
1017

1118
### Changed
12-
- Added 7.7-July release to the list of tested releases
19+
- Added 7.7-July and 7.6.2-SP5 releases to the list of tested releases
1320
- apim.sh & apim.bat script now support path with blanks. Thanks to [@cbrowet-axway](https://github.com/cbrowet-axway)
1421
- Handling NPE for Application credential search (See issue [#57](https://github.com/Axway-API-Management-Plus/apim-cli/issues/57))
1522
- If FE-Security is a Custom-Policy, the name of the Custom-Policy is now exported (See issue [#61](https://github.com/Axway-API-Management-Plus/apim-cli/issues/61))
1623
- Toggle ignoreCache added to the usage (See issue [#52](https://github.com/Axway-API-Management-Plus/apim-cli/issues/52))
24+
- Added new forceUpdate flag to force re-creation (See issue [#56](https://github.com/Axway-API-Management-Plus/apim-cli/issues/56))
1725

1826
## [1.2.1] 2020-07-22
1927
### Fixed

modules/apim-adapter/src/main/java/com/axway/apim/adapter/APIManagerAdapter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ public static synchronized void deleteInstance() throws AppException {
151151
LOG.debug("Closing cache end");
152152
}
153153
if(APIManagerAdapter.instance!=null) {
154-
APIManagerAdapter.instance.logoutFromAPIManager(false); // Logout potentially logged in OrgAdmin
155-
APIManagerAdapter.instance.logoutFromAPIManager(true); // Logout potentially logged in Admin
154+
if(hasOrgAdmin()) APIManagerAdapter.instance.logoutFromAPIManager(false); // Logout potentially logged in OrgAdmin
155+
if(hasAdminAccount()) APIManagerAdapter.instance.logoutFromAPIManager(true); // Logout potentially logged in Admin
156156
APIManagerAdapter.instance = null;
157157
}
158158
APIManagerAdapter.apiManagerVersion = null;
@@ -245,13 +245,12 @@ public void loginToAPIManager(boolean useAdminClient) throws AppException {
245245
}
246246
}
247247

248-
public void logoutFromAPIManager(boolean useAdminClient) throws AppException {
249-
if(useAdminClient && !hasAdminAccount()) return;
248+
public void logoutFromAPIManager(boolean orgAdmin) throws AppException {
250249
URI uri;
251250
HttpResponse httpResponse = null;
252251
try {
253252
uri = new URIBuilder(cmd.getAPIManagerURL()).setPath(RestAPICall.API_VERSION+"/login").build();
254-
DELRequest logoutRequest = new DELRequest(uri, useAdminClient);
253+
DELRequest logoutRequest = new DELRequest(uri, orgAdmin);
255254
httpResponse = logoutRequest.execute();
256255
int statusCode = httpResponse.getStatusLine().getStatusCode();
257256
if(statusCode != 204){
@@ -674,8 +673,9 @@ public static boolean hasAdminAccount() throws AppException {
674673

675674
/**
676675
* @return true, if an OrgAdmin is the primary user (additional Admin-Credentials may have provided anyway)
676+
* @throws AppException when the API-Manager instance is not initialized
677677
*/
678-
public boolean isUsingOrgAdmin() {
679-
return usingOrgAdmin;
678+
public static boolean hasOrgAdmin() throws AppException {
679+
return APIManagerAdapter.getInstance().usingOrgAdmin;
680680
}
681681
}

modules/apim-adapter/src/main/java/com/axway/apim/lib/utils/rest/APIMHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class APIMHttpClient {
4444

4545
private String csrfToken;
4646

47-
public static void deleteInstance() {
47+
public static void deleteInstances() {
4848
instances = new HashMap<Boolean, APIMHttpClient>();
4949
}
5050

modules/apim-adapter/src/test/resources/apimanager/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Perform the following steps:
2121
cd apigw-emt-scripts-2.0.0-SNAPSHOT
2222
./build_base_image.py --installer=../APIGateway_x.x.x_xxx_Install_linux-x86-64_BNxxxxxx.run --os=centos7
2323
./gen_domain_cert.py --default-cert
24-
./build_gw_image.py --license=multiple.lic --default-cert --fed=$HOME/apimanager-swagger-promote/modules/swagger-promote-core/src/test/resources/apimanager/swagger-promote-7.6.2.fed --merge-dir $HOME/apimanager-swagger-promote/modules/swagger-promote-core/src/test/resources/apimanager/merge-dir/apigateway --out-image=api-gw-mgr:7.6.2-SP3
24+
./build_gw_image.py --license=multiple.lic --default-cert --fed=$HOME/apim-cli/modules/apis/src/test/resources/apimanager/swagger-promote-7.6.2.fed --merge-dir $HOME/apim-cli/modules/apis/src/test/resources/apimanager/merge-dir/apigateway --out-image=api-gw-mgr:7.6.2-SP5
2525
docker images
26-
docker tag api-gw-mgr:7.6.2-SP3 docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:7.6.2-SP3
26+
docker tag api-gw-mgr:7.6.2-SP5 docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:7.6.2-SP5
2727
docker login docker-registry.demo.axway.com
28-
docker push docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:7.6.2-SP3
28+
docker push docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:7.6.2-SP5
2929
```
3030

3131
### Added Untrusted Docker-Registry

modules/apis/src/main/java/com/axway/apim/APIExportApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private static void deleteInstances() throws AppException {
169169
// We need to clean some Singleton-Instances, as tests are running in the same JVM
170170
APIManagerAdapter.deleteInstance();
171171
ErrorState.deleteInstance();
172-
APIMHttpClient.deleteInstance();
172+
APIMHttpClient.deleteInstances();
173173
}
174174

175175
@Override

modules/apis/src/main/java/com/axway/apim/APIImportApp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static int importAPI(String args[]) {
5454
// We need to clean some Singleton-Instances, as tests are running in the same JVM
5555
APIManagerAdapter.deleteInstance();
5656
ErrorState.deleteInstance();
57-
APIMHttpClient.deleteInstance();
57+
APIMHttpClient.deleteInstances();
5858
RollbackHandler.deleteInstance();
5959

6060
APIImportParams params = new APIImportParams(new APIImportCLIOptions(args));
@@ -63,7 +63,7 @@ public static int importAPI(String args[]) {
6363
APIManagerAdapter apimAdapter = APIManagerAdapter.getInstance();
6464

6565
APIImportConfigAdapter configAdapter = new APIImportConfigAdapter(params.getValue("config"),
66-
params.getValue("stage"), params.getValue("apidefinition"), apimAdapter.isUsingOrgAdmin());
66+
params.getValue("stage"), params.getValue("apidefinition"), APIManagerAdapter.hasOrgAdmin());
6767
// Creates an API-Representation of the desired API
6868
API desiredAPI = configAdapter.getDesiredAPI();
6969
//

modules/apis/src/test/java/com/axway/apim/test/rollback/RollbackTestIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio
7373

7474
// In Version 7.6.2 SP2 (only this version) the API-Manager is able to create a FE-API based on host: https://unknown.host.com:443 for any reason
7575
// found no other way to force API-Manager to fail on initial FE-API creation!
76-
// Execute this test only on higher version for now
77-
if(APIManagerAdapter.hasAPIManagerVersion("7.6.2 SP3") &&
78-
(!APIManagerAdapter.hasAPIManagerVersion("7.7 SP1") || !APIManagerAdapter.hasAPIManagerVersion("7.6.2 SP5"))) {
76+
// Execute this test on later versions only for now
77+
if(APIManagerAdapter.hasAPIManagerVersion("7.6.2 SP3") && !APIManagerAdapter.hasAPIManagerVersion("7.6.2 SP5")) {
7978
echo("####### This will re-create the API, but it fails #######");
8079
createVariable(ImportTestAction.API_DEFINITION, "/com/axway/apim/test/files/basic/petstore2.json");
8180
createVariable(ImportTestAction.API_CONFIG, "/com/axway/apim/test/files/rollback/backendbasepath-config.json");
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sep=,
2+
ID,Organization,Name,Email,Phone,State,Enabled,API-Name,API-Version,Access created by,Access created on
3+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Appointment,DSTU2,apiadmin,Fri Aug 28 08:51:18 CEST 2020
4+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR CarePlan,DSTU2,apiadmin,Fri Aug 28 08:53:38 CEST 2020
5+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Condition,DSTU2,apiadmin,Fri Aug 28 08:49:55 CEST 2020
6+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Device,DSTU2,apiadmin,Fri Aug 28 08:49:56 CEST 2020
7+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Encounter,DSTU2,apiadmin,Fri Aug 28 08:49:58 CEST 2020
8+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Location,DSTU2,apiadmin,Fri Aug 28 08:49:59 CEST 2020
9+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Observation,DSTU2,apiadmin,Fri Aug 28 08:50:02 CEST 2020
10+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Organization,DSTU2,apiadmin,Fri Aug 28 08:50:03 CEST 2020
11+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Patient,DSTU2,apiadmin,Fri Aug 28 08:50:07 CEST 2020
12+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Practitioner,DSTU2,apiadmin,Fri Aug 28 08:50:08 CEST 2020
13+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Procedure,DSTU2,apiadmin,Fri Aug 28 08:50:10 CEST 2020
14+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Resource (Any),DSTU2,apiadmin,Fri Aug 28 08:50:11 CEST 2020
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sep=,
2+
ID,Organization,Name,Email,Phone,State,Enabled,API-Name,API-Version,Access created by,Access created on
3+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Appointment,DSTU2,apiadmin,Fri Aug 28 08:51:18 CEST 2020
4+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR CarePlan,DSTU2,apiadmin,Fri Aug 28 08:53:38 CEST 2020
5+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Condition,DSTU2,apiadmin,Fri Aug 28 08:49:55 CEST 2020
6+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Device,DSTU2,apiadmin,Fri Aug 28 08:49:56 CEST 2020
7+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Encounter,DSTU2,apiadmin,Fri Aug 28 08:49:58 CEST 2020
8+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Location,DSTU2,apiadmin,Fri Aug 28 08:49:59 CEST 2020
9+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Observation,DSTU2,apiadmin,Fri Aug 28 08:50:02 CEST 2020
10+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Organization,DSTU2,apiadmin,Fri Aug 28 08:50:03 CEST 2020
11+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Patient,DSTU2,apiadmin,Fri Aug 28 08:50:07 CEST 2020
12+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Practitioner,DSTU2,apiadmin,Fri Aug 28 08:50:08 CEST 2020
13+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Procedure,DSTU2,apiadmin,Fri Aug 28 08:50:10 CEST 2020
14+
7c7c26f9-ddd2-4af0-b85e-4409a5b9795e,FHIR,FHIR - Everything Health,,,approved,true,FHIR Resource (Any),DSTU2,apiadmin,Fri Aug 28 08:50:11 CEST 2020

modules/apps/src/main/java/com/axway/apim/appexport/ApplicationExportApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static int runExport(AppExportParams params, ExportImpl exportImpl) {
8282
// We need to clean some Singleton-Instances, as tests are running in the same JVM
8383
APIManagerAdapter.deleteInstance();
8484
ErrorState.deleteInstance();
85-
APIMHttpClient.deleteInstance();
85+
APIMHttpClient.deleteInstances();
8686

8787
APIMgrAppsAdapter appAdapter = new APIMgrAppsAdapter();
8888
ApplicationExporter exporter = ApplicationExporter.create(exportImpl, params);

0 commit comments

Comments
 (0)