### Run Example Scripts Source: https://github.com/nodevault/node-vault/blob/master/README.md Execute example scripts after setting up Vault and the VAULT_TOKEN environment variable. ```bash node example/policies.js ``` -------------------------------- ### Clone Repository and Start Vault with Docker Compose Source: https://github.com/nodevault/node-vault/blob/master/README.md Clone the node-vault repository and use docker-compose to set up Vault and its dependencies. ```bash git clone git@github.com:nodevault/node-vault.git cd node-vault docker-compose up vault ``` -------------------------------- ### Initialize Vault and Get Root Token Source: https://github.com/nodevault/node-vault/blob/master/README.md Run the initialization script for Vault. Copy the displayed root token for subsequent environment variable export. ```bash node example/init.js ``` -------------------------------- ### Install node-vault Source: https://github.com/nodevault/node-vault/blob/master/README.md Install the node-vault package using npm. Ensure Node.js version 18.0.0 or higher is used. ```bash npm install -S node-vault ``` -------------------------------- ### vault.init Source: https://github.com/nodevault/node-vault/blob/master/features.md Initializes the Vault server. ```APIDOC ## vault.init ### Description Initializes the Vault server. ### Method PUT ### Endpoint /sys/init ``` -------------------------------- ### Generate Documentation Source: https://github.com/nodevault/node-vault/blob/master/README.md Run this command to generate documentation for the project using docco. ```bash npm run docs ``` -------------------------------- ### Open SOCKS Proxy Connection Source: https://github.com/nodevault/node-vault/blob/master/README.md Establish a SOCKS proxy connection to a bastion host to access a private network. ```bash ssh -D bastion.example.com ``` -------------------------------- ### vault.generateRootInit Source: https://github.com/nodevault/node-vault/blob/master/features.md Initiates the generation of a root token. ```APIDOC ## vault.generateRootInit ### Description Initiates the generation of a root token. ### Method PUT ### Endpoint `/sys/generate-root/attempt` ``` -------------------------------- ### Configure Node-Vault Client with SOCKS Proxy Agent Source: https://github.com/nodevault/node-vault/blob/master/README.md Initialize the node-vault client, configuring it to use a SOCKS proxy agent for connections through a bastion host. ```javascript const { SocksProxyAgent } = require('socks-proxy-agent'); const agent = new SocksProxyAgent(`socks://127.0.0.1:${socksPort}`); const vault = require('node-vault')({ apiVersion: 'v1', requestOptions: { httpsAgent: agent, httpAgent: agent, }, }); ``` -------------------------------- ### Run Tests with Docker Compose Source: https://github.com/nodevault/node-vault/blob/master/README.md Execute tests using docker-compose, which sets up Vault and PostgreSQL. This command recreates the test environment. ```bash docker-compose up --force-recreate test ``` -------------------------------- ### Initialize and Unseal Vault Server Source: https://github.com/nodevault/node-vault/blob/master/README.md Initializes a new Vault server with a specified number of secret shares and threshold, then unseals it using the generated keys. Sets the client token for subsequent requests. ```javascript const vault = require('node-vault')({ apiVersion: 'v1', endpoint: 'http://127.0.0.1:8200', token: 'MY_TOKEN', // optional; can be set after initialization }); // init vault server vault.init({ secret_shares: 1, secret_threshold: 1 }) .then((result) => { const keys = result.keys; // set token for all following requests vault.token = result.root_token; // unseal vault server return vault.unseal({ secret_shares: 1, key: keys[0] }); }) .catch(console.error); ``` -------------------------------- ### Configure node-vault Client Options Source: https://github.com/nodevault/node-vault/blob/master/README.md Initialize the node-vault client with various configuration options. These options control API version, server endpoint, authentication token, path prefix, namespace, and request behavior. ```javascript const vault = require('node-vault')({ apiVersion: 'v1', // API version (default: 'v1') endpoint: 'http://127.0.0.1:8200', // Vault server URL (default: 'http://127.0.0.1:8200') token: 'MY_TOKEN', // Vault token for authentication pathPrefix: '', // Optional prefix for all request paths namespace: 'my-namespace', // Vault Enterprise namespace noCustomHTTPVerbs: false, // Use GET with ?list=1 instead of LIST HTTP method requestOptions: {}, // Custom axios request options applied to all requests }); ``` -------------------------------- ### vault.approleLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using AppRole credentials. ```APIDOC ## vault.approleLogin ### Description Logs in using AppRole credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/login ``` -------------------------------- ### vault.mounts Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all configured mounts. ```APIDOC ## vault.mounts ### Description Lists all configured mounts. ### Method GET ### Endpoint `/sys/mounts` ``` -------------------------------- ### vault.mount Source: https://github.com/nodevault/node-vault/blob/master/features.md Mounts a new storage backend. ```APIDOC ## vault.mount ### Description Mounts a new storage backend. ### Method POST ### Endpoint `/sys/mounts/{{mount_point}}` ``` -------------------------------- ### Unseal Vault Server with Multiple Keys (Threshold > 1) Source: https://github.com/nodevault/node-vault/blob/master/README.md Demonstrates unsealing a Vault server that requires multiple unseal keys. The `unseal` method must be called multiple times with different keys until the `secret_threshold` is met. The `sealed` status and progress are logged. ```javascript vault.unseal({ key: 'first-unseal-key' }) .then((result) => { // result.sealed will be true until enough keys are provided console.log('Sealed:', result.sealed); console.log('Progress:', result.progress + '/' + result.t); return vault.unseal({ key: 'second-unseal-key' }); }) .then((result) => { // once the threshold is met, sealed will be false console.log('Sealed:', result.sealed); }) .catch(console.error); ``` -------------------------------- ### Custom SSL/TLS Configuration for Node-Vault Source: https://github.com/nodevault/node-vault/blob/master/README.md Initialize the node-vault client with custom SSL/TLS options to resolve issues like 'unsafe legacy renegotiation disabled'. ```javascript const vault = require('node-vault')({ apiVersion: 'v1', endpoint: 'https://vault.example.com:8200', token: 'MY_TOKEN', requestOptions: { agentOptions: { securityOptions: 'SSL_OP_LEGACY_SERVER_CONNECT', }, }, }); ``` -------------------------------- ### vault.initialized Source: https://github.com/nodevault/node-vault/blob/master/features.md Checks if the Vault server has been initialized. ```APIDOC ## vault.initialized ### Description Checks if the Vault server has been initialized. ### Method GET ### Endpoint /sys/init ``` -------------------------------- ### vault.policies Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all policies. ```APIDOC ## vault.policies ### Description Lists all policies. ### Method GET ### Endpoint `/sys/policy` ``` -------------------------------- ### vault.oktaLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using Okta credentials. This method authenticates with Vault using Okta API tokens. ```APIDOC ## vault.oktaLogin ### Description Logs in using Okta credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}okta{{/mount_point}}/login/{{username}} ``` -------------------------------- ### vault.tokenRoles Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all token roles available in the system. ```APIDOC ## vault.tokenRoles ### Description Lists all token roles available in the system. ### Method GET ### Endpoint /auth/token/roles?list=true ``` -------------------------------- ### Register and Use Custom API Commands Source: https://github.com/nodevault/node-vault/blob/master/README.md Shows how to define and use custom API commands that are not part of the default node-vault API. The `generateFunction` method creates a new method on the vault client instance. ```javascript vault.generateFunction('myCustomEndpoint', { method: 'GET', path: '/my-custom/endpoint/{{id}}', }); // Use the generated function vault.myCustomEndpoint({ id: 'abc123' }) .then(console.log) .catch(console.error); ``` -------------------------------- ### vault.auths Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all enabled authentication methods. ```APIDOC ## vault.auths ### Description Lists all enabled authentication methods. ### Method GET ### Endpoint `/sys/auth` ``` -------------------------------- ### vault.remount Source: https://github.com/nodevault/node-vault/blob/master/features.md Remounts a storage backend. ```APIDOC ## vault.remount ### Description Remounts a storage backend. ### Method POST ### Endpoint `/sys/remount` ``` -------------------------------- ### Write, Read, and Delete Secrets Source: https://github.com/nodevault/node-vault/blob/master/README.md Performs a sequence of operations to write a secret, then read it, and finally delete it. Assumes the 'secret/hello' path exists or can be created. ```javascript vault.write('secret/hello', { value: 'world', lease: '1s' }) .then(() => vault.read('secret/hello')) .then(() => vault.delete('secret/hello')) .catch(console.error); ``` -------------------------------- ### vault.transitCreateKey Source: https://github.com/nodevault/node-vault/blob/master/features.md Creates a new Transit key. ```APIDOC ## vault.transitCreateKey ### Description Creates a new Transit key. ### Method POST ### Endpoint `/transit/keys/{{name}}` ``` -------------------------------- ### vault.generateRootCancel Source: https://github.com/nodevault/node-vault/blob/master/features.md Cancels the root generation process. ```APIDOC ## vault.generateRootCancel ### Description Cancels the root generation process. ### Method DELETE ### Endpoint `/sys/generate-root/attempt` ``` -------------------------------- ### vault.enableAudit Source: https://github.com/nodevault/node-vault/blob/master/features.md Enables an audit device. ```APIDOC ## vault.enableAudit ### Description Enables an audit device. ### Method PUT ### Endpoint `/sys/audit/{{name}}` ``` -------------------------------- ### vault.enableAuth Source: https://github.com/nodevault/node-vault/blob/master/features.md Enables an authentication method. ```APIDOC ## vault.enableAuth ### Description Enables an authentication method. ### Method POST ### Endpoint `/sys/auth/{{mount_point}}` ``` -------------------------------- ### vault.transitListKeys Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all Transit keys. ```APIDOC ## vault.transitListKeys ### Description Lists all Transit keys. ### Method LIST ### Endpoint `/transit/keys` ``` -------------------------------- ### vault.audits Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all enabled audit devices. ```APIDOC ## vault.audits ### Description Lists all enabled audit devices. ### Method GET ### Endpoint `/sys/audit` ``` -------------------------------- ### vault.generateRootUpdate Source: https://github.com/nodevault/node-vault/blob/master/features.md Updates the root generation process. ```APIDOC ## vault.generateRootUpdate ### Description Updates the root generation process. ### Method PUT ### Endpoint `/sys/generate-root/update` ``` -------------------------------- ### vault.tokenCreate Source: https://github.com/nodevault/node-vault/blob/master/features.md Creates a new token. This is the primary method for generating new authentication tokens. ```APIDOC ## vault.tokenCreate ### Description Creates a new token. ### Method POST ### Endpoint /auth/token/create ``` -------------------------------- ### Unseal an Already Initialized Vault Server (Single Key) Source: https://github.com/nodevault/node-vault/blob/master/README.md Unseals a Vault server using a single provided unseal key. This is useful when the server has been restarted or sealed. ```javascript const vault = require('node-vault')({ apiVersion: 'v1', endpoint: 'http://127.0.0.1:8200', }); // unseal vault server with a single key vault.unseal({ key: 'my-unseal-key' }) .then(console.log) .catch(console.error); ``` -------------------------------- ### vault.approleRoles Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all AppRole roles within a given mount point. ```APIDOC ## vault.approleRoles ### Description Lists all AppRole roles within a given mount point. ### Method LIST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role ``` -------------------------------- ### vault.stepDown Source: https://github.com/nodevault/node-vault/blob/master/features.md Initiates a leader step-down operation. ```APIDOC ## vault.stepDown ### Description Initiates a leader step-down operation. ### Method PUT ### Endpoint /sys/step-down ``` -------------------------------- ### vault.githubLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using GitHub credentials. This method authenticates with Vault using GitHub personal access tokens or other GitHub credentials. ```APIDOC ## vault.githubLogin ### Description Logs in using GitHub credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}github{{/mount_point}}/login ``` -------------------------------- ### vault.awsIamLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using AWS IAM credentials. This method authenticates with Vault using AWS IAM roles or access keys. ```APIDOC ## vault.awsIamLogin ### Description Logs in using AWS IAM credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}aws{{/mount_point}}/login ``` -------------------------------- ### List Secrets Source: https://github.com/nodevault/node-vault/blob/master/README.md Lists the keys (secrets) available under a specified path in Vault. The result's keys are logged to the console. ```javascript vault.list('secret/metadata/') .then((result) => console.log(result.data.keys)) .catch(console.error); ``` -------------------------------- ### vault.gcpLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using GCP credentials. This method authenticates with Vault using GCP service account credentials. ```APIDOC ## vault.gcpLogin ### Description Logs in using GCP credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}gcp{{/mount_point}}/login ``` -------------------------------- ### vault.ldapLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using LDAP credentials. This method authenticates with Vault using LDAP bind credentials. ```APIDOC ## vault.ldapLogin ### Description Logs in using LDAP credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}ldap{{/mount_point}}/login/{{username}} ``` -------------------------------- ### vault.unseal Source: https://github.com/nodevault/node-vault/blob/master/features.md Unseals the Vault server. ```APIDOC ## vault.unseal ### Description Unseals the Vault server. ### Method PUT ### Endpoint /sys/unseal ``` -------------------------------- ### vault.addKubernetesRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Adds a new Kubernetes role to Vault. ```APIDOC ## vault.addKubernetesRole ### Description Adds a new Kubernetes role to Vault. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}{{kubernetesPath}}{{/mount_point}}/role/{{ role_name }} ``` -------------------------------- ### Error Handling for Vault API Responses Source: https://github.com/nodevault/node-vault/blob/master/README.md Demonstrates how to catch and handle errors when interacting with Vault, specifically focusing on `VaultError` and `ApiResponseError`. It logs the error message and, if available, the HTTP status code and response body from Vault. ```javascript vault.read('secret/missing') .catch((err) => { console.error(err.message); // Error message from Vault if (err.response) { console.error(err.response.statusCode); // e.g. 404 console.error(err.response.body); // Response body from Vault } }); ``` -------------------------------- ### Set Vault Token Environment Variable Source: https://github.com/nodevault/node-vault/blob/master/README.md Export the obtained root token as an environment variable to authenticate subsequent operations. ```bash export VAULT_TOKEN= ``` -------------------------------- ### vault.unmount Source: https://github.com/nodevault/node-vault/blob/master/features.md Unmounts a storage backend. ```APIDOC ## vault.unmount ### Description Unmounts a storage backend. ### Method DELETE ### Endpoint `/sys/mounts/{{mount_point}}` ``` -------------------------------- ### vault.tokenAccessors Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists all token accessors. This is useful for auditing and managing token lifecycles. ```APIDOC ## vault.tokenAccessors ### Description Lists all token accessors. ### Method LIST ### Endpoint /auth/token/accessors ``` -------------------------------- ### vault.generateDatabaseCredentials Source: https://github.com/nodevault/node-vault/blob/master/features.md Generates database credentials. ```APIDOC ## vault.generateDatabaseCredentials ### Description Generates database credentials. ### Method GET ### Endpoint `/{{databasePath}}/creds/{{name}}` ``` -------------------------------- ### vault.certLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using client certificates. This method authenticates with Vault using mTLS client certificates. ```APIDOC ## vault.certLogin ### Description Logs in using client certificates. ### Method POST ### Endpoint /auth/cert/login ``` -------------------------------- ### vault.seal Source: https://github.com/nodevault/node-vault/blob/master/features.md Seals the Vault server. ```APIDOC ## vault.seal ### Description Seals the Vault server. ### Method PUT ### Endpoint /sys/seal ``` -------------------------------- ### vault.radiusLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using RADIUS credentials. This method authenticates with Vault using RADIUS authentication. ```APIDOC ## vault.radiusLogin ### Description Logs in using RADIUS credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}radius{{/mount_point}}/login/{{username}} ``` -------------------------------- ### vault.jwtLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using JWT credentials. This method authenticates with Vault using JSON Web Tokens. ```APIDOC ## vault.jwtLogin ### Description Logs in using JWT credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}jwt{{/mount_point}}/login ``` -------------------------------- ### vault.leader Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves information about the current Vault leader. ```APIDOC ## vault.leader ### Description Retrieves information about the current Vault leader. ### Method GET ### Endpoint /sys/leader ``` -------------------------------- ### vault.getKubernetesRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves a specific Kubernetes role. ```APIDOC ## vault.getKubernetesRole ### Description Retrieves a specific Kubernetes role. ### Method GET ### Endpoint /auth/{{mount_point}}{{^mount_point}}{{kubernetesPath}}{{/mount_point}}/role/{{ role_name }} ``` -------------------------------- ### vault.tokenCreateRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Creates a new token with a specific role. Tokens created with roles inherit the policies and configurations defined for that role. ```APIDOC ## vault.tokenCreateRole ### Description Creates a new token with a specific role. ### Method POST ### Endpoint /auth/token/create/{{role_name}} ``` -------------------------------- ### vault.status Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves the seal status of the Vault server. ```APIDOC ## vault.status ### Description Retrieves the seal status of the Vault server. ### Method GET ### Endpoint /sys/seal-status ``` -------------------------------- ### vault.userpassLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using username and password. This method authenticates with Vault using traditional username and password credentials. ```APIDOC ## vault.userpassLogin ### Description Logs in using username and password. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}userpass{{/mount_point}}/login/{{username}} ``` -------------------------------- ### vault.addApproleRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Adds a new AppRole role to Vault. ```APIDOC ## vault.addApproleRole ### Description Adds a new AppRole role to Vault. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}} ``` -------------------------------- ### vault.transitReadKey Source: https://github.com/nodevault/node-vault/blob/master/features.md Reads information about a Transit key. ```APIDOC ## vault.transitReadKey ### Description Reads information about a Transit key. ### Method GET ### Endpoint `/transit/keys/{{name}}` ``` -------------------------------- ### vault.addTokenRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Adds a new token role to the system. ```APIDOC ## vault.addTokenRole ### Description Adds a new token role to the system. ### Method POST ### Endpoint /auth/token/roles/{{role_name}} ``` -------------------------------- ### vault.addPolicy Source: https://github.com/nodevault/node-vault/blob/master/features.md Adds a new policy. ```APIDOC ## vault.addPolicy ### Description Adds a new policy. ### Method PUT ### Endpoint `/sys/policy/{{name}}` ``` -------------------------------- ### vault.revokePrefix Source: https://github.com/nodevault/node-vault/blob/master/features.md Revokes all leases with a given prefix. This is useful for batch revocation. ```APIDOC ## vault.revokePrefix ### Description Revokes all leases with a given prefix. ### Method PUT ### Endpoint /sys/revoke-prefix/{{path_prefix}} ``` -------------------------------- ### AppRole Authentication Source: https://github.com/nodevault/node-vault/blob/master/README.md Logs into Vault using the AppRole authentication method with a provided role ID and secret ID. The client token is automatically set upon successful login. ```javascript const vault = require('node-vault')(); vault.approleLogin({ role_id: 'my-role-id', secret_id: 'my-secret-id', }) .then((result) => { // client token is automatically set on successful login console.log(result.auth.client_token); }) .catch(console.error); ``` -------------------------------- ### vault.kubernetesLogin Source: https://github.com/nodevault/node-vault/blob/master/features.md Logs in using Kubernetes service account credentials. This method authenticates with Vault using JWTs issued by a Kubernetes cluster. ```APIDOC ## vault.kubernetesLogin ### Description Logs in using Kubernetes service account credentials. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}{{kubernetesPath}}{{/mount_point}}/login ``` -------------------------------- ### Per-Call Request Options for Node-Vault Source: https://github.com/nodevault/node-vault/blob/master/README.md Pass request options, such as SSL/TLS configurations, on a per-call basis to specific Vault API methods. ```javascript vault.read('secret/hello', { agentOptions: { securityOptions: 'SSL_OP_LEGACY_SERVER_CONNECT', }, }); ``` -------------------------------- ### vault.getPolicy Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves a specific policy. ```APIDOC ## vault.getPolicy ### Description Retrieves a specific policy. ### Method GET ### Endpoint `/sys/policy/{{name}}` ``` -------------------------------- ### Kubernetes Authentication Source: https://github.com/nodevault/node-vault/blob/master/README.md Authenticates with Vault using Kubernetes service account credentials. Reads the JWT token from the default mount path and sends it along with the role and mount point to the Vault API. ```javascript const fs = require('fs'); // Read service account token from default mount path const jwt = fs.readFileSync('/var/run/secrets/kubernetes.io/serviceaccount/token', { encoding: 'utf8' }); // If the Vault Kubernetes auth endpoint is /auth/example-cluster/login and the role is example-role vault.kubernetesLogin({ role: 'example-role', jwt: jwt, mount_point: 'example-cluster', }).catch(console.error); ``` -------------------------------- ### vault.tokenCreateOrphan Source: https://github.com/nodevault/node-vault/blob/master/features.md Creates an orphan token. Orphan tokens are not associated with any parent token and have their own independent lifecycle. ```APIDOC ## vault.tokenCreateOrphan ### Description Creates an orphan token. ### Method POST ### Endpoint /auth/token/create-orphan ``` -------------------------------- ### vault.getApproleRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves a specific AppRole role. ```APIDOC ## vault.getApproleRole ### Description Retrieves a specific AppRole role. ### Method GET ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}} ``` -------------------------------- ### vault.approleSecretAccessors Source: https://github.com/nodevault/node-vault/blob/master/features.md Lists secret accessors for a given AppRole. ```APIDOC ## vault.approleSecretAccessors ### Description Lists secret accessors for a given AppRole. ### Method LIST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/secret-id ``` -------------------------------- ### vault.rewrapData Source: https://github.com/nodevault/node-vault/blob/master/features.md Rewraps data using a specified Transit key. ```APIDOC ## vault.rewrapData ### Description Rewraps data using a specified Transit key. ### Method POST ### Endpoint `/transit/rewrap/{{name}}` ``` -------------------------------- ### vault.getTokenRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves a specific token role. ```APIDOC ## vault.getTokenRole ### Description Retrieves a specific token role. ### Method GET ### Endpoint /auth/token/roles/{{role_name}} ``` -------------------------------- ### vault.health Source: https://github.com/nodevault/node-vault/blob/master/features.md Checks the health status of the Vault server. ```APIDOC ## vault.health ### Description Checks the health status of the Vault server. ### Method GET ### Endpoint /sys/health ``` -------------------------------- ### vault.tokenLookup Source: https://github.com/nodevault/node-vault/blob/master/features.md Looks up a token. This method retrieves information about a given token, including its properties and associated policies. ```APIDOC ## vault.tokenLookup ### Description Looks up a token. ### Method POST ### Endpoint /auth/token/lookup ``` -------------------------------- ### vault.tokenLookupSelf Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves information about the token used to make the request. ```APIDOC ## vault.tokenLookupSelf ### Description Retrieves information about the token used to make the request. ### Method GET ### Endpoint /auth/token/lookup-self ``` -------------------------------- ### vault.tokenLookupAccessor Source: https://github.com/nodevault/node-vault/blob/master/features.md Looks up a token by its accessor. This is useful for retrieving token information when only the accessor ID is known. ```APIDOC ## vault.tokenLookupAccessor ### Description Looks up a token by its accessor. ### Method POST ### Endpoint /auth/token/lookup-accessor ``` -------------------------------- ### vault.transitDeleteKey Source: https://github.com/nodevault/node-vault/blob/master/features.md Deletes a Transit key. ```APIDOC ## vault.transitDeleteKey ### Description Deletes a Transit key. ### Method DELETE ### Endpoint `/transit/keys/{{name}}` ``` -------------------------------- ### vault.approleSecretLookup Source: https://github.com/nodevault/node-vault/blob/master/features.md Looks up a secret ID for a given AppRole. ```APIDOC ## vault.approleSecretLookup ### Description Looks up a secret ID for a given AppRole. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/secret-id/lookup ``` -------------------------------- ### Update Secret using PATCH (Merge Patch) Source: https://github.com/nodevault/node-vault/blob/master/README.md Updates an existing secret using the `update` method, which sends a PATCH request with `application/merge-patch+json` content type. This is useful for partial updates to a secret. ```javascript vault.update('secret/data/hello', { data: { value: 'new-world' } }) .catch(console.error); ``` -------------------------------- ### vault.encryptData Source: https://github.com/nodevault/node-vault/blob/master/features.md Encrypts data using a specified Transit key. ```APIDOC ## vault.encryptData ### Description Encrypts data using a specified Transit key. ### Method POST ### Endpoint `/transit/encrypt/{{name}}` ``` -------------------------------- ### vault.renew Source: https://github.com/nodevault/node-vault/blob/master/features.md Renews a lease. ```APIDOC ## vault.renew ### Description Renews a lease. ### Method PUT ### Endpoint `/sys/leases/renew` ``` -------------------------------- ### vault.approleSecretAccessorLookup Source: https://github.com/nodevault/node-vault/blob/master/features.md Looks up a secret ID accessor for a given AppRole. ```APIDOC ## vault.approleSecretAccessorLookup ### Description Looks up a secret ID accessor for a given AppRole. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/secret-id-accessor/lookup ``` -------------------------------- ### vault.tokenRevoke Source: https://github.com/nodevault/node-vault/blob/master/features.md Revokes a token. ```APIDOC ## vault.tokenRevoke ### Description Revokes a token. ### Method POST ### Endpoint /auth/token/revoke ``` -------------------------------- ### vault.unwrap Source: https://github.com/nodevault/node-vault/blob/master/features.md Unwraps a wrapped response. This is used to retrieve the original payload from a securely wrapped message. ```APIDOC ## vault.unwrap ### Description Unwraps a wrapped response. ### Method POST ### Endpoint /sys/wrapping/unwrap ``` -------------------------------- ### vault.deleteKubernetesRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Deletes a Kubernetes role from Vault. ```APIDOC ## vault.deleteKubernetesRole ### Description Deletes a Kubernetes role from Vault. ### Method DELETE ### Endpoint /auth/{{mount_point}}{{^mount_point}}{{kubernetesPath}}{{/mount_point}}/role/{{ role_name }} ``` -------------------------------- ### vault.destroySecretVersions Source: https://github.com/nodevault/node-vault/blob/master/features.md Destroys specific versions of a secret. ```APIDOC ## vault.destroySecretVersions ### Description Destroys specific versions of a secret. ### Method POST ### Endpoint /{{mount_point}}{{^mount_point}}secret{{/mount_point}}/destroy/{{path}} ``` -------------------------------- ### vault.tokenRevokeAccessor Source: https://github.com/nodevault/node-vault/blob/master/features.md Revokes a token using its accessor. ```APIDOC ## vault.tokenRevokeAccessor ### Description Revokes a token using its accessor. ### Method POST ### Endpoint /auth/token/revoke-accessor ``` -------------------------------- ### vault.decryptData Source: https://github.com/nodevault/node-vault/blob/master/features.md Decrypts data using a specified Transit key. ```APIDOC ## vault.decryptData ### Description Decrypts data using a specified Transit key. ### Method POST ### Endpoint `/transit/decrypt/{{name}}` ``` -------------------------------- ### vault.rotate Source: https://github.com/nodevault/node-vault/blob/master/features.md Rotates the token associated with the current request. This is a security measure to refresh credentials. ```APIDOC ## vault.rotate ### Description Rotates the token associated with the current request. ### Method PUT ### Endpoint /sys/rotate ``` -------------------------------- ### vault.disableAudit Source: https://github.com/nodevault/node-vault/blob/master/features.md Disables an audit device. ```APIDOC ## vault.disableAudit ### Description Disables an audit device. ### Method DELETE ### Endpoint `/sys/audit/{{name}}` ``` -------------------------------- ### vault.tokenRenew Source: https://github.com/nodevault/node-vault/blob/master/features.md Renews a token with the specified properties. ```APIDOC ## vault.tokenRenew ### Description Renews a token with the specified properties. ### Method POST ### Endpoint /auth/token/renew ``` -------------------------------- ### vault.disableAuth Source: https://github.com/nodevault/node-vault/blob/master/features.md Disables an authentication method. ```APIDOC ## vault.disableAuth ### Description Disables an authentication method. ### Method DELETE ### Endpoint `/sys/auth/{{mount_point}}` ``` -------------------------------- ### vault.approleSecretAccessorDestroy Source: https://github.com/nodevault/node-vault/blob/master/features.md Destroys a secret ID accessor for a given AppRole. ```APIDOC ## vault.approleSecretAccessorDestroy ### Description Destroys a secret ID accessor for a given AppRole. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/secret-id-accessor/destroy ``` -------------------------------- ### vault.getApproleRoleSecret Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves a secret ID for an AppRole. ```APIDOC ## vault.getApproleRoleSecret ### Description Retrieves a secret ID for an AppRole. ### Method POST ### Endpoint `/auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/secret-id` ``` -------------------------------- ### vault.removePolicy Source: https://github.com/nodevault/node-vault/blob/master/features.md Removes a policy. ```APIDOC ## vault.removePolicy ### Description Removes a policy. ### Method DELETE ### Endpoint `/sys/policy/{{name}}` ``` -------------------------------- ### vault.revoke Source: https://github.com/nodevault/node-vault/blob/master/features.md Revokes a lease. This operation is used to invalidate a previously issued lease. ```APIDOC ## vault.revoke ### Description Revokes a lease. ### Method PUT ### Endpoint /sys/leases/revoke ``` -------------------------------- ### vault.approleSecretDestroy Source: https://github.com/nodevault/node-vault/blob/master/features.md Destroys a secret ID for a given AppRole. ```APIDOC ## vault.approleSecretDestroy ### Description Destroys a secret ID for a given AppRole. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/secret-id/destroy ``` -------------------------------- ### vault.deleteApproleRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Deletes an AppRole role from Vault. ```APIDOC ## vault.deleteApproleRole ### Description Deletes an AppRole role from Vault. ### Method DELETE ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}} ``` -------------------------------- ### vault.getApproleRoleId Source: https://github.com/nodevault/node-vault/blob/master/features.md Retrieves the Role ID for a given AppRole. ```APIDOC ## vault.getApproleRoleId ### Description Retrieves the Role ID for a given AppRole. ### Method GET ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/role-id ``` -------------------------------- ### vault.tokenRevokeSelf Source: https://github.com/nodevault/node-vault/blob/master/features.md Revokes the token used to make the request. ```APIDOC ## vault.tokenRevokeSelf ### Description Revokes the token used to make the request. ### Method POST ### Endpoint /auth/token/revoke-self ``` -------------------------------- ### vault.removeTokenRole Source: https://github.com/nodevault/node-vault/blob/master/features.md Removes a token role. ```APIDOC ## vault.removeTokenRole ### Description Removes a token role. ### Method DELETE ### Endpoint /auth/token/roles/{{role_name}} ``` -------------------------------- ### vault.tokenRevokeOrphan Source: https://github.com/nodevault/node-vault/blob/master/features.md Revokes tokens that are not associated with any other token. ```APIDOC ## vault.tokenRevokeOrphan ### Description Revokes tokens that are not associated with any other token. ### Method POST ### Endpoint /auth/token/revoke-orphan ``` -------------------------------- ### vault.updateApproleRoleId Source: https://github.com/nodevault/node-vault/blob/master/features.md Updates the Role ID for a given AppRole. ```APIDOC ## vault.updateApproleRoleId ### Description Updates the Role ID for a given AppRole. ### Method POST ### Endpoint /auth/{{mount_point}}{{^mount_point}}approle{{/mount_point}}/role/{{role_name}}/role-id ``` -------------------------------- ### vault.tokenRenewSelf Source: https://github.com/nodevault/node-vault/blob/master/features.md Renews the token used to make the request. ```APIDOC ## vault.tokenRenewSelf ### Description Renews the token used to make the request. ### Method POST ### Endpoint /auth/token/renew-self ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.