backport of commit 72c9759987

pull/4729/head
Todd 2 years ago
parent 249f15dce3
commit ba77cb5a97

@ -26,10 +26,13 @@ type ResolvableAliasRetrievalFunc func(ctx context.Context, addr, authTok, userI
func defaultResolvableAliasFunc(ctx context.Context, addr, authTok, userId string, refreshTok RefreshTokenValue) ([]*aliases.Alias, []string, RefreshTokenValue, error) {
const op = "cache.defaultResolvableAliasFunc"
client, err := api.NewClient(&api.Config{
Addr: addr,
Token: authTok,
})
conf, err := api.DefaultConfig()
if err != nil {
return nil, nil, "", errors.Wrap(ctx, err, op)
}
conf.Addr = addr
conf.Token = authTok
client, err := api.NewClient(conf)
if err != nil {
return nil, nil, "", errors.Wrap(ctx, err, op)
}

@ -25,10 +25,13 @@ type SessionRetrievalFunc func(ctx context.Context, addr, authTok string, refres
func defaultSessionFunc(ctx context.Context, addr, authTok string, refreshTok RefreshTokenValue) ([]*sessions.Session, []string, RefreshTokenValue, error) {
const op = "cache.defaultSessionFunc"
client, err := api.NewClient(&api.Config{
Addr: addr,
Token: authTok,
})
conf, err := api.DefaultConfig()
if err != nil {
return nil, nil, "", errors.Wrap(ctx, err, op)
}
conf.Addr = addr
conf.Token = authTok
client, err := api.NewClient(conf)
if err != nil {
return nil, nil, "", errors.Wrap(ctx, err, op)
}

@ -25,10 +25,13 @@ type TargetRetrievalFunc func(ctx context.Context, addr, authTok string, refresh
func defaultTargetFunc(ctx context.Context, addr, authTok string, refreshTok RefreshTokenValue) ([]*targets.Target, []string, RefreshTokenValue, error) {
const op = "cache.defaultTargetFunc"
client, err := api.NewClient(&api.Config{
Addr: addr,
Token: authTok,
})
conf, err := api.DefaultConfig()
if err != nil {
return nil, nil, "", errors.Wrap(ctx, err, op)
}
conf.Addr = addr
conf.Token = authTok
client, err := api.NewClient(conf)
if err != nil {
return nil, nil, "", errors.Wrap(ctx, err, op)
}

@ -270,11 +270,6 @@ func (c *Command) Client(opt ...Option) (*api.Client, error) {
}
}
// Turn off retries on the CLI
if os.Getenv(api.EnvBoundaryMaxRetries) == "" {
c.client.SetMaxRetries(0)
}
switch {
case opts.withNoTokenValue:
c.client.SetToken("")

Loading…
Cancel
Save