authHelper

package
v0.0.0-...-dffa276 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateClient

func AuthenticateClient(c *gin.Context) (string, map[string]string, int, error)

AuthenticateClient authenticate a token that generated from client that is valid.

func AuthenticateServer

func AuthenticateServer(c *gin.Context) (string, map[string]string, int, error)

AuthenticateServer authenticate a token that generated from API server that is valid.

func CreateAuthorizedAppAndUser

func CreateAuthorizedAppAndUser(appKey string, secretkey string, name string, username string) (model.App, int, error)

CreateAuthorizedApp creates an authorized app

func GetAuthorizedApp

func GetAuthorizedApp(appKey string, secretkey string) (model.App, int, error)

GetAuthorizedApp gets an authorized app from *gin.Context

func GetAuthorizedAppFromContext

func GetAuthorizedAppFromContext(c *gin.Context) (model.App, int, error)

GetAuthorizedAppFromContext gets an authorized app from *gin.Context

func GetAuthorizedUser

func GetAuthorizedUser(appKey string, secretkey string, userName string) (model.User, int, error)

GetAuthorizedUser gets an authorized user from *gin.Context

func GetAuthorizedUserFromContext

func GetAuthorizedUserFromContext(c *gin.Context) (model.User, int, error)

GetAuthorizedUserFromContext gets an authorized user from *gin.Context

func GetTokenString

func GetTokenString(c *gin.Context) (string, int, error)

GetTokenString extract a token from an authentication header.

func RemoveAuthorizedApp

func RemoveAuthorizedApp(appKey string, secretkey string) (int, error)

RemoveAuthorizedApp removes an authorized app

Types

This section is empty.

Jump to

Keyboard shortcuts

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