Hierarchy

Constructors

Properties

apiUrl: string = 'https://api.github.com'
clientId: string
delToken: DelToken
getToken: GetToken
getTokens: GetTokens
gistDescription: string = 'Cryptolink between Polykey Keynode and Github Identity'
gistFilename: string = 'cryptolink.txt'
id: ProviderId = ...

Set to the unique hostname of the provider

logger: Logger
pageSize: number = 10
preferGetClaimsPage: boolean = true

Set to true if getClaimsPage method should be preferred instead claim iteration operations. This could be useful if the Provider subclass has a getClaimsPage implentation that is able to obtain both Claims and ClaimsIds with a single HTTP request. For example, if the Provider were to supply a GraphQL API, or if the webscraped page were to contain the contents of both.

putToken: PutToken
scope: string = 'gist user:email read:user'

Methods

  • Checks that the token is still valid If the access token has expired, and there is no refresh token then this will throw the ErrorProviderUnauthenticated exception If the refresh token exists but has expired then this will throw the ErrorProviderUnauthenticated exception If the refresh token exists, and is still valid, then it will attempt to refresh the token. If you pass in identityId, expect that the new token will be persisted. If either providerToken.accessTokenExpiresIn or providerToken.refreshTokenExpiresIn is set to 0, their related tokens will be treated as never-expiring.

    Parameters

    Returns Promise<ProviderToken>

  • Setting up token database functions This must be called before the provider starts to be used

    Parameters

    • getTokens: GetTokens
    • getToken: GetToken
    • putToken: PutToken
    • delToken: DelToken

    Returns void

Generated using TypeDoc