Frodo Library - v5.0.0-36
    Preparing search index...

    Type Alias Secret

    type Secret = {
        createSecret(
            secretId: string,
            value: string,
            description: string,
            encoding?: string,
            useInPlaceholders?: boolean,
        ): Promise<SecretSkeleton>;
        createVersionOfSecret(
            secretId: string,
            value: string,
        ): Promise<VersionOfSecretSkeleton>;
        deleteSecret(secretId: string): Promise<SecretSkeleton>;
        deleteVersionOfSecret(
            secretId: string,
            version: string,
        ): Promise<VersionOfSecretSkeleton>;
        disableVersionOfSecret(
            secretId: string,
            version: string,
        ): Promise<VersionOfSecretSkeleton>;
        enableVersionOfSecret(
            secretId: string,
            version: string,
        ): Promise<VersionOfSecretSkeleton>;
        exportSecret(
            secretId: string,
            includeActiveValue?: boolean,
            target?: string,
        ): Promise<SecretsExportInterface>;
        exportSecrets(
            includeActiveValues?: boolean,
            target?: string,
        ): Promise<SecretsExportInterface>;
        findVersionsToPrune(
            secretId: string,
            keepLoaded?: boolean,
            keepDeactivated?: boolean,
        ): Promise<VersionOfSecretSkeleton[]>;
        importSecret(
            secretId: string,
            importData: SecretsExportInterface,
            includeActiveValue?: boolean,
            source?: string,
        ): Promise<SecretSkeleton>;
        importSecrets(
            importData: SecretsExportInterface,
            includeActiveValues?: boolean,
            source?: string,
            resultCallback?: ResultCallback<SecretSkeleton>,
        ): Promise<SecretSkeleton[]>;
        pruneVersionsOfSecret(
            secretId: string,
            keepLoaded?: boolean,
            keepDeactivated?: boolean,
            resultCallback?: ResultCallback<VersionOfSecretSkeleton>,
        ): Promise<VersionOfSecretSkeleton[]>;
        readSecret(secretId: string): Promise<SecretSkeleton>;
        readSecrets(): Promise<SecretSkeleton[]>;
        readSecretValue(
            secretId: string,
            target?: string,
            decrypt?: boolean,
        ): Promise<any>;
        readSecretValues(
            secretIds: string[],
            target?: string,
            decrypt?: boolean,
        ): Promise<{ [key: string]: string }>;
        readVersionOfSecret(
            secretId: string,
            version: string,
        ): Promise<VersionOfSecretSkeleton>;
        readVersionsOfSecret(secretId: string): Promise<VersionOfSecretSkeleton[]>;
        updateSecret(
            secretId: string,
            description?: string,
            value?: string,
        ): Promise<SecretSkeleton>;
        updateSecretDescription(
            secretId: string,
            description: string,
        ): Promise<SecretSkeleton>;
    }
    Index
    • Create secret

      Parameters

      • secretId: string

        secret id/name

      • value: string

        secret value

      • description: string

        secret description

      • Optionalencoding: string

        secret encoding (only generic is supported)

      • OptionaluseInPlaceholders: boolean

        flag indicating if the secret can be used in placeholders

      Returns Promise<SecretSkeleton>

      a promise that resolves to a secret

    • Export secret. The response can be saved to file as is.

      Parameters

      • secretId: string

        secret id/name

      • OptionalincludeActiveValue: boolean

        include active value of secret (default: false)

      • Optionaltarget: string

        Host URL of target environment to encrypt secret value for

      Returns Promise<SecretsExportInterface>

      Promise resolving to a SecretsExportInterface object.

    • Export all secrets

      Parameters

      • OptionalincludeActiveValues: boolean

        include active values of secrets (default: false)

      • Optionaltarget: string

        Host URL of target environment to encrypt secret values for

      Returns Promise<SecretsExportInterface>

      Promise resolving to an SecretsExportInterface object.

    • Find the versions of a secret that pruneVersionsOfSecret would delete, without deleting anything

      Parameters

      • secretId: string

        secret id/name

      • OptionalkeepLoaded: boolean

        true to keep the currently loaded secret versions regardless of if they are active or not. Default: false

      • OptionalkeepDeactivated: boolean

        true to keep the deactivated versions and only prune the active versions that aren't the latest version. Default: false

      Returns Promise<VersionOfSecretSkeleton[]>

      a promise that resolves to the version objects that would be pruned

    • Import secret by id

      Parameters

      • secretId: string

        secret id/name

      • importData: SecretsExportInterface

        import data

      • OptionalincludeActiveValue: boolean

        include active value of secret (default: false)

      • Optionalsource: string

        Host URL of source environment where the secret was exported from

      Returns Promise<SecretSkeleton>

      imported secret object, or null if no update was made

    • Import secrets

      Parameters

      • importData: SecretsExportInterface

        import data

      • OptionalincludeActiveValues: boolean

        include active values of secrets (default: false)

      • Optionalsource: string

        Host URL of source environment where the secrets were exported from

      • OptionalresultCallback: ResultCallback<SecretSkeleton>

        Optional callback to process individual results. When given, the outcome of every secret is passed to it once, as it happens: a secret that was imported as the secret (a secret that needed no update as it is in the import data, without its value), a secret that could not be imported as an error that names the secret and carries the cause. Such a secret is not part of the result and does not stop the others, and the function does not throw for it. Without it, the failures are collected and thrown as one error after every secret was tried. Failing to resolve the values of the secrets (for example a value that cannot be decrypted) always throws, before any secret is imported.

      Returns Promise<SecretSkeleton[]>

      array of imported secret objects

    • Prune versions of secret that are not the latest secret version

      Parameters

      • secretId: string

        secret id/name

      • OptionalkeepLoaded: boolean

        true to keep the currently loaded secret versions regardless of if they are active or not. Default: false

      • OptionalkeepDeactivated: boolean

        true to keep the deactivated versions and only prune the active versions that aren't the latest version. Default: false

      • OptionalresultCallback: ResultCallback<VersionOfSecretSkeleton>

        Optional callback to process individual results

      Returns Promise<VersionOfSecretSkeleton[]>

      a promise that reolves to the pruned version objects

    • Read the value of a secret

      Parameters

      • secretId: string

        secret id/name

      • Optionaltarget: string

        Host URL of target environment to encrypt secret value for

      • Optionaldecrypt: boolean

        retrieve secret value in the clear (default: false)

      Returns Promise<any>

      a promise that resolves to the value of the secret

    • Read the values of an array of secrets

      Parameters

      • secretIds: string[]

        secret id/name

      • Optionaltarget: string

        Host URL of target environment to encrypt secret values for

      • Optionaldecrypt: boolean

        retrieve secret values in the clear (default: false)

      Returns Promise<{ [key: string]: string }>

      a promise that resolves to a map of secret ids and values

    • Update secret

      Parameters

      • secretId: string

        secret id/name

      • Optionaldescription: string

        optional secret description; if provided, attempts to update the secret description

      • Optionalvalue: string

        optional secret value; if provided, attempts to create a new version of the secret

      Returns Promise<SecretSkeleton>

      imported secret object, or null if no update was made

    • Update secret description

      Parameters

      • secretId: string

        secret id/name

      • description: string

        secret description

      Returns Promise<SecretSkeleton>

      a promise that resolves to the updated secret object if a change was made, otherwise returns null