server

package
v0.0.0-...-f1c2737 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenResponse

type AccessTokenResponse struct {
	AccessToken string                  `json:"access_token"`
	ExpiresIn   uint                    `json:"expires_in"`
	Permissions map[uint64][]users.Role `json:"permissions"`
}

type ListUsersResponse

type ListUsersResponse struct {
	Users []users.User `json:"users"`
}

type UserServer

type UserServer struct {
	ApiVersion string
	Config     *config.ServiceConfig
}

func New

func New(cfg *config.ServiceConfig) *UserServer

func (*UserServer) GetAuthAPI

func (server *UserServer) GetAuthAPI() *restful.WebService

func (*UserServer) GetUsersAPI

func (server *UserServer) GetUsersAPI() *restful.WebService

func (*UserServer) GrantTokenHandler

func (server *UserServer) GrantTokenHandler(request *restful.Request, response *restful.Response)

GrantTokenHandler allows users to log in with their email/password, and get back a signed JWT in response TODO: support client_credentials grant type if we split into microservices

func (*UserServer) ListUsersHandler

func (server *UserServer) ListUsersHandler(request *restful.Request, response *restful.Response)

Jump to

Keyboard shortcuts

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