@knetik/micro-credentials_store-s3
v3.1.10
Published
This package provides a simple key value store using amazon aws' s3 service to the [micro-core](https://www.npmjs.com/package/@knetik/micro-core) multi tenant framework.
Downloads
30
Readme
Knetik Micro Credentials Store: S3
This package provides a simple key value store using amazon aws' s3 service to the micro-core multi tenant framework.
Setup the Credentials Store
// config/environments/env.json
{
"CREDENTIALS_STORAGE_PROVIDER": "s3",
"S3_CREDENTIALS_STORE_BUCKET": "micro-credentials-store",
"AWS_PROFILE": "...",
}
2 contextualized stores are made available.
- Core.CredentialsStore
- App.CredentialsStore
Methods
On init the Core object will be assigned a credential store instance exposing three
functions get, set, remove
Core.CredentialsStore.set('token', '123123').then(token => token);
Core.CredentialsStore.get('token').then(token => token /* 123123 */);
Core.CredentialsStore.remove('token');
On Core connect, the returned App instance will also be assigned a store instance but scoped to the app_id
App.CredentialsStore.set('token', '321321').then(token => token);
App.CredentialsStore.get('token').then(token => token /* 321321 */);
App.CredentialsStore.remove('token');