middleware

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidToken is returned when the token is invalid
	ErrInvalidToken = fmt.Errorf("invalid token")
)

Functions

This section is empty.

Types

type User

type User struct {
	// DID of the user
	Did string `json:"_id"`

	// DID document of the primary identity
	Username string `json:"username"`
	// contains filtered or unexported fields
}

func FetchUser

func FetchUser(c *fiber.Ctx) (*User, error)

func NewUser

func NewUser(c controller.Controller, username string) *User

func (*User) JWT

func (u *User) JWT() (string, error)

func (*User) JWTClaims

func (u *User) JWTClaims() jwt.MapClaims

func (*User) ListAccounts

func (u *User) ListAccounts() ([]*v1.Account, error)

func (*User) PrimaryIdentity

func (u *User) PrimaryIdentity() (*types.DidDocument, error)

Jump to

Keyboard shortcuts

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