Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConvertV1Profiles

Hierarchy

  • ConvertV1Profiles

Index

Properties

Static Private Readonly builtInCredMgrNm

builtInCredMgrNm: string = "@zowe/cli"

Static Private convertOpts

convertOpts: IConvertV1ProfOpts = null

Static Private convertResult

convertResult: IConvertV1ProfResult = null

Static Private Readonly credMgrKey

credMgrKey: string = "CredentialManager"

Static Private Readonly noCfgFilePathNm

noCfgFilePathNm: string = "CouldNotGetPathToConfigFile"

Static Private oldProfilesDir

oldProfilesDir: string = "NotYetSet"

Static Private Readonly oldScsPluginNm

oldScsPluginNm: "@zowe/secure-credential-store-for-zowe-cli" = "@zowe/secure-credential-store-for-zowe-cli"

Static Private oldScsPluginWasConfigured

oldScsPluginWasConfigured: boolean = false

Static Private profileInfo

profileInfo: ProfileInfo = null

Static Private profilesRootDir

profilesRootDir: string = "NotYetSet"

Static Private zoweKeyRing

zoweKeyRing: typeof keyring = undefined

Methods

Static Private addExceptionToConvertMsgs

  • addExceptionToConvertMsgs(introMsg: string, error: Error): void
  • Add a new message to the V1 profile conversion messages that reports a caught exception.

    Parameters

    • introMsg: string

      An introductory message describing what action was being attempted when we failed.

    • error: Error

      The exception that we caught.

    Returns void

Static Private addToConvertMsgs

  • addToConvertMsgs(msgFormat: number, msgText: string): void

Static convert

  • Convert V1 profiles into a zowe.config.json file.

    It will also do the following: Create a zowe.schema.json file. Migrate V1 secure properties into the current consolidated Zowe client secure properties. Replace old SCS-plugin credential manager override with the Zowe embedded SCS. Delete old V1 profiles (and old V1 secure properties) if requested.

    Calling this function after having already converted, will not attempt to convert again. However it will still delete the old profiles if requested.

    You should NOT initialize the secure credential manager before calling this function. The CredMgr can only be initialized once. If the old V1 SCS-plugin happens to be configured as the CredMgr when this function is called, the old V1 SCS-plugin CredMgr is unable to create the current consolidated Zowe client secure properties. Users will have to re-enter all of their credentials.

    Parameters

    Returns Promise<IConvertV1ProfResult>

    Result object into which messages and stats are stored.

Static Private convertPropNames

  • convertPropNames(convertedConfig: IConfig): void
  • Convert a set of known property names to their new names for V2 conformance (and later releases).

    Parameters

    • convertedConfig: IConfig

      The converted client configuration in which we shall rename obsolete property names to their conformant names.

    Returns void

Static Private createNewConfigFile

  • Create a new zowe client config file from an IConfig object. Store the name of the new config file in our convertResult object.

    Parameters

    • convertedConfig: IConfig

      IConfig object created as a result of V1 profile conversion.

    Returns Promise<void>

    string - Path name to the newly created config file.

Static Private deleteOldSecureProps

  • deleteOldSecureProps(acct: string, propName: string): Promise<boolean>
  • Delete the secure property specified from the operating system credential vault.

    Parameters

    • acct: string

      The account the property is stored under

    • propName: string

      The name of the property to delete

    Returns Promise<boolean>

    true if the property was deleted successfully

Static Private deleteV1Profiles

  • deleteV1Profiles(): Promise<void>

Static Private findOldSecureProps

  • findOldSecureProps(acct: string): Promise<string[]>
  • Locate the names of secured properties stored under an account in the operating system's credential vault.

    Parameters

    • acct: string

      The account to search for in the credential store

    Returns Promise<string[]>

    a list of secured properties stored under the specified account

Static Private getOldPluginInfo

  • getOldPluginInfo(): IOldPluginInfo

Static Private getOldProfileCount

  • getOldProfileCount(profilesRootDir: string): number

Static Private initCredMgr

  • Initialize credential manager so that we can migrate the secure properties that are stored for V1 profiles to new secure properties for the converted config that we will create.

    For all CLI commands other than convert-profiles, the credential manager is loaded in Imperative.init and frozen with Object.freeze so it cannot be modified later on. Because convert-profiles cannot create new secure properties for the converted config (if the old SCS plugin credMgr is already loaded), Imperative.init does not load the credential manager for the convert-profiles command.

    VSCode extensions must also avoid initializing the Credential Manager before calling ConvertV1Profiles.convert.

    If we encounter an error when trying to initialize the credential manager, we report (through ConvertV1Profiles.convertResult.credsWereMigrated) that creds were not migrated.

    Returns Promise<void>

Static Private isConversionNeeded

  • isConversionNeeded(): Promise<boolean>

Static Private isPluginInstalled

  • isPluginInstalled(pluginName: string): boolean

Static Private isZoweKeyRingAvailable

  • isZoweKeyRingAvailable(): Promise<boolean>

Static Private loadV1Schemas

  • loadV1Schemas(): void

Static Private moveV1ProfilesToConfigFile

  • moveV1ProfilesToConfigFile(): Promise<void>

Static Private putCfgFileNmInResult

  • putCfgFileNmInResult(configForPath: Config): void

Static Private replaceOldCredMgrOverride

  • replaceOldCredMgrOverride(): void
  • Replace any detected oldCredMgr override entry in settings.json with the Zowe embedded credMgr.

    After the replacement of the credential manager override, we can then initialize credential manager later in this class.

    Returns void

Generated using TypeDoc