manager

package
v0.0.0-...-7974e50 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Opaque Tokens are generated from a random string with appended 8 digit crc32 hex checksum and encoded in base64 with a prefix depending on their type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Issuer string
}

type StdTokenManager

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

func MakeManager

func MakeManager(config Config) StdTokenManager

func (StdTokenManager) DecodeOpaque

func (StdTokenManager) DecodeOpaque(typ tokens.OpaqueTokenPrefix, encodedOpaqueToken string) (string, error)

DecodeOpaque decodes a opaque AccessToken and returns a non-nil error if it's invalid.

func (StdTokenManager) Encode

func (m StdTokenManager) Encode(privateKey entity.Key, token entity.Token) ([]byte, error)

GenerateAccessToken returns an access token following this package's specification or a non-nil error on validation failure.

func (StdTokenManager) GenerateOpaque

func (StdTokenManager) GenerateOpaque(typ tokens.OpaqueTokenPrefix) (string, string, error)

GenerateOpaque generates an opaque token. It returns an encoded token, a random string used as a token's base and an err.

Jump to

Keyboard shortcuts

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