middleware

package
v0.0.0-...-e5acbb5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInterceptors

func AddInterceptors(logger *zap.Logger, tracer opentracing.Tracer, opts []grpc.ServerOption) []grpc.ServerOption

AddInterceptors AddInterceptors: Add interceptors to the grpc server

func AuthMiddleware

func AuthMiddleware(ctx context.Context) (context.Context, error)

func NewJWTUnaryInterceptor

func NewJWTUnaryInterceptor(ctx context.Context, ks *jose.JSONWebKeySet, token string) (context.Context, error)

NewJWTUnaryInterceptor add users claims to outgoing context

func NewJWtMiddleware

func NewJWtMiddleware(ks *jose.JSONWebKeySet, token string) (alice.Constructor, error)

NewJWtMiddleware verify the user's token

func VerifyToken

func VerifyToken(t, iss string, aud []string, ks *jose.JSONWebKeySet) (map[string]interface{}, error)

Types

type Config

type Config struct {
	Issuer   string
	Secret   string
	Domain   string
	Audience []string
}

func NewConfig

func NewConfig() (Config, error)

NewConfig todo : keep this config into config-local todo: Move these base AUth0 URLs to config

type DiscoveryResponse

type DiscoveryResponse struct {
	fx.Out
	RevocationEndpoint string `name:"revocation_endpoint"`
	JSONWebKeySet      *jose.JSONWebKeySet
}

func NewJwk

func NewJwk() (DiscoveryResponse, error)

NewJwk NewJwk() get certificate from openIdConnect

Jump to

Keyboard shortcuts

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