Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Oct 27, 2023
1 parent 214b92a commit 0f531fd
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/.dev_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cors_allowed_headers: []
db_connection_str: "mongodb://mongodb:27017"
db_name: "dev-db"

service_instance_id: 001
service_instance_id: 'wps_1'
kafka_servers: ["kafka:9092"]

download_access_url: "http://127.0.0.1:8080/download-access"
Expand Down
160 changes: 149 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ We recommend using the provided Docker container.

A pre-build version is available at [docker hub](https://hub.docker.com/repository/docker/ghga/work-package-service):
```bash
docker pull ghga/work-package-service:0.1.5
docker pull ghga/work-package-service:1.0.0
```

Or you can build the container yourself from the [`./Dockerfile`](./Dockerfile):
```bash
# Execute in the repo's root dir:
docker build -t ghga/work-package-service:0.1.5 .
docker build -t ghga/work-package-service:1.0.0 .
```

For production-ready deployment, we recommend using Kubernetes, however,
for simple use cases, you could execute the service using docker
on a single server:
```bash
# The entrypoint is preconfigured:
docker run -p 8080:8080 ghga/work-package-service:0.1.5 --help
docker run -p 8080:8080 ghga/work-package-service:1.0.0 --help
```

If you prefer not to use containers, you may install the service from source:
Expand All @@ -92,33 +92,107 @@ The service requires the following configuration parameters:

- **`work_package_signing_key`** *(string, format: password)*: The private key for signing work order tokens.


Examples:

```json
"{\"crv\": \"P-256\", \"kty\": \"EC\", \"x\": \"...\", \"y\": \"...\"}"
```


- **`db_connection_str`** *(string, format: password)*: MongoDB connection string. Might include credentials. For more information see: https://naiveskill.com/mongodb-connection-string/.


Examples:

```json
"mongodb://localhost:27017"
```


- **`db_name`** *(string)*: Default: `"work-packages"`.

- **`service_name`** *(string)*: Default: `"wps"`.

- **`service_instance_id`** *(string)*: A string that uniquely identifies this instance across all instances of this service. A globally unique Kafka client ID will be created by concatenating the service_name and the service_instance_id.


Examples:

```json
"germany-bw-instance-001"
```


- **`kafka_servers`** *(array)*: A list of connection strings to connect to Kafka bootstrap servers.

- **Items** *(string)*


Examples:

```json
[
"localhost:9092"
]
```


- **`dataset_change_event_topic`** *(string)*: Name of the topic for events that inform about datasets.


Examples:

```json
"metadata_datasets"
```


- **`dataset_upsertion_event_type`** *(string)*: The type of events that inform about new and changed datasets.


Examples:

```json
"dataset_created"
```


- **`dataset_deletion_event_type`** *(string)*: The type of events that inform about deleted datasets.


Examples:

```json
"dataset_deleted"
```


- **`download_access_url`** *(string)*: URL pointing to the internal download access API.


Examples:

```json
"http://127.0.0.1/download-access"
```


- **`auth_key`** *(string)*: The GHGA internal public key for validating the token signature.


Examples:

```json
"{\"crv\": \"P-256\", \"kty\": \"EC\", \"x\": \"...\", \"y\": \"...\"}"
```


- **`auth_algs`** *(array)*: A list of all algorithms used for signing GHGA internal tokens. Default: `["ES256"]`.

- **Items** *(string)*

- **`auth_check_claims`** *(object)*: A dict of all GHGA internal claims that shall be verified. Default: `{"name": null, "email": null, "iat": null, "exp": null}`.
- **`auth_check_claims`** *(object)*: A dict of all GHGA internal claims that shall be verified. Default: `{"email": null, "exp": null, "iat": null, "name": null}`.

- **`auth_map_claims`** *(object)*: A mapping of claims to attributes in the GHGA auth context. Can contain additional properties. Default: `{}`.

Expand All @@ -140,19 +214,83 @@ The service requires the following configuration parameters:

- **`docs_url`** *(string)*: Path to host the swagger documentation. This is relative to the specified host and port. Default: `"/docs"`.

- **`cors_allowed_origins`** *(array)*: A list of origins that should be permitted to make cross-origin requests. By default, cross-origin requests are not allowed. You can use ['*'] to allow any origin.
- **`cors_allowed_origins`**: A list of origins that should be permitted to make cross-origin requests. By default, cross-origin requests are not allowed. You can use ['*'] to allow any origin. Default: `null`.

- **Items** *(string)*
- **Any of**

- **`cors_allow_credentials`** *(boolean)*: Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed. The origins must be explicitly specified.
- *array*

- **`cors_allowed_methods`** *(array)*: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to ['GET']. You can use ['*'] to allow all standard methods.
- **Items** *(string)*

- **Items** *(string)*
- *null*

- **`cors_allowed_headers`** *(array)*: A list of HTTP request headers that should be supported for cross-origin requests. Defaults to []. You can use ['*'] to allow all headers. The Accept, Accept-Language, Content-Language and Content-Type headers are always allowed for CORS requests.

- **Items** *(string)*
Examples:

```json
[
"https://example.org",
"https://www.example.org"
]
```


- **`cors_allow_credentials`**: Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed. The origins must be explicitly specified. Default: `null`.

- **Any of**

- *boolean*

- *null*


Examples:

```json
[
"https://example.org",
"https://www.example.org"
]
```


- **`cors_allowed_methods`**: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to ['GET']. You can use ['*'] to allow all standard methods. Default: `null`.

- **Any of**

- *array*

- **Items** *(string)*

- *null*


Examples:

```json
[
"*"
]
```


- **`cors_allowed_headers`**: A list of HTTP request headers that should be supported for cross-origin requests. Defaults to []. You can use ['*'] to allow all headers. The Accept, Accept-Language, Content-Language and Content-Type headers are always allowed for CORS requests. Default: `null`.

- **Any of**

- *array*

- **Items** *(string)*

- *null*


Examples:

```json
[]
```



### Usage:
Expand Down
Loading

0 comments on commit 0f531fd

Please sign in to comment.