GitHub Actions workflows status
CodeClimate
The origin and root path for this API is: https://api.klimapartner.net/files
The following endpoints are defined in this API:
Supported methods:
GET (target lambda → get-files)
Description:
This endpoint allows user to retrieve the list of files located at a given path inside of Kaskadi's public AWS S3 bucket.
Authorization:
| Type | Identity source |
|---|---|
| Cognito |
|
Query string parameters:
| Key | Default | Description |
|---|---|---|
path |
/ |
Path from where we would like to list files. |
Request body:
No body found for this method.
Examples:
Example #1
Request:
GET https://api.klimapartner.net/files/?path=modules
Headers:
Authorization: Bearer COGNITO_ACCESS_TOKENResponse:
Status code:
200
Headers:
Access-Control-Allow-Origin: *
Body:
[
{
"type": "folder",
"size": 0,
"lastModified": "2020-01-14T15:07:20.000Z",
"path": "modules/@kaskadi/"
},
{
"type": "folder",
"size": 6272,
"lastModified": "2020-01-14T15:20:06.000Z",
"path": "modules/@webcomponents/"
},
{
"type": "folder",
"size": 0,
"lastModified": "2020-03-09T07:30:12.000Z",
"path": "modules/lit-element/"
},
{
"type": "folder",
"size": 0,
"lastModified": "2020-03-09T07:30:13.000Z",
"path": "modules/lit-html/"
}
]Example #2
Request:
GET https://api.klimapartner.net/files/?path=modulezzz
Headers:
Authorization: Bearer COGNITO_ACCESS_TOKENResponse:
Status code:
404
Headers:
Access-Control-Allow-Origin: *
Body:
{
"message": "No files found under modulezzz/"
}Supported methods:
GET (target lambda → get-signed-url)
Description:
This endpoint provides a way for users to get signed URLs that allows them to upload content into Kaskadi's public AWS S3 bucket.
Authorization:
| Type | Identity source |
|---|---|
| Cognito |
|
Query string parameters:
| Key | Default | Description |
|---|---|---|
key |
Key of the item you would like to upload on S3. Uses / as a separator to define pseudo-folder structure to create on S3. This parameter is required! |
Request body:
No body found for this method.
Examples:
Example #1
Request:
GET https://api.klimapartner.net/files/get-signed-url?key=imgs/apple.png
Headers:
Authorization: Bearer COGNITO_ACCESS_TOKENResponse:
Status code:
200
Headers:
Access-Control-Allow-Origin: *
Body:
{
"presignedUrl": "https://some.signed.url/to/upload/file?where=in_cdn",
"imgUrl": "https://cdn.klimapartner.net/imgs/apple.png"
}Example #2
Request:
GET https://api.klimapartner.net/files/get-signed-url
Headers:
Authorization: Bearer COGNITO_ACCESS_TOKENResponse:
Status code:
400
Headers:
Access-Control-Allow-Origin: *
Body:
{
"message": "Please provide a key parameter in your query string for the key of the file you would like to upload."
}The following lambda functions are used in this API:
The following layers are used in this API:
| Name | Sources | Timeout | Handler | Layers |
|---|---|---|---|---|
| get-files |
|
default | handler |
See configuration file for more details.
| Name | Sources | Timeout | Handler | Layers |
|---|---|---|---|---|
| get-signed-url |
|
default | handler |
See configuration file for more details.
Layer for files-api
aws-sdk, version:2.771.0(see on NPM)files-api-utils(local utility)
See configuration file for more details.
You can use any tags (and their respective values) visible below to find ressources related to this stack on AWS. See here for more details.
| Tag | Value |
|---|---|
| app | kaskadi |
| service | files-api |
| logical-unit | files |
| type | http |