noaabridge

package
v7.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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