handlers

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeAccessToResource

func AuthorizeAccessToResource(resource api.ResourceType) gin.HandlerFunc

AuthorizeAccessToResource is in charge of checking if the requested resource can be accesed by the sent token

For example: Let's say you want to get the lists for a Venue ID 12345 and you have a valid token generated for your (user ID 9988); so you send a request to something like GET->/venue/12345/lists.

If you are not the owner of the venue, system should return a

func ExtractAppVersion

func ExtractAppVersion() gin.HandlerFunc

ExtractAppVersion is the handler used to retrieve the application version from HTTP header

func ExtractAuthorizationToken

func ExtractAuthorizationToken(req *http.Request, method string) (token string, err error)

ExtractAuthorizationToken parses the token from the 'Authorization' header

func ExtractDeviceID

func ExtractDeviceID() gin.HandlerFunc

ExtractDeviceID is the handler used to retrieve the device id

func ExtractDeviceInfo

func ExtractDeviceInfo() gin.HandlerFunc

ExtractDeviceInfo is the handler used to retrieve the device info

func ExtractLanguage

func ExtractLanguage() gin.HandlerFunc

ExtractLanguage is the handler used to retrieve language header

func ExtractPlatform

func ExtractPlatform() gin.HandlerFunc

ExtractPlatform is the handler used to retrieve the device platoform from HTTP header

func RequireAccessToken

func RequireAccessToken(realm string, authServiceURL string, authClient string) gin.HandlerFunc

RequireAccessToken is the function used to handle all the request that requires a token as part of the request.

func RequireBasicAuthorization

func RequireBasicAuthorization(realm string, mandatory bool) gin.HandlerFunc

RequireBasicAuthorization is the funcion used to require Basic authentication header in a request

Types

This section is empty.

Jump to

Keyboard shortcuts

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