Commit Graph

3329 Commits

Author SHA1 Message Date
Karl Persson
1528d6f5c4
Authn: Prevent empty username and email during sync (#76330)
* Move errors to error file

* Move check for both empty username and email to user service

* Move check for empty email and username to user service Update

* Wrap inner error

* Set username in test
2023-10-11 14:27:43 +02:00
Sofia Papagiannaki
99e4894636
Chore: Replace mock guardian with the actual one in folder API benchmarks (#76231)
Benchmarks: Replace mock guardian with the actual one
2023-10-10 13:31:55 +03:00
Marcus Efraimsson
90631360eb
Instrumentation: Handle context.Canceled (#75867)
Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-10-10 12:28:39 +02:00
Jo
8919cafcb4
Identity: Unfurl UserID and Email in pkg/api to user identity.Requester (#76112)
* Unfurl OrgRole in pkg/api to allow using identity.Requester interface

* Unfurl Email in pkg/api to allow using identity.Requester interface

* Update UserID in pkg/api to allow using identity.Requester interface

* fix authed test

* fix datasource tests

* guard login

* fix preferences anon testing

* fix anonymous index rendering

* do not error with user id 0
2023-10-09 16:07:28 +02:00
Giuseppe Guerra
cfcfbe4aaa
Plugins: Refactoring: Implement plugin instrumentation as a middleware (#76011)
* Plugins: Refactor instrumentation as plugin client middleware

* Simplify repeated code

* Fix compilation error

* Add comments

* Moved status and endpoint consts to utils.go

* Fix wrong endpoint name in CheckHealth InstrumentationMiddleware

* Add tests

* Fix wrong endpoint value in instrumentPluginRequestSize

* removed todo

* PR review feedback: use MustRegister

* PR review feedback: move tracing middleware before instrumentation middleware

* PR review feedback: removed decommissioned check

* PR review feedback: extract prometheus metrics into separate variables
2023-10-09 14:12:57 +02:00
Jo
41bcb5e07f
Identity: Port folder library to identity.Requester (#76105)
Port folders to identity.Requester
2023-10-06 15:02:34 +02:00
Jo
342af2d078
Identity: Port Annotations and Analytics to Identity.Requester (#76104)
* Port analytics to requester

* Port annotations to identity.Request
2023-10-06 11:38:20 +02:00
Jo
729dafaff9
Auth: Unfurl OrgID in pkg/api to allow using identity.Requester interface (#76108)
Unfurl OrgID in pkg/api to allow using identity.Requester interface
2023-10-06 11:34:36 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Karl Persson
684d68365e
IDforwarding: forward signed id to plugins (#75651)
* Plugins: Add client middlware that forwards the signed grafana id token if present

* DsProxy: Set grafana id header if id token exists

* Add util function to apply id token to header

* Only add id forwarding middleware if feature toggle is enabled

* Add feature toggles to ds proxy and check if id forwarding is enabled

* Clean up test setup

* Change to use backend.ForwardHTTPHeaders interface

* PluginProxy: Forward signed identity when feature toggle is enabled

* PluginProxy: forrward signed id header
2023-10-02 09:14:10 +02:00
Ryan McKinley
010b2461b9
Plugins: Move alias support to plugin json (but still hardcoded) (#75129) 2023-09-29 08:20:37 -07:00
Karl Persson
7a38090bc0
AuthN: Fix namespaces for anonymous and render (#75661)
* AuthN: remove IsAnonymous from identity struct and set correct namespace for anonymous and render

* Don't parse user id for render namespace
2023-09-29 09:10:33 +02:00
Gabriel MABILLE
6ffd4a23de
Team: Support sort query param for teams search endpoint (#75622)
* Teams: Implement backend sorting

* Add docs

* Make name ordering case insensitive

* lint

* Fix no lowercasing on memberCount

* Add test to double check the filters or correctly OrderBy
2023-09-28 18:20:51 +03:00
Sergey Kostrukov
3ee40d3a5a
Azure: Settings for Azure AD Workload Identity (#75283)
* Settings for Azure AD Workload Identity

* Update dependency on Grafana Azure SDK

* Documentation

* Fix JS code

* Cleanup Prometheus backend code

* Making prettier happy
2023-09-28 12:05:16 +01:00
Gabriel MABILLE
96cbe70b14
User: Support sort query param for user and org user, search endpoints (#75229)
* User: Add sort option to user search

* Switch to an approach that uses the dashboard search options

* Cable user sort on the org endpoint

* Alias user table with u in org store

* Add test and cover orgs/:orgID/users/search endpoint

* Add test to userimpl store

* Simplify the store_test with sortopts.ParseSortQueryParam

* Account for PR feedback

* Positive check

* Update docs

* Update docs

* Switch to ErrOrFallback

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-09-28 10:16:18 +02:00
Ryan McKinley
bbdd1fc3b1
Playlist: Remove unused/deprecated api and unused wrapper (#75503) 2023-09-27 15:28:16 +00:00
Marcus Efraimsson
0128d0403f
Tracing: Use tracing.InitializeTracerForTest (#75479) 2023-09-27 09:51:57 +02:00
Carl Bergquist
8d62ed77f0
instrumentation: set slogroup high-fast for more handlers (#75449)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-09-26 19:11:29 +02:00
Marcus Efraimsson
534e3ebf0c
Plugins: Use a Grafana specific SDK tracer implementation for core plugins (#75388) 2023-09-26 14:46:31 +02:00
Kat Yang
9532ff3799
Chore: Split OSS and Enterprise OAPI Spec Generation (#75133)
* chore: implement sofia makefile changes from #62456

* chore: clean up makefile and generate specs

* docs: update command to delete old specs

* fix: regenerate specs with enterprise linked

* chore: implement review comments

* Update Makefile

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* chore: update make command in drone step

* chore: update bingo, fix makefile indentation error, regen specs

* fix: revert .bingo/README changes to make prettier happy

* chore: add BEP as owners of api-enterprise-spec.json

* chore: rerun drone

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-09-25 15:34:57 -04:00
João Calisto
7e1b45ba31
Feature Toggles API: Trigger webhook call when updating (#75254)
* Feature Toggles API: Trigger webhook call when updating

* update status code error check

* lint - handle Close() error

* Rename update webhook config

* fix tests
2023-09-25 19:11:24 +01:00
Andres Martinez Gotor
ece94b1e01
Chore: Remove plugincontext.ErrPluginNotFound (#74997) 2023-09-25 13:10:47 +03:00
Andres Martinez Gotor
1714fa598c
Chore: Refactor backend plugin errors (#74928) 2023-09-25 11:56:03 +02:00
Andres Martinez Gotor
c70623fb85
Chore: Rename testdata plugin with a fully qualified name (#75104) 2023-09-22 15:00:40 +03:00
Ezequiel Victorero
4cfc834c08
HealthCheck: show enterprise commit (#75242) 2023-09-22 08:17:10 -03:00
Carl Bergquist
e5fbc4a4cd
web: add slo group to request meta (#74765)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-09-22 11:52:28 +03:00
Will Browne
7fca1bde54
Plugins: Set grafana config, plugin version and user agent on plugin requests (#75171)
* first pass

* fixup

* remove test line

* fix tests

* use new fields

* fix imports + formatting

* fix tests

* rollback changes

* undo whitespace

* apply pr feedback
2023-09-21 11:33:31 +02:00
Carl Bergquist
764478b9e7
Instrumentation: Set auth as owners for more routes (#75105)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2023-09-20 10:18:52 +02:00
Will Browne
e855efb13d
Plugins: Move store and plugin dto to pluginsintegration (#74655)
move store and plugin dto
2023-09-11 13:59:24 +02:00
Marcus Efraimsson
8ee43f3705
Instrumentation: Add status_source label to request metrics/logs (#74114)
Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-09-11 12:13:13 +02:00
Sofia Papagiannaki
9fcee9b206
Nested folders: Fix folder hierarchy in folder responses (#74516)
Nested folders: Fix hierarchy in folder response
2023-09-08 10:43:41 +03:00
Ashley Harrison
a7425f875e
Browse Dashboards: Update docs to remove reference to General folder (#74528)
* update documentation to remove mention of General folder

* update swagger-tags
2023-09-08 03:57:16 +01:00
Kristin Laemmert
6ce4af7840
chore: remove unused feature flag (#74460)
This commit removes the validateDashboardsOnSave feature flag that is currently not in use.
Closes #70022
2023-09-06 11:25:44 -04:00
linoman
0e8f19ca6a
Auth: Reduce restriction with non-user accounts (#74397)
* Reduce restrictions with non-user accounts

* Revert restrictions on anonymous accounts

* Change log level from warning to debug

* Change log messages to upper case
2023-09-06 13:37:54 +02:00
linoman
13f4382214
Auth: Implement requester interface in access control module (#74289)
* Implement requester interface in the access control module
2023-09-06 11:16:10 +02:00
Ieva
58efa49933
Chore: remove IsDisabled method for access control (#74340)
remove IsDisabled method for access control, clean up tests
2023-09-05 11:04:39 +01:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
linoman
1b8e9b51b2
Replace signed in user for identity.requester (#74048)
* Make identity.Requester available at Context

* Clean pkg/services/guardian/guardian.go

* Clean guardian provider and guardian AC

* Clean pkg/api/team.go

* Clean ctxhandler, datasources, plugin and live

* Clean dashboards and guardian

* Implement NewUserDisplayDTOFromRequester

* Change status code numbers for http constants

* Upgrade signature of ngalert services

* log parsing errors instead of throwing error
2023-08-30 16:51:18 +02:00
Karl Persson
127473f4a4
API: Remove usage of legacy dashboard guardian in tests (#73937) 2023-08-29 15:09:09 +02:00
Jo
fe1563882a
Chore: Port oauth token service to identity requester (#73988)
* port oauth token service to identity requester

* fix broken test

* no need to check for render
2023-08-29 11:55:58 +02:00
venkatbvc
7c98678188
Auth: Add support for OIDC RP-Initiated Logout (#70357)
* Fix signout redirect_uri issue

* Fix signout redirect_uri issue

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

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

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

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

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

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

* remove signout url global

* style alignment

* remove legacy handlers for devenv

* Update pkg/api/login.go

---------

Co-authored-by: Rao B V Chalapathi <b_v_chalapathi.rao@nokia.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: jguer <me@jguer.space>
2023-08-29 11:34:11 +02:00
Jo
a307582212
Revert "Replace signed in user for identity.requester (#73750)" (#73962)
This reverts commit 9b9c9e83dc.
2023-08-28 21:05:59 +02:00
linoman
9b9c9e83dc
Replace signed in user for identity.requester (#73750)
* Make identity.Requester available at Context

* Clean pkg/services/guardian/guardian.go

* Clean guardian provider and guardian AC

* Clean pkg/api/team.go

* Clean ctxhandler, datasources, plugin and live

* Question: what to do with the UserDisplayDTO?

* Clean dashboards and guardian

* Remove identity.Requester from ReqContext

* Implement NewUserDisplayDTOFromRequester

* Fix tests

* Change status code numbers for http constants

* Upgrade signature of ngalert services

* log parsing errors instead of throwing error

* Fix tests and add logs

* linting
2023-08-28 12:04:36 -05:00
Jo
5eed495cce
Chore: Port user services to identity.Requester (#73851)
* port api key api to signedinuser

* port users to signed in user interface

* fix tests
2023-08-28 10:42:24 +02:00
Karl Persson
01d98114b9
Authz: fix snapshot tests legacy guardian (#73823)
* Guardian: remove unused dependencies

* API: rewrite tests to use access control guardian
2023-08-28 09:49:10 +02:00
Torkel Ödegaard
3ee26df41e
PublicDashboards: Variables refactor (#73476)
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-08-25 13:56:02 -05:00
Ieva
ca46a5c1af
Chore: prepare for removing RBACenabled config option (#73845)
prepare for removing RBACenabled config option
2023-08-25 17:13:46 +02:00
Ieva
6885b3d577
Chore: remove checks for whether RBAC is disabled (#73812)
* remove checks for whether access control is disabled, as it is always enabled now

* linting
2023-08-25 14:19:58 +01:00
Serge Zaitsev
00893a158c
Chore: return a JSON on folder DELETE (#73604) 2023-08-24 18:10:58 +02:00
Karl Persson
05c386504b
authz: Clean up acl endpoints and dashboard guardian (#73746)
* RBAC: remove unnessisary guardian construction and update tests

* RBAC: remove usage of guardian in UpdateFolderPermissions and refactor test

* RBAC: remove usage of guardian in update and get permissions for dashboards
2023-08-24 15:37:54 +02:00