people

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTClaims

type JWTClaims struct {
	UserID      int          `json:"id"`
	Permissions []Permission `json:"perms"`
	jwt.StandardClaims
}

JWTClaims represents an identifiable JWT

func GetToken

func GetToken(c echo.Context) (*JWTClaims, error)

GetToken will return the JWT claims from a valid JWT token

type Permission

type Permission struct {
	PermissionID int    `json:"id"`
	Name         string `json:"name"`
}

Permission represents the permissions that a user has

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo stores our dependencies

func NewRepo

func NewRepo(db *sqlx.DB) *Repo

NewRepo creates our data store

func (*Repo) UserByID

func (r *Repo) UserByID(c echo.Context) error

UserByID finds a user by ID @Summary Get a user by ID @Description Get a basic user object by ID. @ID get-user-id @Tags users @Produce json @Param userid path int true "User ID" @Success 200 {object} people.User @Router /v1/internal/people/user/{userid} [get]

func (*Repo) UserByIDFull

func (r *Repo) UserByIDFull(c echo.Context) error

UserByIDFull finds a user by ID returing all info @Summary Get a full user by ID @Description Get a complete user object by ID. @ID get-user-id-full @Tags users @Produce json @Param userid path int true "User ID" @Success 200 {object} people.User @Router /v1/internal/people/user/{userid}/full [get]

func (*Repo) UserByToken

func (r *Repo) UserByToken(c echo.Context) error

UserByToken finds a user by their JWT token @Summary Get a user by token @Description Get a basic user object by JWT token generated by web-auth. @ID get-user-token @Tags users @Produce json @Success 200 {object} people.User @Router /v1/internal/people/user [get]

func (*Repo) UserByTokenFull

func (r *Repo) UserByTokenFull(c echo.Context) error

UserByTokenFull finds a user by their JWT token returning all info @Summary Get a full user by token @Description Get a complete user object by JWT token generated by web-auth. @ID get-user-token-full @Tags users @Produce json @Success 200 {object} people.UserFull @Router /v1/internal/people/user/full [get]

Jump to

Keyboard shortcuts

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