Date: | Author: | Version: | Changes: | Completed | Ext. | Int. | Is in Core | Jira Ref. |
---|---|---|---|---|---|---|---|---|
05 April 2016 | tpl | 0.1 | Doc. created | No | x |
| N/A |
|
14 April 2016 | Anders GranauHøfft | 0.2 | Sections expanded | No | x | N/A | CDRRM-733 | |
11 May 2016 | Emil Ifrim | 0.3 | Database configuration | No | x | N/A | ||
20 March 2017 | Emil Ifrim | 0.4 | Redesign Update | No | x | N/A | ||
01 April 2018 | Emil Ifrim | 0.5 | Redesign Update | No | x | N/A | ||
15 January 2019 | SD | 0.6 | Download pdf-file |
...
- Retrieve the
rator-rest-api
.war file (either from Jenkins/Nexus, see Resources, or by building the .war yourself, see Build). - Retrieve the
rator-rest-api-auth
.war file (either from Jenkins/Nexus, see Resources, or by building the .war yourself, see Build). - Copy the war files to the Tomcat webapps directory and (re-)start the Tomcat application.
- Retrieve the swagger-ui
dist
folder (either from Github, or from our own repositories, see Resources. Or by building the project yourself, see Build). - Copy the dist folder to the Tomcat
webapps
directory and (re-)start the Tomcat application. You probably want to rename thedist
folder toswagger-ui
.- Nb This can be a different Tomcat installation than in step 2, or the same.
- In your browser, enter the URL "http://<Swagger server and port>/<base-path>/?url=http://<REST server and port>/<base-path>/api/swagger.json".
- You should now see a list of the resources available on the REST server.
In order to access secure resources through swagger-ui, one additional parameter must be configured in the Properties.txt file:
Code Block language sql title oauth2 selfcare client rest.api.accessTokenUri=http://<host>:<port/<auth-app-context>/oauth/token #example: http://10.45.1.81:8081/rator-rest-api-auth/oauth/token
...
Database Setup
- Run table_changes.sql that can be found in the project (rator-rest-api)
Configure REST api clients - who is allowed to get security tokens in order to access resources that require authentication/authorization. Here are some examples:
Code Block language sql title oauth2 selfcare client Insert into OAUTH_CLIENT_DETAILS (CLIENT_ID, CLIENT_SECRET, SCOPE, AUTHORIZED_GRANT_TYPES, ACCESS_TOKEN_VALIDITY, REFRESH_TOKEN_VALIDITY, AUTHORITIES) Values ('rator-selfcare-web-app', 'ratorselfcare', 'read,write', 'password', 600, 0, 'ACCESS_BRAND_brandKey'); --replace brandKey with a valid brand in the setup
Note: Swagger-ui client should only be used in development environments!
Code Block title oauth2 swagger-ui client Insert into OAUTH_CLIENT_DETAILS (CLIENT_ID, CLIENT_SECRET, SCOPE, AUTHORIZED_GRANT_TYPES, ACCESS_TOKEN_VALIDITY, AUTOAPPROVE, AUTHORITIES) Values ('your-client-id', 'your-client-secret', 'read-write:api-doc', 'password,operator_password,client_credentials', 600, 'true', 'ACCESS_BRAND_brandKey'); --replace brandKey with a valid brand in the setup
...