Auth: Refactor for revoking user tokens within last hours (#74616)
* fix: revoked tokens within last hours
adds check for unlimited sessions out of index
adds a function for specifing the hours to look back when revoking users tokens, otherwise we "assume" the clean up takes care of them adds a index for the `user_auth_token` - `revoked_at` for faster queries when using `revoked_at`
* fix: sqllite datetime conversion with unixtimestamps
* fix: postgres dialect
* fix: mysql dialect
* fix: mysql dialect missing closing )
* refactor: delete revoked tokens directly
* fix: tests for sqlite
* AuthToken: Simplify DeleteUserRevokedTokens and add test
* fix: linting newline
* Reset get time after test
* fix: test order by revoked
* fix: order by different db
* ascending
* test with seen at
---------
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
(cherry picked from commit b00f3216c1)
* Prometheus: Handle the response with different field key order (#74567)
* Handle the response with different field key order
* More unit tests to cover edge cases
* Cover more edge cases
* make it simpler
* Better test inputs
(cherry picked from commit 3107459e57)
* Adjust the code for 10.1.x
Alerting: Do not exit if Redis ping fails when using redis-based Alertmanager clustering (#74144)
Do not fail redis peer construction if ping fails
(cherry picked from commit 5c9aeaef41)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* [LDAP] Disable removed users on login (#74016)
* [LDAP] Disable removed users on login
* Fix tests
* Add test for user disabling
* Add tests for disabling user behind auth proxy
* Linting.
* Rename setup func
* Account for reviews comments
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
---------
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
(cherry picked from commit f900098cc9)
* manual backport of #74016
* LDAP: Fix active sync with large quantities of users (#73834)
* Fix middleware test
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
Alerting: Limit redis pool size to 5 and make configurable (#74057)
* Limit redis pool size to 5 and expose it in config ini
* Coerce negative pool sizes to the default
(cherry picked from commit dfba94e052)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* Plugins: Dynamic angular patterns: Add random offset to GCOM API calls, handle HTTP errors (#73494)
* Plugins: Dynamic angular patterns: Return error for != 2xx status code
* Add test for status code check
* Plugins: Dynamic angular patterns: Add random skew to periocic GCOM api calls
* Add test for random skew
* Changed randomSkew signature, ensure it is always positive
(cherry picked from commit 4ef98449ff)
* trigger
---------
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
Kinds: Reconcile verify-kinds.go with kind-registry changes (#73689)
* Kinds: Reconcile verify-kinds.go with kind-registry changes
* Remove handwritten value specific for manual test
* Update grafana/kindsys dep
* Revert "Update grafana/kindsys dep"
This reverts commit e437e1879e.
* Fix generated code
(cherry picked from commit fb0165ab87)
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Grafana versioning: Remove `pre` suffix from Grafana version (#73357)
* Remove pre suffix from version
* Fix tests
(cherry picked from commit 0aba319ea0)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Slug: Combine various slugify fixes for special character handling (#73164)
* combine various slugify fixes for special character handling
* a couple more test cases
* update more tests
* goimports
(cherry picked from commit dd97038b00)
Co-authored-by: Dan Cech <dcech@grafana.com>
AzureMonitor: Allow `serviceTags` and `tags` to be empty for trace results (#73145)
Allow serviceTags and tags to be empty
(cherry picked from commit 95546551bc)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Logs: Disable query splitting due to conflicts with transformations (#73086)
* disable query splitting for now
* change stage of `lokiQuerySplitting`
(cherry picked from commit 1343c74362)
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
Auth: prevent auto_login redirect if user is already authenticated (#72477)
* Auth: prevent auto_login redirect if user is already authenticated
Before attempting an auto-login for OAuth, verifies if current context has already been
authenticated.
Fixes: #72476
Co-authored-by: Karl Persson <kalle.persson92@gmail.com>
(cherry picked from commit d9c232b331)
Co-authored-by: Maksym Revutskyi <maksym.revutskyi@gmail.com>
InfluxDB: Fix handling flux response with no time and value column (#72833)
* Upgrade the influxdb-client-go version
* Handle flux response with no time and value column
(cherry picked from commit 1ac9e7eaab)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Auth: OAuth sets `skip_org_role_sync = true` for auth.google by default (#72819)
* sets skip_org_role_sync to true for google
* add google skiporgrolesync and sets to true always
* add field
* Update docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* add AKS to words
* script back to mina
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit 95760cb021)
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Auth: lock down Grafana admin sync for SAML (#72828)
lock down Grafana admin sync for SAML
(cherry picked from commit 3a2538c2ca)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Auth: Add missing skipOrgRoleSync property to SocialBase for GenericOAuth (#72752)
* add missing cfg for skiporgrolesync
* add google skiporgrolesync
* removed google skip
* update docs to reflect google
* remove docs update for google
(cherry picked from commit 27f57fe112)
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Usage stats: Tune collector execution startup and interval (#72688)
* Do not update statistics at service collector startup
* Configurable collector interval
* Introduce initial random delay
* Prevent reporting metrics until the stats have been collected
* Apply suggestion from code review
(cherry picked from commit afb59af79b)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
Search v1: Remove unnecessary subqueries (#72388)
* Add feature flag
* Introduce interface and dummy implementation
* Add tests for the new filter
* accessControlDashboardPermissionFilterNoFolderSubquery implementation
* join only if it's necessary
* force ordering for tests
* Temporarily enable new query for benchmarks
(cherry picked from commit 2c26a02b82)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
UserSync: Avoid UpdateLastSeenAt with invalid user ids (#72776)
* avoid user zero
* more errors
* more tests
* split
(cherry picked from commit 7431c0ddb1)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Chore: Refactor error when retrieving the plugin manifest key (#72492)
(cherry picked from commit a331c892a0)
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* build httpsettings overhaul with new auth component
* remove test code
* add connection and advanced http settings components
* use tooltip with link
* add correct styling and spacing
* save option select for sigV4
* fix styles in Azure auth to fit new auth component
* add types in overhaul folder that are not available yet in grafana
* update e2e tests for new connection component
* update e2e tests for new connection component
* update width of azure inputs
* fix non custom auth selects
* add feature toggle
* wrap azure style changes behind the feature flag
* fix feature toggle rebase fix error
* move advanced http setting and wrap everything in the config subsection component to fix font
* fix input width
* use cx for conditional classes
* use cx for conditional class