Vault

Provices a encrypted store of variables to prevent accidential leakage Please read the documentation

Nested types and modules

TypeDescription
KeyInfo

The key used to decrypt/encrypt variables

Variable
Variables
OBSOLETE

Need to be public because of Newtonsoft.Json, don't use

Vault

The vault which stores the encryptes values

Functions and values

Function or valueDescription
Vault.createKey(file)
Signature: file:string option -> KeyInfo

Create a new key with the given path to the secret file (or Path.GetTempFileName() otherwise)

Vault.decryptVariable key base64Val
Signature: key:KeyInfo -> base64Val:string -> string

decrypt a given base64 encoded string and return the utf-8 string of the result

Vault.empty
Signature: Vault

An empty vault without any variables

Vault.encryptVariable key value
Signature: key:KeyInfo -> value:string -> string

encrypt the given utf-8 string and return the base64 encoded result

Vault.fromEncryptedVariables key vars
Signature: key:KeyInfo -> vars:seq<Variable> -> Vault

Read a vault from the given encrypted variables

Vault.fromEnvironmentVariable(envVar)
Signature: envVar:string -> Vault

Read a vault from an environment variable.

Vault.fromEnvironmentVariableOrNone(...)
Signature: envVar:string -> Vault option

Read a vault from an environment variable or return None

Vault.fromFakeEnvironmentOrNone()
Signature: unit -> Vault option

Read a vault from FAKE_VAULT_VARIABLES

Vault.fromFakeEnvironmentVariable()
Signature: unit -> Vault

Read a vault from FAKE_VAULT_VARIABLES

Vault.fromJson(s)
Signature: s:string -> Vault

Read in a vault from a given json string, make sure to delete the source of the json after using this API

Vault.get name v
Signature: name:string -> v:Vault -> string

similar to tryGet but throws an exception if the variable with the given name is not available in the vault

Vault.tryGet name v
Signature: name:string -> v:Vault -> string option

try to retrieve the variable with the given name from the vault (decrypts the variable if needed)