Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CredentialService

class

CredentialService

description

Stateless service to retrieve Dragonchain credentials for use in API requests

Hierarchy

  • CredentialService

Index

Constructors

constructor

  • Create an Instance of a CredentialService

    Parameters

    • dragonchainId: string

      dragonchainId associated with these credentials

    • Default value authKey: string = ""

      authKey to use with these credentials

    • Default value authKeyId: string = ""

      authKeyId to use with these credentials

    • Default value hmacAlgo: HmacAlgorithm = "SHA256"

      hmac algorithm to use

    Returns CredentialService

Methods

getAuthorizationHeader

  • getAuthorizationHeader(method: string, path: string, timestamp: string, contentType: string, body: string): string
  • Return the HMAC signature used as the Authorization Header on REST requests to your dragonchain.

    Parameters

    • method: string
    • path: string
    • timestamp: string
    • contentType: string
    • body: string

    Returns string

overrideCredentials

  • overrideCredentials(authKeyId: string, authKey: string): void