auth

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenMaxDuration specifies the lifetime for each access token.
	TokenMaxDuration int64 = 86400 * 1e3 // Milliseconds

)

Variables

This section is empty.

Functions

func Authorize

func Authorize(r *http.Request) (string, error)

Authorize extracts the authorize token from the HTTP request and verify if the token is valid or not. It returns the clientID if the token is valid, otherwise, an empty string will be returned.

Types

type Token

type Token struct {
	TimestampHex       string
	SignedTimestampHex string
	PublicKeyHex       string
}

Token represents the values we have in access tokens.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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