token

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTTLInSeconds = 21600

MaxTTLInSeconds defines the maximum duration of a session token

Variables

This section is empty.

Functions

This section is empty.

Types

type V2

type V2 struct {
	// Expire contains a time and date of when this token will expire,
	// resulting in all IMDSv2 bases requests to be rejected
	Expire time.Time `json:"expire"`
}

V2 defines a session orientated token that embeds a TTL for expiration checks

func NewV2

func NewV2(seconds int) V2

NewV2 generates a new V2 session token from the provided TTL in seconds

func (V2) Expired

func (t V2) Expired() bool

Expired returns true of the current ttl has elapsed and the token is therefore deemed as expired

Jump to

Keyboard shortcuts

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