Documentation ¶
Index ¶
- Variables
- func AuthMiddleware() gin.HandlerFunc
- func ExtractBearerToken(r *gin.Context) (string, error)
- func ExtractToken(c *gin.Context, header string, prefix string) (string, error)
- func HasValidFirebaseBearerToken(c *gin.Context) (bool, map[string]string, string)
- type PresentationHandlers
- type PresentationHandlersImpl
Constants ¶
This section is empty.
Variables ¶
var AcceptedContentTypes = []string{"application/json", "application/x-www-form-urlencoded"}
AcceptedContentTypes is a list of all the accepted content types
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware() gin.HandlerFunc
AuthMiddleware is a gin middleware that checks if the request is authorized and authenticated
func ExtractBearerToken ¶
ExtractBearerToken gets a bearer token from an Authorization header.
This is expected to contain a Firebase idToken prefixed with "Bearer "
func ExtractToken ¶
ExtractToken extracts a token with the specified prefix from the specified header
func HasValidFirebaseBearerToken ¶
HasValidFirebaseBearerToken returns true with no errors if the request has a valid bearer token in the authorization header. Otherwise, it returns false and the error in a map with the key "error"
Types ¶
type PresentationHandlers ¶
type PresentationHandlers interface { HandleLoginByPhone() gin.HandlerFunc HandleRegistration() gin.HandlerFunc SetUserPIN() gin.HandlerFunc GetUserProfileByPhoneNumber() gin.HandlerFunc }
PresentationHandlers represents all the REST API logic
func NewPresentationHandlers ¶
func NewPresentationHandlers(usecases usecases.Makao) PresentationHandlers
NewPresentationHandlers initializes a new rest handlers usecase
type PresentationHandlersImpl ¶
type PresentationHandlersImpl struct {
// contains filtered or unexported fields
}
PresentationHandlersImpl represents the usecase implementation object
func (PresentationHandlersImpl) GetUserProfileByPhoneNumber ¶
func (p PresentationHandlersImpl) GetUserProfileByPhoneNumber() gin.HandlerFunc
GetUserProfileByPhoneNumberuser search
func (PresentationHandlersImpl) HandleLoginByPhone ¶
func (p PresentationHandlersImpl) HandleLoginByPhone() gin.HandlerFunc
HandleRegistration handles the user registration
func (PresentationHandlersImpl) HandleRegistration ¶
func (p PresentationHandlersImpl) HandleRegistration() gin.HandlerFunc
HandleIncomingMessages handles and processes data posted by AIT to its callback URL
func (PresentationHandlersImpl) SetUserPIN ¶
func (p PresentationHandlersImpl) SetUserPIN() gin.HandlerFunc
SetUserPIN handles the setting of the user PIN