Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support batch tokens in renewer and caching proxy for transit auto-unseal #7441

Merged
merged 8 commits into from
Sep 9, 2019
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