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

[v14] Access Plugins: Support dynamic credential reloading #34079

Merged
merged 9 commits into from
Nov 1, 2023
Prev Previous commit
Next Next commit
Export NewIdentityFileWatcher
strideynet committed Oct 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit cfd76888ece117d0ed6752107bfbbbccfe0a160c
4 changes: 2 additions & 2 deletions integrations/lib/config.go
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ func (cfg *TeleportConfig) CheckTLSConfig() error {
return nil
}

func newIdentityFileWatcher(ctx context.Context, path string, interval time.Duration) (*client.DynamicIdentityFileCreds, error) {
func NewIdentityFileWatcher(ctx context.Context, path string, interval time.Duration) (*client.DynamicIdentityFileCreds, error) {
dynamicCred, err := client.NewDynamicIdentityFileCreds(path)
if err != nil {
return nil, trace.Wrap(err, "creating dynamic identity file watcher")
@@ -151,7 +151,7 @@ func (cfg TeleportConfig) NewClient(ctx context.Context) (*client.Client, error)
case cfg.Identity != "" && !cfg.RefreshIdentity:
creds = []client.Credentials{client.LoadIdentityFile(cfg.Identity)}
case cfg.Identity != "" && cfg.RefreshIdentity:
cred, err := newIdentityFileWatcher(ctx, cfg.Identity, cfg.RefreshIdentityInterval)
cred, err := NewIdentityFileWatcher(ctx, cfg.Identity, cfg.RefreshIdentityInterval)
if err != nil {
return nil, trace.Wrap(err)
}