File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " mullerpeter-databricks-datasource" ,
33 "private" : true ,
4- "version" : " 1.3.4 " ,
4+ "version" : " 1.3.5 " ,
55 "description" : " Databricks SQL Connector" ,
66 "scripts" : {
77 "build" : " webpack -c ./.config/webpack/webpack.config.ts --env production" ,
Original file line number Diff line number Diff line change 88 "golang.org/x/oauth2/clientcredentials"
99 "net/http"
1010 "sync"
11- "time"
1211)
1312
1413type oauth2ClientCredentials struct {
@@ -26,6 +25,7 @@ func (c *oauth2ClientCredentials) Authenticate(r *http.Request) error {
2625 if c .tokenSource != nil {
2726 token , err := c .tokenSource .Token ()
2827 if err != nil {
28+ log .DefaultLogger .Error ("token fetching failed" , "err" , err )
2929 return err
3030 }
3131 token .SetAuthHeader (r )
@@ -39,23 +39,17 @@ func (c *oauth2ClientCredentials) Authenticate(r *http.Request) error {
3939 Scopes : c .scopes ,
4040 }
4141
42- // Create context with 1m timeout to cancel token fetching
43- ctx , cancel := context .WithTimeout (context .Background (), 1 * time .Minute )
44- if cancel != nil {
45- log .DefaultLogger .Debug ("ignoring defer for timeout to not cancel original request" )
46- }
47-
48- c .tokenSource = config .TokenSource (ctx )
42+ c .tokenSource = config .TokenSource (context .Background ())
4943
5044 log .DefaultLogger .Debug ("token fetching started" )
5145 token , err := c .tokenSource .Token ()
5246
5347 if err != nil {
5448 log .DefaultLogger .Error ("token fetching failed" , "err" , err )
5549 return err
56- } else {
57- log .DefaultLogger .Debug ("token fetched successfully" )
5850 }
51+
52+ log .DefaultLogger .Debug ("token fetched successfully" )
5953 token .SetAuthHeader (r )
6054
6155 return nil
You can’t perform that action at this time.
0 commit comments