noaabridge

package
v6.52.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package noaabridge wraps a UAA client and a tokenCache to support the TokenRefresher interface for noaa/consumer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenCache

type TokenCache interface {
	RefreshToken() string
	SetAccessToken(token string)
	SetRefreshToken(token string)
}

TokenCache is where the UAA token information is stored.

type TokenRefresher

type TokenRefresher struct {
	// contains filtered or unexported fields
}

TokenRefresher implements the TokenRefresher interface. It requires a UAA client and a token cache for storing the access and refresh tokens.

func NewTokenRefresher

func NewTokenRefresher(uaaClient UAAClient, cache TokenCache) *TokenRefresher

NewTokenRefresher returns back a pointer to a TokenRefresher.

func (*TokenRefresher) RefreshAuthToken

func (t *TokenRefresher) RefreshAuthToken() (string, error)

RefreshAuthToken refreshes the current Authorization Token and stores the Access and Refresh token in it's cache. The returned Authorization Token includes the type prefixed by a space.

type UAAClient

type UAAClient interface {
	RefreshAccessToken(refreshToken string) (uaa.RefreshedTokens, error)
}

UAAClient is the interface for getting a valid access token

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL