certificates/acme/db.go

32 lines
1.4 KiB
Go
Raw Normal View History

2021-02-25 18:24:24 +00:00
package acme
import "context"
// DB is the DB interface expected by the step-ca ACME API.
type DB interface {
CreateAccount(ctx context.Context, acc *types.Account) (*types.Account, error)
GetAccount(ctx context.Context, id string) (*types.Account, error)
GetAccountByKeyID(ctx context.Context, kid string) (*types.Account, error)
UpdateAccount(ctx context.Context, acc *types.Account) error
2021-02-25 18:24:24 +00:00
CreateNonce(ctx context.Context) (types.Nonce, error)
DeleteNonce(ctx context.Context, nonce types.Nonce) error
2021-02-25 18:24:24 +00:00
CreateAuthorization(ctx context.Context, authz *types.Authorization) error
GetAuthorization(ctx context.Context, id string) (*types.Authorization, error)
UpdateAuthorization(ctx context.Context, authz *types.Authorization) error
2021-02-25 18:24:24 +00:00
CreateCertificate(ctx context.Context, cert *types.Certificate) error
GetCertificate(ctx context.Context, id string) (*types.Certificate, error)
2021-02-25 18:24:24 +00:00
CreateChallenge(ctx context.Context, ch *types.Challenge) error
GetChallenge(ctx context.Context, id, authzID string) (*types.Challenge, error)
UpdateChallenge(ctx context.Context, ch *types.Challenge) error
2021-02-25 18:24:24 +00:00
CreateOrder(ctx context.Context, o *types.Order) error
2021-02-25 18:24:24 +00:00
DeleteOrder(ctx context.Context, id string) error
GetOrder(ctx context.Context, id string) (*types.Order, error)
2021-02-25 18:24:24 +00:00
GetOrdersByAccountID(ctx context.Context, accountID string) error
UpdateOrder(ctx context.Context, o *types.Order) error
2021-02-25 18:24:24 +00:00
}