auth

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	NodeID string `json:"node_id"`
	Issued int64  `json:"iat"`
	Expiry int64  `json:"exp"`
}

type Clock

type Clock interface {
	Now() time.Time
}

type RealClock

type RealClock struct{}

func (RealClock) Now

func (RealClock) Now() time.Time

type TokenSigner

type TokenSigner struct {
	Secret []byte
	Now    func() time.Time
	TTL    time.Duration
}

func (TokenSigner) Issue

func (s TokenSigner) Issue(nodeID string) (string, time.Time, error)

func (TokenSigner) Verify

func (s TokenSigner) Verify(token string) (Claims, error)

Jump to

Keyboard shortcuts

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