store

package
v0.0.0-...-13f99a9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RS256 = SigningAlgorithm{
		Name: "RS256",
		Generator: func() (crypto.PrivateKey, error) {
			return rsa.GenerateKey(rand.Reader, 2048)
		},
	}

	ES256 = SigningAlgorithm{
		Name: "ES256",
		Generator: func() (crypto.PrivateKey, error) {
			return ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
		},
	}
)
View Source
var (
	StaticRotation = RotationStrategy{
		// contains filtered or unexported fields
	}
)

Functions

This section is empty.

Types

type Keys

type Keys struct {
	// Key for creating and verifying signatures. These may be nil.
	SigningKey    *jose.JSONWebKey
	SigningKeyPub *jose.JSONWebKey

	// Old signing keys which have been rotated but can still be used to validate
	// existing signatures.
	VerificationKeys []VerificationKey

	// The next time the signing key will rotate.
	//
	// For caching purposes, implementations MUST NOT update keys before this time.
	NextRotation time.Time
}

Keys hold signing keys.

type RotationStrategy

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

type SigningAlgorithm

type SigningAlgorithm struct {
	Name string
	// TODO: use crypto.Signer instead.
	Generator func() (crypto.PrivateKey, error)
}

type Store

type Store interface {
	SignUp(auth.SignUpForm, []byte, []string) error
	GetHash(string) ([]byte, error)
	GetPassword(string) (*auth.Password, error)
	GetTeams(string, string) ([]Team, error)
	AddTeam(Team) error
	SetMailVerified(string) error
}

type Team

type Team struct {
	Name     string `json:"name"`
	Describe string `json:"describe"`
}

type VerificationKey

type VerificationKey struct {
	PublicKey *jose.JSONWebKey `json:"publicKey"`
	Expiry    time.Time        `json:"expiry"`
}

VerificationKey is a rotated signing key which can still be used to verify signatures.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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