auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeVapidKeys

func DecodeVapidKeys(privateKey string, publicKey string) (*ecdsa.PrivateKey, error)

func DecodeVapidPrivateKey

func DecodeVapidPrivateKey(privateKey string) (*ecdsa.PrivateKey, error)

func JwtToken

func JwtToken(signKey *ecdsa.PrivateKey, aud string, exp time.Time, subject string) (string, error)

Types

type CachedJwtSigner

type CachedJwtSigner struct {
	// contains filtered or unexported fields
}

func NewCachedJwtSigner

func NewCachedJwtSigner() *CachedJwtSigner

func (*CachedJwtSigner) VapidHeader

func (c *CachedJwtSigner) VapidHeader(endpoint *url.URL, vapidPrivate, vapidPublic, subject string) (string, error)

type SimpleJwtSigner

type SimpleJwtSigner struct{}

func (*SimpleJwtSigner) VapidHeader

func (*SimpleJwtSigner) VapidHeader(endpoint *url.URL, vapidPrivate, vapidPublic, subject string) (string, error)

type WebPushJwtSigner

type WebPushJwtSigner interface {
	VapidHeader(endpoint *url.URL, vapidPrivate, vapidPublic, subject string) (string, error)
}

Jump to

Keyboard shortcuts

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