apikeys

package
Version: v0.0.0-...-c88c75b Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeOnMux

func ServeOnMux(mux *http.ServeMux, opts Options) error

Types

type Decoder

type Decoder struct {
	SecureCookie *securecookie.SecureCookie
}

func (*Decoder) Decode

func (d *Decoder) Decode(apikey string) (*Key, error)

type Key

type Key struct {
	// Subject is opaque (could be anything)
	// Usually salsa.debian.org!<nickname> for a user-registered one
	// Could also be github!<slug> for a tool
	Subject string `json:"s"`

	CreatedUnixTimestamp int64 `json:"c"`
}

type Options

type Options struct {
	HashKey      []byte
	BlockKey     []byte
	ClientID     string
	ClientSecret string
	RedirectURL  string
	Prefix       string
}

func (*Options) SecureCookie

func (o *Options) SecureCookie() *securecookie.SecureCookie

Source Files

Jump to

Keyboard shortcuts

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