auth

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

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceNameFromContext

func GetServiceNameFromContext(rCtx *app.RequestContext) (uint64, error)

GetServiceNameFromContext should be called only after the request has passed through the AuthenticateService middleware. If called before, it will always return an error.

func GetUserIdFromContext

func GetUserIdFromContext(rCtx *app.RequestContext) (uint64, error)

GetUserIdFromContext should be called only after the request has passed through the AuthenticateUser middleware. If called before, it will always return an error.

Types

type MiddlewareAuth

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

func NewAuthMiddleware

func NewAuthMiddleware(rUser user.UserResource, authUserSecretKey string, authAllowedServices map[string]string) *MiddlewareAuth

func (*MiddlewareAuth) AuthenticateService

func (mw *MiddlewareAuth) AuthenticateService() app.HandlerFunc

func (*MiddlewareAuth) AuthenticateUser

func (mw *MiddlewareAuth) AuthenticateUser() app.HandlerFunc

func (*MiddlewareAuth) AuthorizeBuyer

func (mw *MiddlewareAuth) AuthorizeBuyer() app.HandlerFunc

func (*MiddlewareAuth) AuthorizeSeller

func (mw *MiddlewareAuth) AuthorizeSeller() app.HandlerFunc

Jump to

Keyboard shortcuts

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