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:115

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:33

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:41

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:85

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:69

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:62

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:76

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:48

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:92

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:106

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:99

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:55

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:339

  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:175

  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:151

  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:137

  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:124

  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