Non-abstract session class

export

### Hierarchy

- AbstractSession
  - Session

## Index

### Constructors

- constructor

### Properties

- BASIC
- BASIC_PREFIX
- BEARER_PREFIX
- DEFAULT_BASE_PATH
- DEFAULT_HTTPS_PORT
- DEFAULT_HTTP_PORT
- DEFAULT_PORT
- DEFAULT_PROTOCOL
- DEFAULT_REJECT_UNAUTHORIZED_SETTING
- DEFAULT_SECURE_PROTOCOL
- DEFAULT_STRICT_SSL
- DEFAULT_TYPE

### Accessors

- ISession

### Methods

- storeCookie
- createFromUrl
- getBase64Auth
- getPasswordFromAuth
- getUsernameFromAuth

## Constructors

### constructor

- new Session(newSession: ISession): Session

- Overrides AbstractSession.constructor

  - Defined in @zowe/imperative/src/rest/src/session/Session.ts:23

  Creates an instance of Session.

  memberof

    Session

  #### Parameters

  - ##### newSession: ISession

    contains input for new session

  #### Returns Session

## Properties

### Static Readonly BASIC

BASIC: RegExp = /^Basic/ig

Inherited from AbstractSession.BASIC

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:116

Regex to extract basic from base64 encoded auth

static
memberof

  AbstractSession

### Static Readonly BASIC_PREFIX

BASIC_PREFIX: string = "Basic "

Inherited from AbstractSession.BASIC_PREFIX

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:34

Basic auth prefix

static
memberof

  AbstractSession

### Static Readonly BEARER_PREFIX

BEARER_PREFIX: string = "Bearer "

Inherited from AbstractSession.BEARER_PREFIX

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:42

Bearer auth prefix

static
memberof

  AbstractSession

### Static Readonly DEFAULT_BASE_PATH

DEFAULT_BASE_PATH: "" = ""

Inherited from AbstractSession.DEFAULT_BASE_PATH

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:86

Default base path. Our empty string means that we do not use an API mediation layer base path at the beginning of every resource URL.

static
memberof

  AbstractSession

### Static Readonly DEFAULT_HTTPS_PORT

DEFAULT_HTTPS_PORT: 443 = 443

Inherited from AbstractSession.DEFAULT_HTTPS_PORT

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:70

Default https port 443

static
memberof

  AbstractSession

### Static Readonly DEFAULT_HTTP_PORT

DEFAULT_HTTP_PORT: 80 = 80

Inherited from AbstractSession.DEFAULT_HTTP_PORT

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:63

Default http port 80

static
memberof

  AbstractSession

### Static Readonly DEFAULT_PORT

DEFAULT_PORT: 443 = AbstractSession.DEFAULT_HTTPS_PORT

Inherited from AbstractSession.DEFAULT_PORT

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:77

Default https port

static
memberof

  AbstractSession

### Static Readonly DEFAULT_PROTOCOL

DEFAULT_PROTOCOL: "https" = SessConstants.HTTPS_PROTOCOL

Inherited from AbstractSession.DEFAULT_PROTOCOL

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:49

Default protocol

static
memberof

  AbstractSession

### Static Readonly DEFAULT_REJECT_UNAUTHORIZED_SETTING

DEFAULT_REJECT_UNAUTHORIZED_SETTING: true = true

Inherited from AbstractSession.DEFAULT_REJECT_UNAUTHORIZED_SETTING

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:93

Default reject unauthorized

static
memberof

  AbstractSession

### Static Readonly DEFAULT_SECURE_PROTOCOL

DEFAULT_SECURE_PROTOCOL: "SSLv23_method" = "SSLv23_method"

Inherited from AbstractSession.DEFAULT_SECURE_PROTOCOL

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:107

Default SSL method

static
memberof

  AbstractSession

### Static Readonly DEFAULT_STRICT_SSL

DEFAULT_STRICT_SSL: true = true

Inherited from AbstractSession.DEFAULT_STRICT_SSL

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:100

Default strict ssl setting

static
memberof

  AbstractSession

### Static Readonly DEFAULT_TYPE

DEFAULT_TYPE: "none" = SessConstants.AUTH_TYPE_NONE

Inherited from AbstractSession.DEFAULT_TYPE

- Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:56

Default session type

static
memberof

  AbstractSession

## Accessors

### ISession

- get ISession(): ISession

- Inherited from AbstractSession.ISession

  - Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:348

  Obtain session info and defaults

  readonly
  memberof

    AbstractSession

  #### Returns ISession

## Methods

### storeCookie

- storeCookie(cookie: any): void

- Inherited from AbstractSession.storeCookie

  - Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:176

  Method to parse the requested token type

  memberof

    AbstractSession

  #### Parameters

  - ##### cookie: any

    cookie object from http(s) response

  #### Returns void

### Static createFromUrl

- createFromUrl(url: URL, includePath?: boolean): Session

- - Defined in @zowe/imperative/src/rest/src/session/Session.ts:40

  Creates an instance of Session from a URL object.

  memberof

    Session

  #### Parameters

  - ##### url: URL

    URL object from the Node.js `url` library

  - ##### Optional includePath: boolean

    Specifies whether session base path should be populated. Default value is true.

  #### Returns Session

### Static getBase64Auth

- getBase64Auth(user: string, password: string): string

- Inherited from AbstractSession.getBase64Auth

  - Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:152

  Create base 64 encoded representation of user and password

  static
  memberof

    AbstractSession

  #### Parameters

  - ##### user: string

    plain text user

  - ##### password: string

    plain text password

  #### Returns string

  - base 64 encoded auth

### Static getPasswordFromAuth

- getPasswordFromAuth(auth: string): string

- Inherited from AbstractSession.getPasswordFromAuth

  - Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:138

  Obtain password from a base 64 credential

  static
  memberof

    AbstractSession

  #### Parameters

  - ##### auth: string

    base 64 encoded credentials

  #### Returns string

  - password

### Static getUsernameFromAuth

- getUsernameFromAuth(auth: string): string

- Inherited from AbstractSession.getUsernameFromAuth

  - Defined in @zowe/imperative/src/rest/src/session/AbstractSession.ts:125

  Obtain user name from a base 64 credential

  static
  memberof

    AbstractSession

  #### Parameters

  - ##### auth: string

    base 64 encoded credentials

  #### Returns string

  - user name

Generated using TypeDoc