PURISTA API / Modules / @purista/infisical-secret-store
Module: @purista/infisical-secret-store
A secret store for using Infisical as storage.
For performance reasons, and to reduce costs, the secret values are cached in memory after first fetch.
You can disable the whole caching via config by setting enableCache to false.
If the cache is enabled, you can set the ttl for cached secret values via config cacheTtl (in ms).
This will return the cached secret if available and if ttl is not exceeded.
If a secret value exceeds the ttl, it does not automatically get removed from cache.
It will be removed/overwritten on next get request.
Example
const config = {
bearerToken: 'YOUR_INFISICAL_TOKEN',
baseUrl: 'https://app.infisical.com'
}
const store = new InfisicalSecretStore({ config })
await store.setSecret('mySecret', 'value')
let value = await store.getSecret('mySecret')
console.log(value) // outputs: { mySecret: 'value' }
await store.removeSecret('mySecret')
value = await store.getSecret('mySecret')
console.log(value) // outputs: undefined
Table of contents
Classes
Type Aliases
Variables
Type Aliases
ClientConfig
Ƭ ClientConfig: Prettify
<Required
<Pick
<HttpClientConfig
<HttpClientConfigCustom
>, "bearerToken"
>> & Omit
<HttpClientConfig
<HttpClientConfigCustom
>, "bearerToken"
>>
Defined in
infisical-secret-store/src/InfisicalClient/types/ClientConfig.ts:5
DecryptInput
Ƭ DecryptInput: Object
Type declaration
Name | Type |
---|---|
ciphertext | string |
iv | string |
secret | string |
tag | string |
Defined in
infisical-secret-store/src/InfisicalClient/types/DecryptInput.ts:1
EncryptInput
Ƭ EncryptInput: Object
Type declaration
Name | Type |
---|---|
secret | string |
text | string |
Defined in
infisical-secret-store/src/InfisicalClient/types/EncryptInput.ts:1
HttpClientConfigCustom
Ƭ HttpClientConfigCustom: Object
Defined in
infisical-secret-store/src/InfisicalClient/types/ClientConfig.ts:3
InfisicalSecretConfig
Ƭ InfisicalSecretConfig: ClientConfig
Defined in
infisical-secret-store/src/types.ts:3
Scope
Ƭ Scope: Object
Type declaration
Name | Type |
---|---|
_id | string |
environment | string |
secretPath | string |
Defined in
infisical-secret-store/src/InfisicalClient/types/Scope.ts:1
Secret
Ƭ Secret: Object
Type declaration
Name | Type |
---|---|
_id | string |
createdAt | string |
environment | string |
secretCommentCiphertext? | string |
secretCommentIV? | string |
secretCommentTag? | string |
secretKeyCiphertext | string |
secretKeyIV | string |
secretKeyTag | string |
secretValueCiphertext | string |
secretValueIV | string |
secretValueTag | string |
type | "shared" | "personal" |
updatedAt | string |
user? | string |
version | number |
workspace | string |
Defined in
infisical-secret-store/src/InfisicalClient/types/Secret.ts:1
TokenData
Ƭ TokenData: Object
Type declaration
Name | Type |
---|---|
_id | string |
createdAt | string |
encryptedKey | string |
expiresAt | Date |
iv | string |
lastUsed | Date |
name | string |
permissions | string [] |
scopes | Scope [] |
serviceAccount | string |
tag | string |
updatedAt | string |
user | { _id : string ; authMethods : string [] ; email : string ; firstName : string ; lastName : string } |
user._id | string |
user.authMethods | string [] |
user.email | string |
user.firstName | string |
user.lastName | string |
workspace | string |
Defined in
infisical-secret-store/src/InfisicalClient/types/TokenData.ts:3
Variables
puristaVersion
• Const
puristaVersion: "1.11.0"