Skip to content

Commit

Permalink
Support batch tokens in renewer and caching proxy for transit auto-un…
Browse files Browse the repository at this point in the history
…seal (#7441)

Currently this uses a fork of the api.Renewer code, which we should consolidate in 1.3.
  • Loading branch information
jefferai authored Sep 9, 2019
1 parent 1bba7fa commit 9ee93b6
Show file tree
Hide file tree
Showing 4 changed files with 385 additions and 6 deletions.
5 changes: 3 additions & 2 deletions command/agent/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

hclog "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/command/agent"
"github.com/hashicorp/vault/sdk/helper/jsonutil"
)

Expand Down Expand Up @@ -99,7 +100,7 @@ func (ah *AuthHandler) Run(ctx context.Context, am AuthMethod) {
credCh = make(chan struct{})
}

var renewer *api.Renewer
var renewer *agent.Renewer

for {
select {
Expand Down Expand Up @@ -196,7 +197,7 @@ func (ah *AuthHandler) Run(ctx context.Context, am AuthMethod) {
renewer.Stop()
}

renewer, err = ah.client.NewRenewer(&api.RenewerInput{
renewer, err = agent.NewRenewer(ah.client, &agent.RenewerInput{
Secret: secret,
})
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion command/agent/cache/lease_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/hashicorp/errwrap"
hclog "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/command/agent"
cachememdb "github.com/hashicorp/vault/command/agent/cache/cachememdb"
"github.com/hashicorp/vault/helper/namespace"
nshelper "github.com/hashicorp/vault/helper/namespace"
Expand Down Expand Up @@ -394,7 +395,7 @@ func (c *LeaseCache) startRenewing(ctx context.Context, index *cachememdb.Index,
client.SetToken(req.Token)
client.SetHeaders(req.Request.Header)

renewer, err := client.NewRenewer(&api.RenewerInput{
renewer, err := agent.NewRenewer(client, &agent.RenewerInput{
Secret: secret,
})
if err != nil {
Expand Down
Loading

0 comments on commit 9ee93b6

Please sign in to comment.