Skip to content

Commit

Permalink
Cleanup the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jbygdell committed Jul 29, 2024
1 parent be7330f commit 5b9b7e7
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions sda/cmd/api/api.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# API

The API service provides data submitters with functionality to control
their submissions. Users are authenticated with a JWT.
their submissions. Users are authenticated with a JWT.

## Service Description

Endpoints:
- `/files`

1. Parses and validates the JWT token against the public keys, either locally provisioned or from OIDC JWK endpoints.
2. The `sub` field from the token is extracted and used as the user's identifier
3. All files belonging to this user are extracted from the database, together with their latest status and creation date

Example:
```bash
$ curl 'https://server/files' -H "Authorization: Bearer $token"
[{"inboxPath":"requester_demo.org/data/file1.c4gh","fileStatus":"uploaded","createAt":"2023-11-13T10:12:43.144242Z"}]
```
If the `token` is invalid, 401 is returned.

- `/files`
1. Parses and validates the JWT token against the public keys, either locally provisioned or from OIDC JWK endpoints.
2. The `sub` field from the token is extracted and used as the user's identifier
3. All files belonging to this user are extracted from the database, together with their latest status and creation date

Example:

```bash
$ curl 'https://server/files' -H "Authorization: Bearer $token"
[{"inboxPath":"requester_demo.org/data/file1.c4gh","fileStatus":"uploaded","createAt":"2023-11-13T10:12:43.144242Z"}]
```

If the `token` is invalid, 401 is returned.

### Admin endpoints

Expand Down

0 comments on commit 5b9b7e7

Please sign in to comment.