jwt

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

NewFactory 创建jwt鉴权驱动工厂

func ParseECPublicKeyFromPEM

func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error)

ParseECPublicKeyFromPEM parse PEM encoded PKCS1 or PKCS8 public key

func ParseRSAPublicKeyFromPEM

func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)

ParseRSAPublicKeyFromPEM parse PEM encoded PKCS1 or PKCS8 public key

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册jwt鉴权驱动工厂

Types

type Config

type Config struct {
	Name              string          `json:"name"`
	Driver            string          `json:"driver"`
	Credentials       []JwtCredential `json:"credentials"`
	SignatureIsBase64 bool            `json:"signature_is_base64"`
	ClaimsToVerify    []string        `json:"claims_to_verify"`
	RunOnPreflight    bool            `json:"run_on_preflight"`
	HideCredentials   bool            `json:"hide_credentials"`
}

Config JWT实例配置

type JwtCredential

type JwtCredential struct {
	Iss          string            `json:"iss"`
	Secret       string            `json:"secret"`
	RSAPublicKey string            `json:"rsa_public_key"`
	Algorithm    string            `json:"algorithm"`
	Labels       map[string]string `json:"labels"`
}

JwtCredential JWT验证信息

Jump to

Keyboard shortcuts

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