models

package
v0.0.0-...-716047f Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthKey

type AuthKey struct {
	ID        int    `json:"id"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	UserUUID  string `json:"user_uuid"`
}

AuthKey contains API Key base user auth info

type PathPermission

type PathPermission struct {
	ID          int    `json:"id"`
	PathPattern string `json:"path_pattern"`
}

type Payload

type Payload struct {
	AccessKey string `json:"access_key"`
	Nonce     string `json:"nonce"`
	QueryHash string `json:"query_hash"`
}

Payload is information part of JWT(JWS) token

func NewPayload

func NewPayload(accessKey, nonce, queryString string) (Payload, error)

NewPayload creates a new payload with given arguments

func (*Payload) Encrypt

func (p *Payload) Encrypt(key string) (string, error)

Encrypt payload with given key

func (*Payload) Validate

func (p *Payload) Validate(queryString string) error

Validate payload

Jump to

Keyboard shortcuts

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