Options
All
  • Public
  • Public/Protected
  • All
Menu

API Class for manipulating config layers.

Hierarchy

Index

Constructors

constructor

Properties

Protected mConfig

mConfig: Config

Private mLoadFailed

mLoadFailed: boolean

Accessors

loadFailed

  • get loadFailed(): boolean

Methods

cacheAndPrune

  • cacheAndPrune(opts?: { global: boolean; properties?: IConfig; user: boolean }): void
  • Copy secure config properties from the specified layer into cached secure properties. To save secure config properties directly to the vault, use the asynchronous method save instead.

    Warning: Do not pass an IConfigLayer object into this method unless you want its properties to be edited.

    internal

    Parameters

    • Optional opts: { global: boolean; properties?: IConfig; user: boolean }

      The user and global flags that specify one of the four config files (aka layers).

      • global: boolean
      • Optional properties?: IConfig

        IConfig object cloned from the specified layer. If specified, secure properties will be removed.

      • user: boolean

    Returns void

directSave

findSecure

  • findSecure(profiles: {}, path: string): string[]
  • Recursively find secure property paths inside a team config "profiles" object.

    internal

    Parameters

    • profiles: {}

      The "profiles" object that is present at the top level of team config files, and may also be present at lower levels.

    • path: string

      The JSON path to the "profiles" object

    Returns string[]

    Array of secure property paths

load

  • Load the secure application properties from secure storage using the specified vault interface. The vault interface is placed into our Config object. The secure values are placed into our Config layers.

    Parameters

    • Optional vault: IConfigVault

      Interface for loading and saving to secure storage.

    Returns Promise<void>

loadCached

  • loadCached(opts?: { global: boolean; user: boolean }): void
  • Copy secure config properties from cached secure properties into the specified layer. To load secure config properties directly from the vault, use the asynchronous method load instead.

    internal

    Parameters

    • Optional opts: { global: boolean; user: boolean }

      The user and global flags that specify one of the four config files (aka layers).

      • global: boolean
      • user: boolean

    Returns void

rmUnusedProps

  • rmUnusedProps(): string[]

save

  • save(allLayers?: boolean): Promise<void>

secureFields

  • secureFields(opts?: { global: boolean; user: boolean }): string[]
  • List full paths of all secure properties found in a team config file.

    Parameters

    • Optional opts: { global: boolean; user: boolean }

      The user and global flags that specify one of the four config files (aka layers).

      • global: boolean
      • user: boolean

    Returns string[]

    Array of secure property paths (e.g., "profiles.lpar1.properties.password")

secureInfoForProp

  • secureInfoForProp(propertyPath: string, findUp?: boolean): { path: string; prop: string }
  • Retrieve info that can be used to store a profile property securely.

    For example, to securely store "profiles.lpar1.properties.password", the name "password" would be stored in "profiles.lpar1.secure".

    internal

    Parameters

    • propertyPath: string

      The full path of the profile property

    • Optional findUp: boolean

      Specify true to search up in the config file for higher level secure arrays

    Returns { path: string; prop: string }

    Object with the following attributes:

    • path The JSON path of the secure array
    • prop The name of the property
    • path: string
    • prop: string

securePropsForProfile

  • securePropsForProfile(profileName: string): string[]
  • List names of secure properties for a profile. They may be defined at the profile's level, or at a higher level if the config is nested.

    Parameters

    • profileName: string

      Profile name to search for

    Returns string[]

    Array of secure property names

Generated using TypeDoc