These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
This project runs on Spring 2.2.4
, java 1.8
and ibm cos sdk 2.6.1
.
This program can run locally or hosted on Openshift.
To switch between the two change the variable source
int restService/AuthRestController
.
False = Local
True = Hosted
To run hosted the program must have a config map associated with it.
Clone the repo and then run:
mvn clean install
to create the jar. To run the program run:
cd target
java -jar rg_auth_svc-0.0.1.jar
This will start the program on port 8080.
The rest api to get a document is described below.
GET /document?uid=<uid>&file=<file name>
https://<example pre-signed url>
If the document requested does not exist, a 404 Not Found
is returned.
If the UID does not match the UID of the requested document, a 403 Forbidden
is returned.
By default the pre-signed url is set to expire after 1 min, this can be changed via a config map called spring-boot-auth
with a key of expiration
.
All other ENV variables are in a config map owned by the team and will not be placed in a repo. If a new config map is created it needs to match the variables within boilerplate.yaml
How to deploy this app
docker build . -t rg_auth_svc
docker run -it -p 8080:8080 rg_auth_svc:latest
Service will be running on http://localhost:8080/
Build docker image.
docker build . -t <registry_tag>/auth-service
Push image to container registry.
docker push
Login to the cluster to deploy to and then run:
oc create -f boilerplate.yaml