jwt

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 20 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 {
	Credentials       []JwtCredential `json:"credentials" label:"证书列表"`
	SignatureIsBase64 bool            `json:"signature_is_base64" label:"base64加密"`
	ClaimsToVerify    []string        `json:"claims_to_verify" label:"校验字段"`
	HideCredentials   bool            `json:"hide_credentials" label:"是否隐藏证书"`
}

Config JWT实例配置

type JwtCredential

type JwtCredential struct {
	Iss          string            `json:"iss" label:"证书签发者" description:"playload计算内容之一"`
	Secret       string            `json:"secret" label:"密钥" description:"加密算法是HS时必填,用于校验token"`
	RSAPublicKey string            `json:"rsa_public_key" label:"RSA公钥" description:"加密算法是RS或ES时必填,用于校验token"`
	Algorithm    string            `json:"algorithm" enum:"HS256,HS384,HS512,RS256,RS384,RS512,ES256,ES384,ES512" label:"签名算法"`
	Labels       map[string]string `json:"labels" label:"用户标签"`
}

JwtCredential JWT验证信息

Jump to

Keyboard shortcuts

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