token

package
v0.0.0-...-88cf978 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateIDToken

func GenerateIDToken(length int) string

GenerateIDToken generated ID token for application

func GenerateSecretToken

func GenerateSecretToken(str string) (string, string)

GenerateSecretToken generates secret token for application

func Router

func Router() chi.Router

Router organisation

func Validate

func Validate(w http.ResponseWriter, r *http.Request)

Validate - validate application token @Summary Show a application token @Description validate application token @Tags OrganisationApplicationsTokens @ID validate-organisation-application-token @Produce json @Param X-Organisation header string true "Organisation ID" @Param application_slug path string true "Application Slug" @Param ValidationBody body ValidationBody true "Validation Body" @Success 200 {object} model.Application @Router /applications/{application_slug}/validateToken [post]

func ValidateSecretToken

func ValidateSecretToken(secretToken, storedToken string) bool

ValidateSecretToken validates the given secretToken with storedToken

Types

type ValidationBody

type ValidationBody struct {
	SecretToken string `json:"secret_token" validate:"required"`
	AccessToken string `json:"access_token" validate:"required"`
}

ValidationBody request body

Jump to

Keyboard shortcuts

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