auth

package
v1.0.1-0...-497af47 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: CC-BY-SA-4.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB map[Oauth]*App = make(map[Oauth]*App)

DB

Functions

func ClientDecrypter

func ClientDecrypter(key, clientID, clientSecret string) (name, id string, err error)

ClientDecrypter decrypt client token

func ClientEncrypter

func ClientEncrypter(key, appName, appID string) (clientID, clientSecret string, err error)

ClientEncrypter encrypts new client

func CreateJWTCookie

func CreateJWTCookie(jwtID string, issuer string, ctx *contx.Context)

CreateJWTCookie create cookie with jwt token

func GenerateJWTToken

func GenerateJWTToken(app *App, ctx *contx.Context) string

GenerateJWTToken generate jwt token

func InvalidateJWTToken

func InvalidateJWTToken(ctx *contx.Context)

InvalidateJWTToken invalidate jwt token

func LoginRequired

func LoginRequired(ctx *contx.Context)

LoginRequired

func LoginRequiredApi

func LoginRequiredApi(ctx *contx.Context)

LoginRequiredApi

Types

type App

type App struct {
	Name string `json:"name"`
	Id   string `json:"id"`
}

App

type Claims

type Claims struct {
	Ip string `json:"ip"`
	jwt.StandardClaims
}

Claims

type Oauth

type Oauth struct {
	Id     string `json:"id"`
	Secret string `json:"secret"`
}

Oauth

Jump to

Keyboard shortcuts

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