grafana/pkg/infra
Dan Cech 9020eb4b17
Auth: Update oauthtoken service to use remote cache and server lock (#90572)
* update oauthtoken service to use remote cache and server lock

* remove token cache

* retry is lock is held by an in-flight refresh

* refactor token renewal to avoid race condition

* re-add refresh token expiry cache, but in SyncOauthTokenHook

* Add delta to the cache ttl

* Fix merge

* Change lockTimeConfig

* Always set the token from within the server lock

* Improvements

* early return when user is not authed by OAuth or refresh is disabled

* Allow more time for token refresh, tracing

* Retry on Mysql Deadlock error 1213

* Update pkg/services/authn/authnimpl/sync/oauth_token_sync.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Update pkg/services/authn/authnimpl/sync/oauth_token_sync.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Add settings for configuring min wait time between retries

* Add docs for the new setting

* Clean up

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2024-08-19 18:57:37 +02:00
..
db QuotaService: refactor to use ReplDB for Get queries (#91333) 2024-08-08 13:41:33 -04:00
filestorage chore: Updating linter, fixing some new warnings (#88863) 2024-06-06 13:01:27 -04:00
fs Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
httpclient AWS: Update deprecated aws-sdk functions from env variable versions (#89643) 2024-06-26 11:56:39 -04:00
kvstore Chore: Update test database initialization (#81673) 2024-02-09 09:35:39 -05:00
localcache Migrate to Wire for dependency injection (#32289) 2021-08-25 15:11:22 +02:00
log chore(perf): Pre-allocate where possible (enable prealloc linter) (#88952) 2024-06-14 14:16:36 -04:00
metrics Metrics: Prevent duplicates in MultiRegistry (#85880) 2024-04-10 10:55:24 -04:00
network Backend: fix IPv6 address parsing erroneous (#28585) 2020-11-25 07:55:22 +01:00
process PluginsCatalog: adding error information about disabled plugins. (#39171) 2021-09-20 09:08:00 +02:00
remotecache RemoteCache: remove count method (#91581) 2024-08-06 19:21:00 +02:00
serverlock Auth: Update oauthtoken service to use remote cache and server lock (#90572) 2024-08-19 18:57:37 +02:00
slugify Slug: Combine various slugify fixes for special character handling (#73164) 2023-08-10 16:12:50 -04:00
tracing API Server: Fix stack overflow panic when tracing is disabled (#90075) 2024-07-04 19:11:59 +03:00
usagestats Zanzana: Evaluate permissions alongside with RBAC engine (#90064) 2024-07-05 11:31:23 +02:00