Documentation ¶
Overview ¶
Package null implements a testing shim for testing the token system and some higher level components. It is a prime candidate to be replaced with a mocked version of the interface, since unlike some other shims it is used exclusively for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ValidToken is a valid token for entity1 which has // GLOBAL_ROOT capability. ValidToken = "{\"EntityID\":\"valid\",\"Capabilities\":[\"GLOBAL_ROOT\"]}" // ValidEmptyToken is a valid token, but contains no // capabilities. ValidEmptyToken = "{\"EntityID\":\"valid\",\"Capabilities\":[]}" // InvalidToken is a token which will always return a in // ErrTokenInvalid error. InvalidToken = "invalid" )
Functions ¶
func NewKeyProvider ¶ added in v0.6.1
func NewKeyProvider() keyprovider.KeyProvider
Types ¶
type NullKeyProvider ¶ added in v0.6.1
type NullKeyProvider struct{}
The KeyProvider provided here provides no keys, as they are not used in the null token service. This interface is provided exclusively to satisfy the initialization requirements.
type Service ¶
type Service struct{}
Service binds the methods of the null token implementation.
func New ¶
func New(_ hclog.Logger, _ keyprovider.KeyProvider) *Service
New returns a new token service
Click to show internal directories.
Click to hide internal directories.