credentials

package
v0.0.0-...-418c65a Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Collection = "credentials"
	CAName     = "evergreen"
)

Variables

View Source
var (
	IDKey            = bsonutil.MustHaveTag(certdepot.User{}, "ID")
	CertKey          = bsonutil.MustHaveTag(certdepot.User{}, "Cert")
	PrivateKeyKey    = bsonutil.MustHaveTag(certdepot.User{}, "PrivateKey")
	CertReqKey       = bsonutil.MustHaveTag(certdepot.User{}, "CertReq")
	CertRevocListKey = bsonutil.MustHaveTag(certdepot.User{}, "CertRevocList")
	TTLKey           = bsonutil.MustHaveTag(certdepot.User{}, "TTL")
)

Constants for bson struct tags.

Functions

func Bootstrap

func Bootstrap(env evergreen.Environment) error

Bootstrap performs one-time initialization of the credentials collection with the certificate authority and service certificate. In order to perform operations on this collection, collection, this must succeed.

func DeleteByID

func DeleteByID(ctx context.Context, name string) error

DeleteByID removes the credentials from the database if they exist.

func FindByID

func FindByID(ctx context.Context, name string) (*rpc.Credentials, error)

FindByID gets the credentials for the given name.

func FindExpirationByID

func FindExpirationByID(ctx context.Context, name string) (time.Time, error)

FindExpirationByID returns the time at which the credentials for the given name will expire.

func ForJasperClient

func ForJasperClient(ctx context.Context) (*rpc.Credentials, error)

ForJasperClient returns the app server's credentials to authenticate with hosts running Jasper.

func GenerateInMemory

func GenerateInMemory(ctx context.Context, name string) (*rpc.Credentials, error)

GenerateInMemory generates the credentials without storing them in the database. This is not idempotent, so separate calls with the same inputs will return different credentials. This will fail if credentials for the given name already exist in the database.

func SaveByID

func SaveByID(ctx context.Context, name string, creds *rpc.Credentials) error

SaveByID saves the credentials from the options for the given user name. If the credentials already exist, this will overwrite the existing credentials.

Types

This section is empty.

Jump to

Keyboard shortcuts

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