This package provides a simple key value store using amazon aws' s3 service to the micro-core multi tenant framework.
// 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
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');