Setting up an S3 backend session from another application - Arkisto-Platform/describo-online GitHub Wiki
This follows on from Integrating Describo into another service.
Setting up a new session
You can have describo automatically connect to an S3 service and load a specified folder. To do that the session data you POST to describo must be as follows:
email: the email address of the user for whom to create a sessionname: the users' name,provider: AWS or Minio,url: If provider is Minio, set this to the url of the service,awsAccessKeyId: the aws key,awsSecretAccessKey: the aws secret,region: if real AWS S3 set the region here. Not required if provider is Minio,folder: the bucket and optionally the folder path within the bucket, e.g. {folder}/{path}/{inside}/{bucket}
And the form it should be POST'ed in is:
POST: {
"email": email,
"name": name,
"service": {
"s3": {
"provider": provider,
"url": url,
"folder": folder,
"awsAccessKeyId": awsAccessKeyId,
"awsSecretAccessKey": awsSecretAccessKey,
"region": region
}
}
}
Here's an example for AWS:
api_1 | {
api_1 | "email": "[email protected]",
api_1 | "name": "admin",
api_1 | "session": {
api_1 | "s3": {
api_1 | "provider": "AWS",
api_1 | "folder": "describo/test",
api_1 | "awsAccessKeyId": "AKI .... TVJH",
api_1 | "awsSecretAccessKey": "7qzw9Z7 .... THBPfU",
api_1 | "region": "ap-southeast-2"
api_1 | }
api_1 | }
api_1 | }
Here's an example for Minio:
api_1 | {
api_1 | "email": "[email protected]",
api_1 | "name": "admin",
api_1 | "session": {
api_1 | "s3": {
api_1 | "provider": "Minio",
api_1 | "url": "https://{your.minio.service}",
api_1 | "folder": "describo/test",
api_1 | "awsAccessKeyId": "AKI .... TVJH",
api_1 | "awsSecretAccessKey": "7qzw9Z7 .... THBPfU",
api_1 | }
api_1 | }
api_1 | }
Updating an existing session
To update the s3 data in an existing session (for example, the access_token) PUT the same data as above to https://{describo-online}/api/session/application/{sessionId} (notice the sessionId param on the end).