login

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: AGPL-3.0, BSD-2-Clause, ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasRequiredClaims

func HasRequiredClaims(token Token) bool

HasRequiredClaims returns true if there is at least one scope

func Sign

func Sign(token Token, secret string) (string, error)

Signed signs a token and returns the signed token as a string

Types

type Token

type Token struct {

	// Scopes controlling access booking system
	Scopes []string `json:"scopes"`

	jwt.RegisteredClaims
}

Token represents a token used for login or booking

func New

func New(audience, subject string, scopes []string, iat, nbf, exp int64) Token

New creates a new token (but does not sign it)

func (*Token) String

func (t *Token) String() string

String converts a token into a string, returning the string

type TokenInBody

type TokenInBody struct {
	Token string `json:"token"`
}

TokenInBody represents a token marshalled into a string

Jump to

Keyboard shortcuts

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