-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sda-uppmax-integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,19 @@ curl --location --request POST '<base_url>:8080/token' \ | |
"projectid": "<projectid>" | ||
}' | ||
``` | ||
where `<basic_auth_from_creds>` is the base64 encoded string `username:password`. | ||
|
||
The `token` endpoint requires basic auth and the allowed credentials can be defined in the configuration file `config.yaml`. | ||
|
||
ex. | ||
```bash | ||
$ curl --location --request POST 'localhost:8080/token' \ | ||
--header "Authorization: Basic $(printf 'uppmax:uppmax' | base64)" \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{"swamid": "[email protected]", "projectid": "sda001"}' | ||
``` | ||
can be used in the docker compose development environment. | ||
|
||
## Endpoint Response | ||
|
||
The `token` endpoint returns the following structure, if the user is authorised to access the `<projectid>` requested: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
services: | ||
keymaker: | ||
image: golang:alpine3.16 | ||
volumes: | ||
- keys:/keys | ||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- if [ ! -f "/keys/c4gh.sec.pem" ]; then git --help >/dev/null 2>&1; [[ "$$?" != "0" ]] && apk add git; | ||
[ ! -d "crypt4gh" ] && git clone https://github.com/neicnordic/crypt4gh.git; | ||
cd crypt4gh; | ||
[ ! -f "crypt4gh" ] && go build .; | ||
./crypt4gh generate -n c4gh -p 'pass' && mv *.pem /keys/; fi; | ||
[ ! -f /keys/jwt.key ] && apk add openssl && openssl ecparam -name prime256v1 -genkey -noout -out /keys/jwt.key && chmod 644 /keys/jwt.key || true | ||
uppmax-integration: | ||
build: | ||
context: . | ||
depends_on: | ||
keymaker: | ||
condition: service_completed_successfully | ||
environment: | ||
- LOG_LEVEL=debug | ||
- GLOBAL_CRYPT4GHKEY=/keys/c4gh.sec.pem | ||
- [email protected] | ||
- GLOBAL_EXPIRATIONDAYS=14 | ||
- GLOBAL_ISS=https://login.sda.dev | ||
- GLOBAL_JWTKEY=/keys/jwt.key | ||
- GLOBAL_S3URL=inbox.sda.dev | ||
- GLOBAL_UPPMAXUSERNAME=uppmax | ||
- GLOBAL_UPPMAXPASSWORD=uppmax | ||
volumes: | ||
- keys:/keys | ||
ports: | ||
- 8080:8080 | ||
|
||
volumes: | ||
keys: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ global: | |
s3url: "" | ||
uppmaxUsername: "" | ||
uppmaxPassword: "" | ||
|
||
log: | ||
format: text | ||
level: debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters