revoker

package
v0.0.0-...-204f3e7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifySHA256Hash

func VerifySHA256Hash(hash, secretKey string) error

VerifySHA256Hash takes a key and compares it with stored hash, including its salt Directly taken from https://github.com/rancher/rancher/blob/4254eda21f13b9c16ca75bbd8269578eb938d549/pkg/auth/tokens/sha256.go#L31

Types

type Mode

type Mode int
const (
	ModeWarn Mode = iota
	ModeDisable
	ModeDelete

	// IndexerKey is the key that our indexer will use to store the value of the token for easy lookup
	IndexerKey = ".key.value"
)

type TokenRevoker

type TokenRevoker struct {
	// Client is the client to be used to lookup/disable/delete tokens
	Client client.Client
	// Mode is the mode the Revoker operates in
	Mode Mode
}

TokenRevoker handles the actual revoking of exposed tokens

func (*TokenRevoker) RevokeTokenByValue

func (t *TokenRevoker) RevokeTokenByValue(tokenValue string, exceptedTokenNames map[string]struct{}) error

RevokeTokenByValue finds tokens which have the input value and revokes them (based on mode). Only works if token-hashing is disabled

Jump to

Keyboard shortcuts

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