nosql

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct{}

Clock that returns time in UTC rounded to seconds.

func (*Clock) Now

func (c *Clock) Now() time.Time

Now returns the UTC time rounded to seconds.

type DB

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

DB is a struct that implements the AcmeDB interface.

func New

func New(db nosqlDB.DB) (*DB, error)

New configures and returns a new ACME DB backend implemented using a nosql DB.

func (*DB) CreateAccount

func (db *DB) CreateAccount(ctx context.Context, acc *acme.Account) error

CreateAccount imlements the AcmeDB.CreateAccount interface.

func (*DB) CreateAuthorization

func (db *DB) CreateAuthorization(ctx context.Context, az *acme.Authorization) error

CreateAuthorization creates an entry in the database for the Authorization. Implements the acme.DB.CreateAuthorization interface.

func (*DB) CreateCertificate

func (db *DB) CreateCertificate(ctx context.Context, cert *acme.Certificate) error

CreateCertificate creates and stores an ACME certificate type.

func (*DB) CreateChallenge

func (db *DB) CreateChallenge(ctx context.Context, ch *acme.Challenge) error

CreateChallenge creates a new ACME challenge data structure in the database. Implements acme.DB.CreateChallenge interface.

func (*DB) CreateExternalAccountKey added in v0.18.1

func (db *DB) CreateExternalAccountKey(ctx context.Context, provisionerID, reference string) (*acme.ExternalAccountKey, error)

CreateExternalAccountKey creates a new External Account Binding key with a name

func (*DB) CreateNonce

func (db *DB) CreateNonce(ctx context.Context) (acme.Nonce, error)

CreateNonce creates, stores, and returns an ACME replay-nonce. Implements the acme.DB interface.

func (*DB) CreateOrder

func (db *DB) CreateOrder(ctx context.Context, o *acme.Order) error

CreateOrder creates ACME Order resources and saves them to the DB.

func (*DB) DeleteExternalAccountKey added in v0.18.1

func (db *DB) DeleteExternalAccountKey(ctx context.Context, provisionerID, keyID string) error

func (*DB) DeleteNonce

func (db *DB) DeleteNonce(_ context.Context, nonce acme.Nonce) error

DeleteNonce verifies that the nonce is valid (by checking if it exists), and if so, consumes the nonce resource by deleting it from the database.

func (*DB) GetAccount

func (db *DB) GetAccount(ctx context.Context, id string) (*acme.Account, error)

GetAccount retrieves an ACME account by ID.

func (*DB) GetAccountByKeyID

func (db *DB) GetAccountByKeyID(ctx context.Context, kid string) (*acme.Account, error)

GetAccountByKeyID retrieves an ACME account by KeyID (thumbprint of the Account Key -- JWK).

func (*DB) GetAuthorization

func (db *DB) GetAuthorization(ctx context.Context, id string) (*acme.Authorization, error)

GetAuthorization retrieves and unmarshals an ACME authz type from the database. Implements acme.DB GetAuthorization interface.

func (*DB) GetAuthorizationsByAccountID added in v0.18.1

func (db *DB) GetAuthorizationsByAccountID(_ context.Context, accountID string) ([]*acme.Authorization, error)

GetAuthorizationsByAccountID retrieves and unmarshals ACME authz types from the database.

func (*DB) GetCertificate

func (db *DB) GetCertificate(_ context.Context, id string) (*acme.Certificate, error)

GetCertificate retrieves and unmarshals an ACME certificate type from the datastore.

func (*DB) GetCertificateBySerial added in v0.18.1

func (db *DB) GetCertificateBySerial(ctx context.Context, serial string) (*acme.Certificate, error)

GetCertificateBySerial retrieves and unmarshals an ACME certificate type from the datastore based on a certificate serial number.

func (*DB) GetChallenge

func (db *DB) GetChallenge(ctx context.Context, id, authzID string) (*acme.Challenge, error)

GetChallenge retrieves and unmarshals an ACME challenge type from the database. Implements the acme.DB GetChallenge interface.

func (*DB) GetExternalAccountKey added in v0.18.1

func (db *DB) GetExternalAccountKey(ctx context.Context, provisionerID, keyID string) (*acme.ExternalAccountKey, error)

GetExternalAccountKey retrieves an External Account Binding key by KeyID

func (*DB) GetExternalAccountKeyByAccountID added in v0.20.0

func (db *DB) GetExternalAccountKeyByAccountID(context.Context, string, string) (*acme.ExternalAccountKey, error)

func (*DB) GetExternalAccountKeyByReference added in v0.18.1

func (db *DB) GetExternalAccountKeyByReference(ctx context.Context, provisionerID, reference string) (*acme.ExternalAccountKey, error)

GetExternalAccountKeyByReference retrieves an External Account Binding key with unique reference

func (*DB) GetExternalAccountKeys added in v0.18.1

func (db *DB) GetExternalAccountKeys(ctx context.Context, provisionerID, cursor string, limit int) ([]*acme.ExternalAccountKey, string, error)

GetExternalAccountKeys retrieves all External Account Binding keys for a provisioner

func (*DB) GetOrder

func (db *DB) GetOrder(ctx context.Context, id string) (*acme.Order, error)

GetOrder retrieves an ACME Order from the database.

func (*DB) GetOrdersByAccountID

func (db *DB) GetOrdersByAccountID(ctx context.Context, accID string) ([]string, error)

GetOrdersByAccountID returns a list of order IDs owned by the account.

func (*DB) UpdateAccount

func (db *DB) UpdateAccount(ctx context.Context, acc *acme.Account) error

UpdateAccount imlements the AcmeDB.UpdateAccount interface.

func (*DB) UpdateAuthorization

func (db *DB) UpdateAuthorization(ctx context.Context, az *acme.Authorization) error

UpdateAuthorization saves an updated ACME Authorization to the database.

func (*DB) UpdateChallenge

func (db *DB) UpdateChallenge(ctx context.Context, ch *acme.Challenge) error

UpdateChallenge updates an ACME challenge type in the database.

func (*DB) UpdateExternalAccountKey added in v0.18.1

func (db *DB) UpdateExternalAccountKey(ctx context.Context, provisionerID string, eak *acme.ExternalAccountKey) error

func (*DB) UpdateOrder

func (db *DB) UpdateOrder(ctx context.Context, o *acme.Order) error

UpdateOrder saves an updated ACME Order to the database.

Jump to

Keyboard shortcuts

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