{"_id":"@blockless/sdk-assemblyscript-hashi-vault","name":"@blockless/sdk-assemblyscript-hashi-vault","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@blockless/sdk-assemblyscript-hashi-vault","version":"1.0.0","description":"retrieve Hashicorp Vault Secrets with your Blockless Functions.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","gitHead":"f6b5865d002af52943a83e3aba3741560afaec22","_id":"@blockless/sdk-assemblyscript-hashi-vault@1.0.0","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-N3EEOz9zcUfPmXZ7ten1yqcM5h4sS4n0FFXRn2h31RaW20kxYosF7kmhVUzPtJZZtPEBSR7OrdHcdk5qahC/7A==","shasum":"c53408ca3f12c9f4c0957331bffc7e7b630c3322","tarball":"https://registry.npmjs.org/@blockless/sdk-assemblyscript-hashi-vault/-/sdk-assemblyscript-hashi-vault-1.0.0.tgz","fileCount":7,"unpackedSize":17079,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID4NyFwkw6WMzVcWgRVfWfMOE+tNMUb0nypedyz7pdjBAiEAwnDTVq4mDCF4Q2WJGZVvVcDbJEH6lq3NnPjdKPtKgY8="}]},"_npmUser":{"name":"toxigenicpoem","email":"toxigenicpoem@gmail.com"},"directories":{},"maintainers":[{"name":"udit_txlabs","email":"udit@txlabs.org"},{"name":"toxigenicpoem","email":"toxigenicpoem@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk-assemblyscript-hashi-vault_1.0.0_1698099299499_0.4770005746873296"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-23T22:14:59.416Z","1.0.0":"2023-10-23T22:14:59.739Z","modified":"2023-10-23T22:15:00.061Z"},"maintainers":[{"name":"udit_txlabs","email":"udit@txlabs.org"},{"name":"toxigenicpoem","email":"toxigenicpoem@gmail.com"}],"description":"retrieve Hashicorp Vault Secrets with your Blockless Functions.","license":"ISC","readme":"# sdk-assemblyscript-hashivault\n\nretrieve Hashicorp Vault Secrets with your Blockless Functions.\n\n\n## Authentication\n\nauthentication is included, but shouldn't be used in production.\n\n\n## Use\n\nupdate `bls.toml` to allow `hashicorp` hosted endpoints.\n\n```\nname = \"hashi-test\"\nversion = \"1.0.0\"\n\n[deployment]\npermission = \"private\"\nnodes = 4\npermissions = [\"https://auth.hashicorp.com\",\"https://api.cloud.hashicorp.com\"]\n\n[build]\ndir = \"build\"\nentry = \"hashi-test_debug.wasm\"\ncommand = \"npm run build:debug\"\n\n[build_release]\ndir = \"build\"\nentry = \"hashi-test.wasm\"\ncommand = \"npm run build:release\"\n```\n\nCall into the SDK helpers to get secrets. \n\n\n```typescript\nimport { Console } from \"as-wasi/assembly\";\nimport { getAuthToken } from \"@blocklessnetwork/hashi-vault/getAuthToken\";\nimport { getSecret } from \"@blocklessnetwork/hashi-vault/getSecret\";\n\n// get access token.\n// this is example only\n// should not be done in production\n// functions should only get access token from the caller\nconst hcpClientId = \"\";\nconst hcpClientSecret =\n  \"\";\n\nlet authToken = getAuthToken(hcpClientId, hcpClientSecret);\nif (authToken != null) {\n  // get secret from the vault\n  let OrgId = \"\";\n  let ProjId = \"\";\n  let AppName = \"\";\n  let SecretKey = \"\";\n\n  let secret = getSecret(\n    OrgId,\n    ProjId,\n    AppName,\n    SecretKey,\n    authToken as string\n  );\n  Console.log(secret.toString());\n}\n\n```\n\n\n","readmeFilename":"README.md"}