diff --git a/.env.example b/.env.example index bd94b654ca1cabc30c1f2633808a988a8b8e31f8..3eff346f759fd322f35e50a67f5378c337b9158e 100644 --- a/.env.example +++ b/.env.example @@ -37,3 +37,8 @@ PROOF_SERVICE_HOST=0.0.0.0 ALLOWED_ORIGINS=* SWAGGER=false + +TAILS_SERVER_BASE_URL=https://s3.us-west-000.backblazeb2.com +TAILS_SERVER_KEY=key +TAILS_SERVER_SECRET=secret +TAILS_SERVER_BUCKET_NAME=ssi-revocation-tails \ No newline at end of file diff --git a/libs/askar/src/agent.utils.ts b/libs/askar/src/agent.utils.ts index 989c2676b80ebf0b37a5be3f1441b6fba5ff0350..a254f49c1facbe6f89f0b39ccea277da21b3747e 100644 --- a/libs/askar/src/agent.utils.ts +++ b/libs/askar/src/agent.utils.ts @@ -210,10 +210,19 @@ export const generateDidFromKey = (key: Key): string => { //eslint-disable-next-line export const getAskarAnonCredsIndyModules = (networks: any) => { - const tailsServerBaseUrl = 'https://s3.us-west-000.backblazeb2.com'; - const s3AccessKey = '00035e7ca9a9853000000000d'; - const s3Secret = 'K000e++ZchAncs27jCueO+P+M1UEN2Q'; - const tailsServerBucketName = 'ssi-revocation-tails'; + const tailsServerBaseUrl = process.env["TAILS_SERVER_BASE_URL"] || undefined; + const s3AccessKey = process.env["TAILS_SERVER_KEY"] || undefined; + const s3Secret = process.env["TAILS_SERVER_SECRET"] || undefined; + const tailsServerBucketName = process.env["TAILS_SERVER_BUCKET_NAME"] || undefined; + + if ( + !tailsServerBaseUrl || + !s3AccessKey || + !s3Secret || + !tailsServerBucketName + ) { + throw new Error("Tails Storage Information not provided."); + } return { connections: new ConnectionsModule({