diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 9f66a5c71..70e9fe174 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -4,9 +4,10 @@ on: [push] env: CASSANDRA_DOCKER_IMAGE: cassandra:4.0.11 - APIM_DOCKER_IMAGE: docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:7.7-20231130 + APIM_DOCKER_IMAGE: docker.repository.axway.com/apigateway-docker-prod/7.7/gateway:7.7.0.20231130-2-BN0052-ubi9 CACHE_FILE_APIM: api-manager_7_7_20231130.cache.tar CACHE_FILE_CASSANDRA: cassandra_4_0_11.cache.tar + FED_FILE: swagger-promote-7.7-20231130.fed LOG_LEVEL: info jobs: @@ -37,7 +38,7 @@ jobs: name: Login to Axway demo docker registry uses: docker/login-action@v2 with: - registry: docker-registry.demo.axway.com + registry: docker.repository.axway.com username: ${{ secrets.AXWAY_DOCKER_REG_USER }} password: ${{ secrets.AXWAY_DOCKER_REG_PASS }} - if: steps.cache-docker.outputs.cache-hit != 'true' diff --git a/docker-compose.yml b/docker-compose.yml index be93380c2..9b8efab20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,9 @@ services: image: ${APIM_DOCKER_IMAGE} volumes: - ${GITHUB_WORKSPACE}/licenses:/opt/Axway/apigateway/conf/licenses + - ${GITHUB_WORKSPACE}/modules/apim-adapter/src/test/resources/apimanager/${FED_FILE}:/merge/fed + - ${GITHUB_WORKSPACE}/modules/apim-adapter/src/test/resources/apimanager/mandatoryFiles.yaml:/merge/mandatoryFiles + - ${GITHUB_WORKSPACE}/modules/apim-adapter/src/test/resources/apimanager/merge/apigateway:/merge/apigateway environment: - ACCEPT_GENERAL_CONDITIONS=yes ports: diff --git a/modules/apim-adapter/src/test/resources/apimanager/buildDockerImage.sh b/modules/apim-adapter/src/test/resources/apimanager/buildDockerImage.sh index 1f4b84fab..1a625cfa3 100755 --- a/modules/apim-adapter/src/test/resources/apimanager/buildDockerImage.sh +++ b/modules/apim-adapter/src/test/resources/apimanager/buildDockerImage.sh @@ -143,7 +143,7 @@ cp -v $testSources/runInstall.sh Dockerfiles/gateway-base/scripts/runInstall.sh echo "########### Create Base-Image ###################" ./build_base_image.py --installer=../$installer --os=centos7 --out-image apigw-base:$version echo "########### Create API-Gateway-Image ###################" -./build_gw_image.py --license=../multiple.lic --default-cert --fed=$testSources/$fedFile --merge-dir $testSources/merge-dir/apigateway --parent-image apigw-base:$version --out-image=docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:$version +./build_gw_image.py --license=../multiple.lic --default-cert --fed=$testSources/$fedFile --merge-dir $testSources/merge/apigateway --parent-image apigw-base:$version --out-image=docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:$version echo "########### Push Image ###################" docker push docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:$version diff --git a/modules/apim-adapter/src/test/resources/apimanager/mandatoryFiles.yaml b/modules/apim-adapter/src/test/resources/apimanager/mandatoryFiles.yaml new file mode 100644 index 000000000..fe9b08fbe --- /dev/null +++ b/modules/apim-adapter/src/test/resources/apimanager/mandatoryFiles.yaml @@ -0,0 +1,4 @@ +required: + - /merge/apigateway/groups/emt-group/emt-service/conf/jvm.xml + - /merge/apigateway/webapps/apiportal/vordel/apiportal/app/app.config + - /merge/fed diff --git a/modules/apim-adapter/src/test/resources/apimanager/merge-dir/apigateway/groups/emt-group/emt-service/conf/jvm.xml b/modules/apim-adapter/src/test/resources/apimanager/merge-dir/apigateway/groups/emt-group/emt-service/conf/jvm.xml deleted file mode 100644 index a9b43900c..000000000 --- a/modules/apim-adapter/src/test/resources/apimanager/merge-dir/apigateway/groups/emt-group/emt-service/conf/jvm.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/apim-adapter/src/test/resources/apimanager/merge-dir/apigateway/webapps/apiportal/vordel/apiportal/app/app.config b/modules/apim-adapter/src/test/resources/apimanager/merge-dir/apigateway/webapps/apiportal/vordel/apiportal/app/app.config deleted file mode 100644 index 3a406181b..000000000 --- a/modules/apim-adapter/src/test/resources/apimanager/merge-dir/apigateway/webapps/apiportal/vordel/apiportal/app/app.config +++ /dev/null @@ -1,467 +0,0 @@ -dojoConfig.app = { - demo: false, - uml: false, - /* - When enabled SSO users are authenticated in the IdP and their authorizations are configured in the IdP and cannot be edited in the UI. - When disabled SSO users are authenticated in the IdP but their authorizations can modified in the UI. - */ - ssoAuthorizationEnabled: true, - /* - Flag to control case-insensitive grid sorting - set it to true if "abc" is to be treated the same as "ABC" - The user can change this value via the corresponding setting in "API Manager settings" - */ - gridSortIgnoreCase: true, - - /* - Flag to determine if API collections can be exported as clear text - Set this value to false if API Export as clear text is not allowed (i.e. the exported file is always encrypted) - Set this value to true if API Export as clear text is allowed (i.e. the user can choose to encrypt the file or not) - */ - allowAPIExportAsClearText: false, - - /* - Allows the Try-It to link to the node manager to view the transaction log. - */ - nodemanager: 'https://localhost:8090', - - /* - Allows custom password validation, e.g. you can test for a mix of lower-case, - upper-case and special characters. If they validate, return 'true', otherwise, - return the error message or 'false'. These rules supplement the - minimumPasswordLength restriction, as configured in Settings. E.g.: - return /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/.test(password); - */ - validatePassword: function(password) { - return true; - }, - - /* - A custom password validation message for invalid passwords, e.g. password must - be a mix between upper-case, lower-case, mixed-punctuation and special-characters. - */ - invalidPasswordMessage: '', - - /* - The login name restrictions are set in API Manager settings. If you change them there, - then you should change this message to reflect. - */ - loginNameValidationMessage: 'The login name does not match the configured regular expression in "API Manager settings"', - - /* - Specifies the API Manager settings polling interval in milliseconds. Default is 15000. - The minimum recommended interval is 5000 ms to avoid unnecessary traffic and application overhead. - Polling can be disabled if set to 0. - */ - polling_interval: 15000, - - /* - Specifies configuration for the Amplify Connected Menu. This menu is switched on by default. - */ - connectedServicesMenu: { - // specifies whether or not to render the connected services menu in offline-mode - // if set to true, this will hide the 'search', 'help' and 'platform' controls, regardless - // of what the 'showSearch', 'showHelp' or 'showPlatform' are set to. - headerOffline: false, - - // specifies whether or not to render the documentation/help 'search' field; defaults to true - showSearch: true, - - // specifies whether or not to render the 'help' button; defaults to true - showHelp: true, - - // specifies whether or not to render the 'platform' button; defaults to true - showPlatform: true - }, - - /* - Specifies the Regular Expression pattern used to validate HTTP URLs (allows selector syntax & path parameters to be used) - */ - urlValidationHttp: "(^[\\/])|^(https?):\\/\\/(((([a-zA-Z0-9_.-]|%[0-9a-fA-F]{2}){1,256})|(\\${[a-zA-Z0-9-._\" +()[\\]]+})+)(:((\\d+)|(\\${[a-zA-Z0-9-._\" +()[\\]]+})))?(((\\/([a-zA-Z0-9-._~!$&'()*+,;=:@]|%[0-9a-fA-F]{2})*)*)|(\\/+\\$?{[a-zA-Z0-9-._\" +()[\\]]+}\\/*)+)*(\\?(([a-zA-Z0-9-._~!$&'()*+,;=:\\/?@]|%[0-9a-fA-F]{2})*))?(#(([a-zA-Z0-9-._~!$&'()*+,;=:\\/?@]|%[0-9a-fA-F]{2})*))?)?$", - - /* - Specifices the Regular Expression pattern user to validate phone numbers - */ - phoneRegex: '^[+\\-()#* 0-9]*$', - - /* - Message to show when phone number is not valid - */ - invalidPhoneMessage: 'Not a valid phone number', - - /* - Specifies the Regular Expression pattern used to validate URIs for Backend API -> Resource Path - */ - uriValidationAllowsEmpty: "^[\\/]{1}((\\$?{[a-zA-Z0-9-._\" +()\\[\\]]+}|([a-zA-Z0-9._~!$&'()*,;=:@.\\+~=\\/?&-]|%[0-9a-fA-F]{2})+)[\\/]?)*$", - - /* - Specifies the Regular Expression pattern used to validate URIs for Frontend API -> Resource Path - */ - uriValidation: "([\\/]([a-zA-Z0-9._~!$&'()*,;=:@.\\+~=\\/?&-]|%[0-9a-fA-F]{2})+|(\\$?{[a-zA-Z0-9-._\" +()\\[\\]]+}))+[\\/]?", - - /* - Specifies the Regular Expression pattern used to validate URIs for Backend API -> API Methods -> Path - */ - apiMethodUriValidation: "(^[\\/])(.*)", - - /* - You can define custom properties in this file for user, organization, and - application entities. There are three sections below, corresponding to the - entities. Custom properties will persist with the entity using the API. - For user entities, the custom properties can be set during registration. - - Custom properties are defined as a customPropertiesConfig fragment with a - name, e.g.: - - // A unique property key ID that is not a reserved ID - mycustomproperty: { - // - // A friendly label for the property - label: 'My Property', - // - // Optional. One of: custom (default), switch, select or number - type: 'custom', - // - // Optional, either: false, true. Overrides permissions - disabled: false, - // - // Optional, either: false, true. - required: false, - // - // Optional, help text - help: 'This is help text', - // - // Optional. Read/write permissions per-role. By default, the property is 'read', 'write' and 'visible' by all. Note, if the visible field is false - // the custom proprety will not be displayed in the UI, regardless of what the 'read' field is set to. Also, the permissions defined here purely - // effect the API Manager UI; i.e. when 'write' is set to false, the REST APIs employed to modify the User, Organization, Application and API entities - // can be invoked out-of-band of the UI, thus circumventing the restrictions set for the UI. - permissions: { - admin: { read: true, write: true, visible: true, visible: true }, - oadmin: { read: true, write: true, visible: true, visible: true }, - user: { read: true, write: true, visible: true, visible: true } - }, - // - // Optional, but required for 'switch' and 'select'. 'switch' is required to have 2 options. 'select' is required to have at least 1 option. - options: [ - {value: true, label: 'One'}, - {value: 'ii', label: 'Two'}, - {value: 3, label: 'Three'} - ], - - // 'switch' type has the following default options - // options: [ - // {value: true, label: 'ON'}, {value: false, label: 'OFF'} - // ] - // Note : if you include custom 'switch' options there must - // be exactly 2 and the first will represent 'on' - - // - // Optional. Used for validating 'custom' property values. Regular expressions should be in Javascript format: /pattern/flags - regex: '^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$', - // - // Optional. Used for validating 'number' property values. Can be an integer, a floating point number, or a string represation of an integer or floating point number. - // minValue and maxValue must both be of the same type so as to avoid unexpected behaviour during validation. Scientific notation is not supported. - minValue: 0.1, - // - // Optional. Used for validating 'number' property values. Can be an integer, a floating point number, or a string represation of an integer or floating point number. - // minValue and maxValue must both be of the same type so as to avoid unexpected behaviour during validation. Scientific notation is not supported. - maxValue: 0.9, - // - // Optional. Specifies the number of decimal places to be used when validating 'number' fields. Default value is 0, which indicates that the value is a whole number - decimalPlaces: 0, - // - // Optional. Specifies a default value for the property. Can be a string, number or boolean value - defaultValue: 0.5, - // - // Optional. Specifies an error message which will appear when input validation fails - error: 'Enter a valid Version 4 UUID' - // - // Optional. A free-form object to allow clients to extend the schema of the custom property. For API Portal, permissions may be - // overridden for oadmin and user personas using the sample provided. - custom: { - apiportal: { - permissions: { - oadmin: { read: true, write: false, visible: true }, - user: { read: true, write: false, visible: true } - } - }, - authorization: { type: 'basic', realm: 'portal' }, - required: true - } - } - */ - customPropertiesConfig: { - user: { - userCustomProperty1: { - label: 'User custom Property #1' - }, - userCustomProperty2: { - label: 'User custom Property #2', - type: 'select', - options: [ - { value: '1', label: 'Value 1' }, - { value: '2', label: 'Value 2' }, - { value: '3', label: 'Value 3' } - ] - }, - userCustomProperty3: { - label: 'User custom Property #3', - type: 'switch', - options: [ - { value: true, label: 'ON' }, - { value: false, label: 'OFF' } - ] - } - }, - organization: { - orgCustomProperty1: { - label: 'Org custom Property #1' - }, - orgCustomProperty2: { - label: 'Org custom Property #2', - type: 'select', - options: [ - { value: '1', label: 'Value 1' }, - { value: '2', label: 'Value 2' }, - { value: '3', label: 'Value 3' } - ] - }, - orgCustomProperty3: { - label: 'Org custom Property #3', - type: 'switch', - options: [ - { value: true, label: 'ON' }, - { value: false, label: 'OFF' } - ] - } - }, - application: { - appCustomProperty1: { - label: 'App custom Property #1' - }, - appCustomProperty2: { - label: 'App custom Property #2', - type: 'select', - options: [ - { value: '1', label: 'Value 1' }, - { value: '2', label: 'Value 2' }, - { value: '3', label: 'Value 3' } - ] - }, - appCustomProperty3: { - label: 'App custom Property #3', - type: 'switch', - options: [ - { value: true, label: 'ON' }, - { value: false, label: 'OFF' } - ] - } - }, - api: { - customProperty1: { - label: 'Custom Property #1' - }, - customProperty2: { - label: 'Custom Property #2', - type: 'select', - options: [ - { value: '1', label: 'Value 1' }, - { value: '2', label: 'Value 2' }, - { value: '3', label: 'Value 3' } - ] - }, - customProperty3: { - label: 'Custom Property #3', - type: 'switch', - options: [ - { value: true, label: 'ON' }, - { value: false, label: 'OFF' } - ] - } - } - }, - - wizardModels: { - "$Item": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "description": "The item's unique identifier" - }, - "name": { - "type": "string", - "description": "The $item's name" - } - } - }, - "$ItemArray": { - "type": "array", - "items": { - "$ref": "$Item" - } - } - }, - wizardCrudTemplates: { - create: { - verb: 'POST', - name: 'Create $item', - summary: 'Creates a new instance of $item.', - description: 'The $item can only be created if you have permissions to create. Otherwise, a **403 Forbidden** error is returned. ' + - 'If the *body* parameter is not a valid *$Item*, then a **400 Bad Request** error is returned. On success, **201 Created** is returned.', - path: '/$path', - returnType: '$Item', - produces: [ - 'application/json' - ], - consumes: [ - 'application/json' - ], - parameters: [ - { - name: 'body', - paramType: 'body', - description: 'The $item to create', - type: '$Item', - required: true, - allowMultiple: false - } - ], - responseCodes: [ - {code: 201, message: 'Created', schema: {'$ref':'$Item'}}, - {code: 400, message: 'Bad Request'}, - {code: 403, message: 'Forbidden'}, - {code: 500, message: 'Internal Server Error'} - ] - }, - retrieve: { - verb: 'GET', - name: 'Get $item', - summary: 'Gets an existing $item by id.', - description: 'Gets $item by id.', - path: '/$path/{id}', - returnType: '$Item', - produces: [ - 'application/json' - ], - consumes: [ - 'application/json' - ], - parameters: [ - { - name: 'id', - paramType: 'path', - description: 'The $item identifier', - type: 'string', - required: true, - allowMultiple: false - } - ], - responseCodes: [ - {code: 200, message: 'OK', schema: {'$ref':'$Item'}}, - {code: 404, message: 'Not found'}, - {code: 500, message: 'Internal Server Error'} - ] - }, - retrieveAll: { - verb: 'GET', - name: 'Get all $item', - summary: 'Gets a collection of $item.', - description: 'Queries all $item. An optional parameter, *search* can be used to filter the list of *$Item*. On success, **200 OK** is returned, even if no items were found.', - path: '/$path', - returnType: '$ItemArray', - produces: [ - 'application/json' - ], - consumes: [ - 'application/json' - ], - parameters: [ - { - name: 'search', - paramType: 'query', - description: 'Text to use to find $item', - type: 'string', - required: false, - allowMultiple: true - } - ], - responseCodes: [ - {code: 200, message: 'OK', schema: {'$ref':'$ItemArray'}}, - {code: 500, message: 'Internal Server Error'} - ] - }, - update: { - verb: 'PUT', - name: 'Update $item', - summary: 'Updates an existing $item by id.', - description: 'The $item can only be updated if you have permissions to update. Otherwise, a **403 Forbidden** error is returned. ' + - 'If the *body* parameter is not a valid *$Item*, then a **400 Bad Request** error is returned. On success, **200 OK** is returned.\n', - path: '/$path/{id}', - returnType: '$Item', - produces: [ - 'application/json' - ], - consumes: [ - 'application/json' - ], - parameters: [ - { - name: 'id', - paramType: 'path', - description: 'The $item identifier', - type: 'string', - required: true, - allowMultiple: false - }, - { - name: 'body', - paramType: 'body', - description: 'The $item to update', - type: '$Item', - required: true, - allowMultiple: false - } - ], - responseCodes: [ - {code: 200, message: 'OK', schema: {'$ref':'$Item'}}, - {code: 400, message: 'Bad Request'}, - {code: 403, message: 'Forbidden'}, - {code: 500, message: 'Internal Server Error'} - ] - }, - remove: { - verb: 'DELETE', - name: 'Delete $item', - summary: 'Delete an existing $item by id.', - description: 'The $item can only be updated if you have permissions to delete. Otherwise, a **403 Forbidden** error is returned. ' + - 'If the *id* parameter is not valid or not found, then a **400 Bad Request** error is returned. On success, **204 No Content** is returned.', - path: '/$path/{id}', - returnType: 'void', - produces: [ - 'application/json' - ], - consumes: [ - 'application/json' - ], - parameters: [ - { - name: 'id', - paramType: 'path', - description: 'The $item identifier', - type: 'string', - required: true, - allowMultiple: false - } - ], - responseCodes: [ - {code: 204, message: 'No Content'}, - {code: 403, message: 'Forbidden'}, - {code: 500, message: 'Internal Server Error'} - ] - } - } -};