New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blockless/sdk-assemblyscript-hashi-vault

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockless/sdk-assemblyscript-hashi-vault

retrieve Hashicorp Vault Secrets with your Blockless Functions.

1.0.0
latest
npm
Version published
Maintainers
2
Created
Source

sdk-assemblyscript-hashivault

retrieve Hashicorp Vault Secrets with your Blockless Functions.

Authentication

authentication is included, but shouldn't be used in production.

Use

update bls.toml to allow hashicorp hosted endpoints.

name = "hashi-test"
version = "1.0.0"

[deployment]
permission = "private"
nodes = 4
permissions = ["https://auth.hashicorp.com","https://api.cloud.hashicorp.com"]

[build]
dir = "build"
entry = "hashi-test_debug.wasm"
command = "npm run build:debug"

[build_release]
dir = "build"
entry = "hashi-test.wasm"
command = "npm run build:release"

Call into the SDK helpers to get secrets.

import { Console } from "as-wasi/assembly";
import { getAuthToken } from "@blocklessnetwork/hashi-vault/getAuthToken";
import { getSecret } from "@blocklessnetwork/hashi-vault/getSecret";

// get access token.
// this is example only
// should not be done in production
// functions should only get access token from the caller
const hcpClientId = "";
const hcpClientSecret =
  "";

let authToken = getAuthToken(hcpClientId, hcpClientSecret);
if (authToken != null) {
  // get secret from the vault
  let OrgId = "";
  let ProjId = "";
  let AppName = "";
  let SecretKey = "";

  let secret = getSecret(
    OrgId,
    ProjId,
    AppName,
    SecretKey,
    authToken as string
  );
  Console.log(secret.toString());
}

FAQs

Package last updated on 23 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts