Commit Graph

7006 Commits

Author SHA1 Message Date
Fayzal Ghantiwala
df25e9197e
Alerting: Get grafana-managed alert rule by UID (#86845)
* Add auth checks and test

* Check user is authorized to view rule and add tests

* Change naming

* Update Swagger params

* Update auth test and swagger gen

* Update swagger gen

* Change response to GettableExtendedRuleNode

* openapi3-gen

* Update tests with refactors models pkg
2024-05-02 15:24:59 +01:00
Arati R
9e6de035c0
Storage: Add mode 2 dual writing improvements (#87204)
* Fix mode 2 List test
* Set origin timestamp during conversion to k8s resource
* Add instructions for updating a playlist
* Handle partial deletions of a collection in mode 2
2024-05-02 16:06:51 +02:00
Gabriel MABILLE
8802282ebc
RBAC: fix panic role not found permission sync (#87217) 2024-05-02 15:19:56 +02:00
Mihai Doarna
a979417700
SSO: Update ssoSettingsApi flag to general availability (#87216)
* update ssoSettingsApi flag to general availability

* generate files
2024-05-02 16:00:52 +03:00
Karl Persson
d8fbbdefea
Identity: Use typed namespace id (#87121)
* Use typed namespace id
2024-05-02 14:50:56 +02:00
Serge Zaitsev
ad5613d7d4
Chore: Remove cfg from folder service (#87212)
remove cfg from folder service
2024-05-02 13:18:54 +02:00
Ieva
28dd1ddd8e
RBAC: Do not set permissions on data sources with wildcard UID in OSS (#87220)
do not set permissions on DS with wildcard UID
2024-05-02 13:18:29 +03:00
Serge Zaitsev
6ddb8aeae3
Chore: Moving to slog (folders) (#87000)
* moving folders to slog

* trying to fix the tests

* fix per-logger filters in slog

* allow using slog.Default()

* bring cfg back to keep the pr small

* fix tests

* back to the roots
2024-05-02 09:14:12 +02:00
owensmallwood
40558899e4
Unified Storage: Adds health check service for entity server (#86471) 2024-05-01 11:36:44 -06:00
lean.dev
0719f73f35
Cloud Migration: Remove ID migration in favor of UID (#86550)
* - Added migration to add a new collumn UID to both migration and migration_run tables.
- Added migration to set UID for records already existent in the database before adding a new column.
- Added UID field to CloudMigration and CloudMigrationRun dtos (model.go)

* Fix db migration

* Updating store and model

* Updating API to use UID

* fix typo

* update openapi specs and generated endpoints

* fix spec

* update openapi specs and generated endpoints

* Fixing db mapping

* Fix frontend

* fix migration

* remove migration uid from run fetch endpoint

* Revert "merge"

This reverts commit d654e4c530, reversing
changes made to 5fe0b483eb.

* manual merge

* rename some funcs for consistency

* make interfaces consistent

* validate uids

* update generated frontend api

* fix enterprise spec

* manually resolve api

* try again

* try yet again

* once more

---------

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
2024-05-01 12:29:25 -04:00
Arati R
61f3d08c3f
Storage: Add List support for pagination (#87093)
* Add origin keys to List request
* Check origin keys requirement in the sql entity server's List method
* Refactor mode 2 List
* Check origin keys before making Storage List call

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-05-01 08:42:47 +02:00
bornohin6
7ce1254913
CloudMigration: Remove details from the migration run list (#87104)
Remove details from the migration run list
2024-04-30 11:44:35 -07:00
William Wernert
93519f70ca
Alerting: Also fix HCL field name for MuteTimeIntervals (#87079)
* Correct HCL field name for MuteTimeIntervals

* Update test
2024-04-30 16:14:01 +01:00
Ieva
5e060d2d99
Data source: Maintain the default data source permissions when switching from unlicensed to licensed Grafana (#87119)
set managed data source permissions upon resource creation for unlicensed Grafana, remove them on deletion
2024-04-30 16:05:30 +01:00
Steve Simpson
5c89b8fe12
gRPC Server: Make message size limits configurable. (#86982)
* gRPC Server: Make message size limits configurable.

* Fix mistake, don't add opts twice

* Apply suggestions from code review

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2024-04-30 16:18:03 +02:00
Mihai Doarna
76d94b35c9
SSO: fix settings merge for SAML fields (#86970)
* fix sso settings merge for saml fields

* change func name
2024-04-30 15:10:27 +03:00
Karl Persson
a2cba3d0b5
User: Add tracing (#87028)
* Inject tracer in tests

* Annotate with traces

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-04-30 13:15:56 +02:00
Arati R
ec6f59a678
Chore: Update protoc-gen-go (#87116)
Update protoc-gen-go
2024-04-30 12:14:33 +02:00
Misi
1cb3f332a1
Chore: Remove extra sql select from the Insert function of userimpl.store (#87060)
Remove getAnyUserType
2024-04-30 08:54:20 +02:00
Yuri Tseretyan
052082a927
Alerting: Refactor Alert Rule Generators (#86813) 2024-04-29 21:52:15 -04:00
William Wernert
70ff229bed
Alerting: Use expected field name for receiver in HCL export (#87065)
* Use expected field name for receiver in hcl

Terraform provider expects `contact_point` instead of `receiver` in
notification settings on a rule.
2024-04-29 18:13:29 +01:00
Santiago
36a0499128
Alerting: Implement CreateSilence in the forked Alertmanager (remote primary mode) (#85716) 2024-04-29 18:47:25 +02:00
Santiago
1af2e69625
Alerting: Implement DeleteSilence in the forked AM (remote primary) (#85721) 2024-04-29 17:23:41 +02:00
Eric Leijonmarck
8a1f43a65d
User: Remove the lowercasing in the query for login conflict (#87032)
* refactor: remove the lowercasing in the query for login conflict

* refactor: move function into the closure gs
2024-04-29 12:24:14 +01:00
Ieva
cee713e34c
Chore: Add tracing to team service (#86999)
* add tracing to team service

* another test fix

* pass in context for team creation and membership checking
2024-04-29 11:32:03 +01:00
Steve Simpson
fbaa847a3c
Alerting: Pass logger into NewRemoteLokiBackend. (#87029)
Tiny refactor to allow a logger to be passed into NewRemoteLokiBackend.
2024-04-29 12:10:23 +02:00
Karl Persson
c4cfee8d96
User: support setting org and help flags though update function (#86535)
* User: Support setting active org through update function

* User: add support to update help flags through update function
2024-04-29 08:53:05 +02:00
Hugo Kiyodi Oshiro
7783b16e47
Plugins: Make grafana-com API URL usage consistent (#86920)
Plugins: Fix grafana-com API URL usage
2024-04-26 16:47:38 +02:00
Yuri Tseretyan
dff7cb9afb
Alerting: Move alertmanager api silence code to separate files (#86947)
* Move alertmanager api silence code to separate files unchanged

* Replace with silence model instead interface

---------

Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
2024-04-25 15:20:37 -04:00
Matthew Jacobson
3397e8bf09
Alerting: Improve error when receiver or time interval used by rule is deleted (#86865)
* Alerting: Improve error when receiver used by rule is deleted

* Remove RuleUID from public error and data

* Improve fallback error in am config post

* Refactor to expand to time intervals

* Fix message on unchecked errors to be same as before
2024-04-25 13:36:00 -04:00
Eric Leijonmarck
e394e16073
Auth: Force lowercase login/email for users (#86359)
* [WIP]: Force lowercase login/email for user CRUD

* warn and remove use of userCaseInsensitiveLogin check

* remove log warning

* reimplementation of the caseinsensitive

* need to decide if we want the conflict check or not

* remvoved the tests for conflict user by getEmail, getLogin

* added tests for user lowercase migration

* wip: emails next

* tests for email lowercasing

* review comments

* optimized login and email lookup before migrating
2024-04-25 17:31:17 +01:00
Ieva
748b3c855c
Chore: Clean up team membership code (#86914)
remove unused code, clean up commands
2024-04-25 16:46:24 +01:00
Mihai Doarna
4bf9405ce4
SSO: add SSO settings to secrets migrator (#86913)
* add sso settings to secrets migrator

* unify SSO settings in all log lines
2024-04-25 18:30:23 +03:00
Marcus Efraimsson
ac152ca416
Chore: Upgrade grpc-ecosystem/go-grpc-middleware to v2 (#86724)
* Chore: Replace deprecated prometheus grpc middleware

* go mod tidy without enterprise

* with updated sdk branch

* sdk v0.226.0

* remove deprecated opentracing support for outgoing plugin requests

* migrate to github.com/grpc-ecosystem/go-grpc-middleware/v2

* fix
2024-04-25 17:25:48 +02:00
Mihai Doarna
28e86c3edb
Mention the migrator in the secrets service readme (#86922)
mention the migrator in the secrets service readme
2024-04-25 17:44:55 +03:00
Karl Persson
cd724d74aa
Authn: move namespace id type (#86853)
* Use RoleType from org package

* Move to identity package and re-export from authn

* Replace usage of top level functions for identity

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2024-04-25 12:54:36 +02:00
Ieva
8028d1c3e1
Chore: Update tests to use team membership hooks (#86846)
* update tests to use team membership hooks

* linting
2024-04-24 16:55:42 +01:00
Sofia Papagiannaki
a5a3ee9fa3
SQLStore: Disable redundant create and drop unique index migrations on dashboard table (#86857)
SQLStore: Disable create and drop unique index migrations
2024-04-24 15:25:43 +01:00
Alexander Zobnin
60ed6bfc33
Search: Fix slow query when user does not have roles assigned (#86791)
* Search: Fix slow query when user does not have roles assigned

* Check all required actions and skip if not found
2024-04-24 13:23:08 +03:00
Charandas
d46b163810
Authn (jwt_auth): add tracing spans for validating newer use cases (#86812) 2024-04-24 02:40:00 -07:00
Serge Zaitsev
522a98c126
Chore: Make Cfg field private in SQLStore (#85593)
* make cfg private in sqlstore

* fix db init in tests

* fix case

* fix folder test init

* fix imports

* make another Cfg private

* remove another Cfg

* remove unused variable

* use store cfg, it has side-effects

* fix mutated cfg in tests
2024-04-24 10:38:40 +02:00
Piotr Jamróz
f6e472f879
Explore: Show a drawer with tabs for the library and query history (#86279)
* Create basic feature toggle

* Rename context to reflect it contains query history and query library

* Update icons and variants

* Rename hooks

* Update tests

* Fix mock

* Add tracking

* Turn button into a toggle

* Make dropdown active as well

This is required to have better UI and an indication of selected state in split view

* Update Query Library icon

This is to make it consistent with the toolbar button

* Hide query history button when query library is available

This is to avoid confusing UX with 2 button triggering the drawer but with slightly different behavior

* Make the drawer bigger for query library

To avoid confusion for current users and test it internally a bit more it's behind a feature toggle. Bigger drawer may obstruct the view and add more friction in the UX.

* Fix tests

The test was failing because queryLibraryAvailable was set to true for tests. This change makes it more explicit what use case is being tested

* Remove active state underline from the dropdown

* Allow closing Query Library drawer from the toolbar

* Simplify dropdown design
2024-04-24 10:32:11 +02:00
Karl Persson
0fa983ad8e
AuthN: Use typed namespace id inside authn package (#86048)
* authn: Use typed namespace id inside package
2024-04-24 09:57:34 +02:00
Kristin Laemmert
9553923eb7
Chore: Fix failing ssosettingimpl test (#86792)
Chore: Fix failing ssosetting test
2024-04-23 11:36:34 -04:00
George Robinson
2049f766c6
Remove fmt.Println of client certificate (#86773) 2024-04-23 15:15:52 +01:00
Laura Fernández
2fb38a34ac
Navigation: Add a return to previous button when navigating to different sections (#86764) 2024-04-23 15:56:04 +02:00
Mihai Doarna
bf15329492
SSO: run the validation on upsert with all secrets in settings (#86579)
* run the validation on upsert with all secrets in settings

* rename social to reloadable
2024-04-23 16:50:16 +03:00
Santiago
a6be12c037
Alerting: Implement SaveAndApplyConfig in the forked Alertmanager (remote primary) (#84659)
* Alerting: Implement SaveAndApplyConfiguration in the forked Alertmanager struct

* call SaveAndApplyConfig on the remote first, log errors for the internal

* add comments explaining why we ignore errors in the internal AM

* restore go.work.sum
2024-04-23 15:45:35 +02:00
Steve Simpson
a6ad2380bf
Alerting: Refactor api_prometheus.go request handlers. (#86639)
This splits the request handlers into two functions, one which is the actual
handler and one which is independent from the Grafana `ReqContext` object. This
is to make it easier to reuse the implementation in other code.

Part of the refactoring changes the functions which get query parameters from
the request to operate on a `url.Values` instead of the request object.

The change also makes the code consistently use `req.Form` instead of a
combination of `req.URL.Query()` and `req.Form`, though I have left
`api_ruler` as-is to avoid this PR growing too large.
2024-04-23 14:50:26 +02:00
Santiago
c77ab53819
Alerting: implement SaveAndApplyConfig in the remote Alertmanager struct (#84642)
* implement SaveAndApplyConfig in the remote Alertmanager struct

* remove ID from CreateGrafanaAlertmanagerConfig call

* decrypt, test that we decrypt, refactor

* fix duplicated declaration in test

* rephrase comment, remove unnecessary conversion to slice of bytes

* fix test
2024-04-23 14:37:10 +02:00