From d36a8ba0623f700e1c3679b4663d4e858de556d3 Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Wed, 29 Jan 2025 14:31:33 -0600 Subject: [PATCH] chore: [WIP] investigating options for sharing authClient across resources & services --- internal/config/config.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index 59d002bf9..0e8bbe91c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -95,7 +95,14 @@ func (c *Config) Load(ctx context.Context) error { ClientSecret: c.ClientSecret, BaseURL: c.BaseURL, } - authClient = authConfig.New(ctx) + // The `ctx` that is passed in here for the framework + // provider is canceled by the time we need auth. Need + // to test how this change impacts shutting down the provider, + // but this sort of thing may be the "right" way forward + // for now, given the following long-standing issue for the + // oauth2 package: + // https://github.com/golang/oauth2/issues/262 + authClient = authConfig.New(context.TODO()) } authClient.Timeout = c.requestTimeout()