Skip to content

Commit

Permalink
Modernize CA testing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai committed Jun 16, 2018
1 parent 5c7cf69 commit 712cc87
Show file tree
Hide file tree
Showing 4 changed files with 578 additions and 761 deletions.
6 changes: 4 additions & 2 deletions builtin/logical/pki/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (

// Factory creates a new backend implementing the logical.Backend interface
func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error) {
b := Backend()
b := Backend(conf)
if err := b.Setup(ctx, conf); err != nil {
return nil, err
}
return b, nil
}

// Backend returns a new Backend framework struct
func Backend() *backend {
func Backend(conf *logical.BackendConfig) *backend {
var b backend
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
Expand Down Expand Up @@ -86,13 +86,15 @@ func Backend() *backend {

b.crlLifetime = time.Hour * 72
b.tidyCASGuard = new(uint32)
b.storage = conf.StorageView

return &b
}

type backend struct {
*framework.Backend

storage logical.Storage
crlLifetime time.Duration
revokeStorageLock sync.RWMutex
tidyCASGuard *uint32
Expand Down
Loading

0 comments on commit 712cc87

Please sign in to comment.