auth

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

support HTTP/2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminOnly

func AdminOnly(next http.Handler) http.Handler

func Certificate added in v0.0.3

func Certificate(dataDir, ip string) (tls.Certificate, error)

Certificate returns a self-signed x509 certificate and private key.

func GenerateAccessToken

func GenerateAccessToken(hmacSecret []byte, username string, expiration time.Time) (string, error)

func GetRequestUsername

func GetRequestUsername(r *http.Request) string

func Middleware

func Middleware(hmacSecret []byte, next http.Handler) http.Handler

func SelfSignedListenAndServeTLS added in v0.0.3

func SelfSignedListenAndServeTLS(dataDir, publicIP, addr string, handler http.Handler) error

SelfSignedListenAndServeTLS listens on the TCP network address addr and then calls Serve with handler and a self-signed certificate to handle requests on incoming TLS connections.

Types

This section is empty.

Jump to

Keyboard shortcuts

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