authn

package
v0.0.0-...-2b12306 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJWT

func BuildJWT() jwt.Token

func LoadSSHPublicKey

func LoadSSHPublicKey(fpath string) (*rsa.PublicKey, error)

Types

type Authenticator

type Authenticator interface {
	Auth(req *http.Request) (*Result, error)
}

type JWTAuthenticator

type JWTAuthenticator struct {
	PublicKey rsa.PublicKey
}

func BuildJWTAuthenticator

func BuildJWTAuthenticator(publicKey rsa.PublicKey) (*JWTAuthenticator, error)

func (*JWTAuthenticator) Auth

func (a *JWTAuthenticator) Auth(req *http.Request) (*Result, error)

func (*JWTAuthenticator) Verify

func (a *JWTAuthenticator) Verify(token string) (jwt.Token, error)

type Result

type Result struct {
	Requester string `json:"requester"`
}

Jump to

Keyboard shortcuts

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