jwtks

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKey

func AddKey(key jwk.Key) (err error)

*

  • AddKey adds a key to the key set. If a key with the same key ID already exists,
  • it will be overwritten.

func GetKeySet

func GetKeySet() jwk.Set

*

  • GetKeySet returns the key set.
  • If you want to modify the key set, use AddKey instead.

func ServeGRPC

func ServeGRPC(port *string) error

*

  • ServeGRPC starts a GRPC server on the given port. This server
  • implements the JWTKSServiceServer interface and is used to
  • generate and validate JWT tokens. JWTKS gRPC Server is secure
  • using SSL/TLS in all environments except `DEVENV`
  • @param port The port to listen on without `:` prefix.

func ServeHTTP

func ServeHTTP(port *string) error

*

  • ServeHTTP starts a HTTP server on the given port. This server
  • only handles the JWKS endpoint. *
  • NOTE: Actually this Service and this endpoint can hold only one
  • key set. But for the sake of simplicity, we are using a single key
  • called `global` and we are using the `kid` field to identify the
  • key.

func SetCertificates

func SetCertificates(privateKeyPath, publicKeyPath string) error

*

  • Loads the private and public key from the file at the given path.
  • The file must be in PEM format.
  • If no private key is given, no generation of tokens will be possible,
  • but the public key can be used to validate tokens ONLY.
  • If no public key is given, use the public key from the private key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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