token

package
v0.0.0-...-0cfb223 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Subject   string   `json:"sub"`
	Scope     []string `json:"scope"`
	ExpiresIn string   `json:"expiresIn"`
}

Request represents the body of a token creation request

func (*Request) Duration

func (r *Request) Duration() (*time.Duration, error)

Duration parses ExpiresIn and returns it as time.Duration

func (*Request) ToClaims

func (r *Request) ToClaims() *jwt.Claims

ToClaims returns jwt.Claims based on the request data

type Response

type Response struct {
	Token   string `json:"token"`
	Expires int64  `json:"expires"`
}

Response represents the body of a token creation response

Jump to

Keyboard shortcuts

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