Skip to content

Are MINIO environment variables required to run the Flask app? #155

@manics

Description

@manics

The docker-compose service for the flask app has several MINIO_*configuration variables, including credentials:

- MINIO_ENDPOINT=${MINIO_ENDPOINT}
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
- MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME}

However the documented API calls that connect to the object store require passing the minio config as a parameter

## API
#### Request Validation of RO-Crate
<details>
<summary><code>POST</code> <code><b>v1/ro_crates/{crate_id}/validation</b></code> <code>(Request validation of RO-Crate validation in Object Store)</code></summary>
##### Path Parameters
| name | type | data type | description |
|------------|-----------|-------------------------|-----------------------------------------------------------------------|
| crate_id | required | string | RO-Crate identifer string |
##### Parameters
| name | type | data type | description |
|------------|-----------|-------------------------|-----------------------------------------------------------------------|
| root_path | optional | string | Root path which contains the RO-Crate |
| webhook_url | optional | string | Webhook to send validation result to |
| profile_name | optional | string | RO-Crate profile to validate against |
| minio_config | required | dictionary | MinIO Configuration Details |
`minio_config`
> | name | type | data type | description |
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
> | endpoint | required | string | MinIO endpoint |
> | accesskey | required | string | MinIO access key or username |
> | secret | required | string | MinIO secret or password |
> | ssl | required | boolean | Use SSL encryption for MinIO access? |
> | bucket | required | string | MinIO bucket containing RO-Crate |
##### Responses
| http code | content-type | response |
|---------------|-----------------------------------|---------------------------------------------------------------------|
| `202` | `application/json` | `{"message": "Validation in progress"}` |
| `400` | `application/json` | `{"message": "No RO-Crate with prefix: <crate_id>"}` |
| `500` | `application/json` | `{"message": "Internal server errors"}` |
```javascript
curl -X 'POST' \
'http://localhost:5001/v1/ro_crates/<crate_id>/validation' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"minio_config": {
"accesskey": "<key>",
"bucket": "ro-crates",
"endpoint": "minio:9000",
"secret": "<secret>",
"ssl": false
},
"profile_name": "<profile>",
"webhook_url": "<webhook>"
}'
```
</details>
#### Get RO-Crate Validation Result
<details>
<summary><code>GET</code> <code><b>v1/ro_crates/{crate_id}/validation</b></code> <code>(Obtain RO-Crate validation result from Object Store)</code></summary>
##### Path Parameters
| name | type | data type | description |
|------------|-----------|-------------------------|-----------------------------------------------------------------------|
| crate_id | required | string | RO-Crate identifer string |
##### Parameters
| name | type | data type | description |
|------------|-----------|-------------------------|-----------------------------------------------------------------------|
| root_path | optional | string | Root path which contains the RO-Crate |
| minio_config | required | dictionary | MinIO Configuration Details |
`minio_config`
> | name | type | data type | description |
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
> | endpoint | required | string | MinIO endpoint |
> | accesskey | required | string | MinIO access key or username |
> | secret | required | string | MinIO secret or password |
> | ssl | required | boolean | Use SSL encryption for MinIO access? |
> | bucket | required | string | MinIO bucket containing RO-Crate |
##### Responses
| http code | content-type | response |
|---------------|-----------------------------------|---------------------------------------------------------------------|
| `200` | `application/json` | `Successful Validation` |
| `422` | `application/json` | `Error: Details of Validation Error` |
| `404` | `application/json` | `Not found` |
##### Example cURL
```javascript
curl -X 'GET' \
'http://localhost:5001/v1/ro_crates/<crate_id>/validation' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"minio_config": {
"accesskey": "<key>",
"bucket": "ro-crates",
"endpoint": "minio:9000",
"secret": "<secret>",
"ssl": false
}
}'
```
</details>

What are the Flask MINIO_* environment variables used for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions