forked from shahradelahi/node-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: start using wiki pages (shahradelahi#32)
- Loading branch information
1 parent
865148a
commit 63ca563
Showing
15 changed files
with
371 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Wiki | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
paths: | ||
- .wiki/** | ||
- .github/workflows/wiki.yml | ||
|
||
concurrency: | ||
group: publish-wiki | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
publish-wiki: | ||
if: github.repository == 'shahradelahi/node-vault' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- uses: Andrew-Chen-Wang/github-wiki-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: '${{ env.SHORT_SHA }}: ${{ github.event.head_commit.message }}' | ||
repository: ${{ github.repository }} | ||
path: .wiki |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
Welcome to the node-vault wiki! | ||
|
||
# Supported features | ||
|
||
## Secrets Engines | ||
|
||
- [ ] [AliCloud](https://developer.hashicorp.com/vault/api-docs/secret/alicloud) | ||
- [x] [AWS](https://developer.hashicorp.com/vault/api-docs/secret/aws) | ||
- [ ] [Azure](https://developer.hashicorp.com/vault/api-docs/secret/azure) | ||
- [ ] [Consul](https://developer.hashicorp.com/vault/api-docs/secret/consul) | ||
- [ ] [Cubbyhole](https://developer.hashicorp.com/vault/api-docs/secret/cubbyhole) | ||
- [ ] [Google Cloud](https://developer.hashicorp.com/vault/api-docs/secret/gcp) | ||
- [ ] [Google Cloud KMS](https://developer.hashicorp.com/vault/api-docs/secret/gcpkms) | ||
- [ ] [KMIP](https://developer.hashicorp.com/vault/api-docs/secret/kmip) | ||
- [x] [Kubernetes](https://developer.hashicorp.com/vault/api-docs/secret/kubernetes) | ||
- [ ] [MongoDB Atlas](https://developer.hashicorp.com/vault/api-docs/secret/mongodbatlas) | ||
- [ ] [Nomad](https://developer.hashicorp.com/vault/api-docs/secret/nomad) | ||
- [ ] [LDAP](https://developer.hashicorp.com/vault/api-docs/secret/ldap) | ||
- [ ] [PKI](https://developer.hashicorp.com/vault/api-docs/secret/pki) | ||
- [ ] [RabbitMQ](https://developer.hashicorp.com/vault/api-docs/secret/rabbitmq) | ||
- [ ] [SSH](https://developer.hashicorp.com/vault/api-docs/secret/ssh) | ||
- [ ] [Terraform Cloud](https://developer.hashicorp.com/vault/api-docs/secret/terraform) | ||
- [ ] [TOTP](https://developer.hashicorp.com/vault/api-docs/secret/totp) | ||
- [ ] [Transform](https://developer.hashicorp.com/vault/api-docs/secret/transform) | ||
- [ ] [Transit](https://developer.hashicorp.com/vault/api-docs/secret/transit) | ||
|
||
### Database | ||
|
||
- [ ] [Cassandra](https://developer.hashicorp.com/vault/api-docs/secret/databases/cassandra) | ||
- [ ] [Couchbase](https://developer.hashicorp.com/vault/api-docs/secret/databases/couchbase) | ||
- [ ] [Elasticsearch](https://developer.hashicorp.com/vault/api-docs/secret/databases/elasticdb) | ||
- [ ] [InfluxDB](https://developer.hashicorp.com/vault/api-docs/secret/databases/influxdb) | ||
- [ ] [HanaDB](https://developer.hashicorp.com/vault/api-docs/secret/databases/hanadb) | ||
- [ ] [MongoDB](https://developer.hashicorp.com/vault/api-docs/secret/databases/mongodb) | ||
- [ ] [MongoDB Atlas](https://developer.hashicorp.com/vault/api-docs/secret/databases/mongodbatlas) | ||
- [ ] [MSSQL](https://developer.hashicorp.com/vault/api-docs/secret/databases/mssql) | ||
- [ ] [MySQL/MariaDB](https://developer.hashicorp.com/vault/api-docs/secret/databases/mysql-maria) | ||
- [ ] [Oracle](https://developer.hashicorp.com/vault/api-docs/secret/databases/oracle) | ||
- [ ] [PostgreSQL](https://developer.hashicorp.com/vault/api-docs/secret/databases/postgresql) | ||
- [ ] [Redis](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis) | ||
- [ ] [Redis ElastiCache](https://developer.hashicorp.com/vault/api-docs/secret/databases/rediselasticache) | ||
- [ ] [Redshift](https://developer.hashicorp.com/vault/api-docs/secret/databases/redshift) | ||
- [ ] [Snowflake](https://developer.hashicorp.com/vault/api-docs/secret/databases/snowflake) | ||
|
||
### Identity | ||
|
||
- [ ] [Entity](https://developer.hashicorp.com/vault/api-docs/secret/identity/entity) | ||
- [ ] [Entity Alias](https://developer.hashicorp.com/vault/api-docs/secret/identity/entity-alias) | ||
- [ ] [Group](https://developer.hashicorp.com/vault/api-docs/secret/identity/group) | ||
- [ ] [Group Alias](https://developer.hashicorp.com/vault/api-docs/secret/identity/group-alias) | ||
- [ ] [Identity Tokens](https://developer.hashicorp.com/vault/api-docs/secret/identity/tokens) | ||
- [ ] [Lookup](https://developer.hashicorp.com/vault/api-docs/secret/identity/lookup) | ||
- [ ] [OIDC Provider](https://developer.hashicorp.com/vault/api-docs/secret/identity/oidc-provider) | ||
|
||
#### MFA | ||
|
||
- [ ] [Duo](https://developer.hashicorp.com/vault/api-docs/secret/identity/mfa/duo) | ||
- [ ] [Okta](https://developer.hashicorp.com/vault/api-docs/secret/identity/mfa/okta) | ||
- [ ] [PingID](https://developer.hashicorp.com/vault/api-docs/secret/identity/mfa/pingid) | ||
- [ ] [TOTP](https://developer.hashicorp.com/vault/api-docs/secret/identity/mfa/totp) | ||
- [ ] [Login Enforcement](https://developer.hashicorp.com/vault/api-docs/secret/identity/mfa/login-enforcement) | ||
|
||
### Key/Value | ||
|
||
- [x] [K/V Version 1](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v1) | ||
- [x] [K/V Version 2](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2) | ||
|
||
### Key Management | ||
|
||
- [ ] [Azure Key Vault](https://developer.hashicorp.com/vault/api-docs/secret/key-management/azurekeyvault) | ||
- [ ] [AWS KMS](https://developer.hashicorp.com/vault/api-docs/secret/key-management/awskms) | ||
- [ ] [GCP Cloud KMS](https://developer.hashicorp.com/vault/api-docs/secret/key-management/gcpkms) | ||
|
||
## Auth Methods | ||
|
||
- [ ] [AliCloud](https://developer.hashicorp.com/vault/api-docs/auth/alicloud) | ||
- [ ] [AppRole](https://developer.hashicorp.com/vault/api-docs/auth/approle) | ||
- [ ] [AWS](https://developer.hashicorp.com/vault/api-docs/auth/aws) | ||
- [ ] [Azure](https://developer.hashicorp.com/vault/api-docs/auth/azure) | ||
- [ ] [Cloud Foundry](https://developer.hashicorp.com/vault/api-docs/auth/cf) | ||
- [ ] [GitHub](https://developer.hashicorp.com/vault/api-docs/auth/github) | ||
- [ ] [Google Cloud](https://developer.hashicorp.com/vault/api-docs/auth/gcp) | ||
- [ ] [JWT/OIDC](https://developer.hashicorp.com/vault/api-docs/auth/jwt) | ||
- [ ] [Kerberos](https://developer.hashicorp.com/vault/api-docs/auth/kerberos) | ||
- [ ] [Kubernetes](https://developer.hashicorp.com/vault/api-docs/auth/kubernetes) | ||
- [ ] [LDAP](https://developer.hashicorp.com/vault/api-docs/auth/ldap) | ||
- [ ] [OCI](https://developer.hashicorp.com/vault/api-docs/auth/oci) | ||
- [ ] [Okta](https://developer.hashicorp.com/vault/api-docs/auth/okta) | ||
- [ ] [RADIUS](https://developer.hashicorp.com/vault/api-docs/auth/radius) | ||
- [ ] [SAML](https://developer.hashicorp.com/vault/api-docs/auth/saml) | ||
- [ ] [TLS Certificates](https://developer.hashicorp.com/vault/api-docs/auth/cert) | ||
- [ ] [Token](https://developer.hashicorp.com/vault/api-docs/auth/token) | ||
- [ ] [Username & Password](https://developer.hashicorp.com/vault/api-docs/auth/userpass) | ||
|
||
## System Backend | ||
|
||
- [x] [/sys/audit](https://developer.hashicorp.com/vault/api-docs/system/audit) | ||
- [ ] [/sys/audit-hash](https://developer.hashicorp.com/vault/api-docs/system/audit-hash) | ||
- [ ] [/sys/auth](https://developer.hashicorp.com/vault/api-docs/system/auth) | ||
- [x] [/sys/capabilities](https://developer.hashicorp.com/vault/api-docs/system/capabilities) | ||
- [ ] [/sys/capabilities-accessor](https://developer.hashicorp.com/vault/api-docs/system/capabilities-accessor) | ||
- [ ] [/sys/capabilities-self](https://developer.hashicorp.com/vault/api-docs/system/capabilities-self) | ||
- [ ] [/sys/config/auditing/request-headers](https://developer.hashicorp.com/vault/api-docs/system/config-auditing) | ||
- [ ] [/sys/config/control-group](https://developer.hashicorp.com/vault/api-docs/system/config-control-group) | ||
- [ ] [/sys/config/cors](https://developer.hashicorp.com/vault/api-docs/system/config-cors) | ||
- [ ] [/sys/config/group-policy-application](https://developer.hashicorp.com/vault/api-docs/system/config-group-policy-application) | ||
- [ ] [/sys/config/reload](https://developer.hashicorp.com/vault/api-docs/system/config-reload) | ||
- [ ] [/sys/config/state](https://developer.hashicorp.com/vault/api-docs/system/config-state) | ||
- [ ] [/sys/config/ui](https://developer.hashicorp.com/vault/api-docs/system/config-ui) | ||
- [ ] [/sys/control-group](https://developer.hashicorp.com/vault/api-docs/system/control-group) | ||
- [ ] [/sys/decode-token](https://developer.hashicorp.com/vault/api-docs/system/decode-token) | ||
- [ ] [/sys/experiments](https://developer.hashicorp.com/vault/api-docs/system/experiments) | ||
- [ ] [/sys/generate-recovery-token](https://developer.hashicorp.com/vault/api-docs/system/generate-recovery-token) | ||
- [x] [/sys/generate-root](https://developer.hashicorp.com/vault/api-docs/system/generate-root) | ||
- [x] [/sys/health](https://developer.hashicorp.com/vault/api-docs/system/health) | ||
- [x] [/sys/host-info](https://developer.hashicorp.com/vault/api-docs/system/host-info) | ||
- [ ] [/sys/in-flight-req](https://developer.hashicorp.com/vault/api-docs/system/in-flight-req) | ||
- [x] [/sys/init](https://developer.hashicorp.com/vault/api-docs/system/init) | ||
- [ ] [/sys/internal/counters](https://developer.hashicorp.com/vault/api-docs/system/internal-counters) | ||
- [ ] [/sys/internal/specs/openapi](https://developer.hashicorp.com/vault/api-docs/system/internal-specs-openapi) | ||
- [ ] [/sys/internal/ui/feature-flags](https://developer.hashicorp.com/vault/api-docs/system/internal-ui-feature) | ||
- [ ] [/sys/internal/ui/mounts](https://developer.hashicorp.com/vault/api-docs/system/internal-ui-mounts) | ||
- [ ] [/sys/internal/ui/namespaces](https://developer.hashicorp.com/vault/api-docs/system/internal-ui-namespaces) | ||
- [ ] [/sys/internal/ui/resultant-acl](https://developer.hashicorp.com/vault/api-docs/system/internal-ui-resultant-acl) | ||
- [ ] [/sys/key-status](https://developer.hashicorp.com/vault/api-docs/system/key-status) | ||
- [ ] [/sys/ha-status](https://developer.hashicorp.com/vault/api-docs/system/ha-status) | ||
- [ ] [/sys/leader](https://developer.hashicorp.com/vault/api-docs/system/leader) | ||
- [ ] [/sys/leases](https://developer.hashicorp.com/vault/api-docs/system/leases) | ||
- [ ] [/sys/license/status](https://developer.hashicorp.com/vault/api-docs/system/license) | ||
- [ ] [/sys/locked-users](https://developer.hashicorp.com/vault/api-docs/system/user-lockout) | ||
- [ ] [/sys/loggers](https://developer.hashicorp.com/vault/api-docs/system/loggers) | ||
- [ ] [/sys/managed-keys](https://developer.hashicorp.com/vault/api-docs/system/managed-keys) | ||
- [ ] [/sys/metrics](https://developer.hashicorp.com/vault/api-docs/system/metrics) | ||
- [ ] [/sys/monitor](https://developer.hashicorp.com/vault/api-docs/system/monitor) | ||
- [x] [/sys/mounts](https://developer.hashicorp.com/vault/api-docs/system/mounts) | ||
- [ ] [/sys/namespaces](https://developer.hashicorp.com/vault/api-docs/system/namespaces) | ||
- [ ] [/sys/plugins/reload/backend](https://developer.hashicorp.com/vault/api-docs/system/plugins-reload-backend) | ||
- [ ] [/sys/plugins/catalog](https://developer.hashicorp.com/vault/api-docs/system/plugins-catalog) | ||
- [ ] [/sys/plugins/runtimes/catalog](https://developer.hashicorp.com/vault/api-docs/system/plugins-runtimes-catalog) | ||
- [ ] [/sys/policy](https://developer.hashicorp.com/vault/api-docs/system/policy) | ||
- [ ] [/sys/policies](https://developer.hashicorp.com/vault/api-docs/system/policies) | ||
- [ ] [/sys/policies/password](https://developer.hashicorp.com/vault/api-docs/system/policies-password) | ||
- [ ] [/sys/pprof](https://developer.hashicorp.com/vault/api-docs/system/pprof) | ||
- [ ] [/sys/quotas/config](https://developer.hashicorp.com/vault/api-docs/system/quotas-config) | ||
- [ ] [/sys/quotas/rate-limit](https://developer.hashicorp.com/vault/api-docs/system/rate-limit-quotas) | ||
- [ ] [/sys/quotas/lease-count](https://developer.hashicorp.com/vault/api-docs/system/lease-count-quotas) | ||
- [ ] [/sys/raw](https://developer.hashicorp.com/vault/api-docs/system/raw) | ||
- [ ] [/sys/rekey](https://developer.hashicorp.com/vault/api-docs/system/rekey) | ||
- [ ] [/sys/rekey-recovery-key](https://developer.hashicorp.com/vault/api-docs/system/rekey-recovery-key) | ||
- [ ] [/sys/remount](https://developer.hashicorp.com/vault/api-docs/system/remount) | ||
- [ ] [/sys/rotate](https://developer.hashicorp.com/vault/api-docs/system/rotate) | ||
- [ ] [/sys/rotate/config](https://developer.hashicorp.com/vault/api-docs/system/rotate-config) | ||
- [x] [/sys/seal](https://developer.hashicorp.com/vault/api-docs/system/seal) | ||
- [x] [/sys/seal-status](https://developer.hashicorp.com/vault/api-docs/system/seal-status) | ||
- [ ] [/sys/seal-backend-status](https://developer.hashicorp.com/vault/api-docs/system/seal-backend-status) | ||
- [ ] [/sys/sealwrap/rewrap](https://developer.hashicorp.com/vault/api-docs/system/sealwrap-rewrap) | ||
- [ ] [/sys/step-down](https://developer.hashicorp.com/vault/api-docs/system/step-down) | ||
- [ ] [/sys/sync](https://developer.hashicorp.com/vault/api-docs/system/secrets-sync) | ||
- [ ] [/sys/tools](https://developer.hashicorp.com/vault/api-docs/system/tools) | ||
- [x] [/sys/unseal](https://developer.hashicorp.com/vault/api-docs/system/unseal) | ||
- [ ] [/sys/version-history](https://developer.hashicorp.com/vault/api-docs/system/version-history) | ||
- [ ] [/sys/wrapping/lookup](https://developer.hashicorp.com/vault/api-docs/system/wrapping-lookup) | ||
- [ ] [/sys/wrapping/rewrap](https://developer.hashicorp.com/vault/api-docs/system/wrapping-rewrap) | ||
- [ ] [/sys/wrapping/unwrap](https://developer.hashicorp.com/vault/api-docs/system/wrapping-unwrap) | ||
- [ ] [/sys/wrapping/wrap](https://developer.hashicorp.com/vault/api-docs/system/wrapping-wrap) | ||
|
||
### /sys/internal/inspect | ||
|
||
- [ ] [/sys/internal/inspect/router](https://developer.hashicorp.com/vault/api-docs/system/inspect/router) | ||
|
||
### /sys/mfa | ||
|
||
- [ ] [/sys/mfa/method/duo](https://developer.hashicorp.com/vault/api-docs/system/mfa/duo) | ||
- [ ] [/sys/mfa/method/okta](https://developer.hashicorp.com/vault/api-docs/system/mfa/okta) | ||
- [ ] [/sys/mfa/method/pingid](https://developer.hashicorp.com/vault/api-docs/system/mfa/pingid) | ||
- [ ] [/sys/mfa/method/totp](https://developer.hashicorp.com/vault/api-docs/system/mfa/totp) | ||
- [ ] [/sys/mfa/validate](https://developer.hashicorp.com/vault/api-docs/system/mfa/validate) | ||
|
||
### /sys/replication | ||
|
||
- [ ] [/sys/replication/performance](https://developer.hashicorp.com/vault/api-docs/system/replication/replication-performance) | ||
- [ ] [/sys/replication/dr](https://developer.hashicorp.com/vault/api-docs/system/replication/replication-dr) | ||
|
||
### /sys/storage | ||
|
||
- [ ] [/sys/storage/raft](https://developer.hashicorp.com/vault/api-docs/system/storage/raft) | ||
- [ ] [/sys/storage/raft/snapshot-auto](https://developer.hashicorp.com/vault/api-docs/system/storage/raftautosnapshots) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
## Custom Command Implementation | ||
|
||
At times, you may need to use a command or endpoint that is not available in the library, or you may want to use it in a | ||
different way. Here is an example of how to do that: | ||
|
||
```typescript | ||
import { Client } from '@litehex/node-vault'; | ||
import { z } from 'zod'; | ||
|
||
const vc = new Client({ | ||
/** ... */ | ||
}); | ||
|
||
const status = generateCommand({ | ||
path: '/sys/seal-status', | ||
method: 'GET', | ||
client: vc, | ||
// refine: change the request before sending | ||
refine: (req, args) => { | ||
req.headers = Object.assign(req.headers || {}, { | ||
'X-Custom-Header': 'bar' | ||
}); | ||
|
||
console.log(args); // { 'X-Zone': 'foo' } | ||
|
||
return req; | ||
}, | ||
schema: { | ||
// path: z.object({}), Schema for template in path | ||
// searchParams: z.object({}), Any schema for query params | ||
// headers: z.object({}), Headers schema | ||
headers: z.object({ | ||
'X-Zone': z.string() | ||
}), | ||
// body: z.object({}), // Schema for request body | ||
response: z.object({ | ||
sealed: z.boolean() | ||
}) | ||
} | ||
}); | ||
|
||
await status({ 'X-Zone': 'foo' }); | ||
``` | ||
|
||
If you do not understand how you must write your command, please refer | ||
to [the source code](https://github.com/shahradelahi/node-vault). There is various of the working code in the source | ||
code. | ||
|
||
## Send Requests Using Proxy | ||
|
||
To connect to a Vault server in a private network, you can use proxies to send the request. | ||
|
||
First, install the `undici` package, which is the default HTTP client for Node.js: | ||
|
||
```bash | ||
npm install undici | ||
``` | ||
|
||
Then, using the following code, create a proxy agent and pass it to the client: | ||
|
||
```typescript | ||
import { Client } from '@litehex/node-vault'; | ||
import { ProxyAgent } from 'undici'; | ||
|
||
const agent = new ProxyAgent('http://localhost:8080'); | ||
|
||
const vc = new Client({ | ||
// ... other params | ||
request: { dispatcher: agent } | ||
}); | ||
|
||
// Each individual command accepts the a second parameter to modify the request | ||
const status = vc.sealStatus(undefined, { dispatcher: agent }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.