Commit Graph

3442 Commits

Author SHA1 Message Date
Kat Yang
29113a6369
Chore: Update OpenAPI generation README to include bingo instructions (#79104)
* Chore: Update OpenAPI generation README to include bingo instructions

* chore: remove extra whitespace
2024-01-02 12:48:10 +01:00
Jo
814d62406e
User: Verify external user status for accessing certain user routes (#79909)
stricter user profile route checking
2023-12-29 14:23:05 +01:00
linoman
824e0f9ce8
Plugins: Display plugin permissions required (#78355)
* Add definition of external service registration

* Add style and tables for permissions needed

* Add external service registration to local without counterpart

* Add feature toggle check

* Add feature flag check in the backend as well

* Add the disclaimer for permissions

---------

Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
2023-12-20 16:29:13 +01:00
idafurjes
3770daabe2
Remove deprecated FolderID from api tests (#79466)
* Remove deprecated FolderID from api tests

* Removed unused const
2023-12-20 15:12:05 +01:00
Agnès Toulet
fdaf6e3f2e
PublicDashboards: Add setting to disable the feature (#78894)
* Replace feature toggle with configuration setting

* Fix permission alert

* Update documentation

* Add back feature toggle

* revert unwanted commited changes

* fix tests

* run prettier

* Update SharePublicDashboard.test.tsx

* fix linter and frontend tests

* Update api.go

* Apply docs edit from code review

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update index.md

* Update docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

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

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* add isPublicDashboardsEnabled + test

* fix test

* update ff description in registry

* move isPublicDashboardsEnabled

* revert getConfig() update

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-12-19 11:43:54 +01:00
Karl Persson
8cb351e54a
Authn: Handle logout logic in auth broker (#79635)
* AuthN: Add new client extension interface that allows for custom logout logic

* AuthN: Add tests for oauth client logout

* Call authn.Logout

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-12-19 10:17:28 +01:00
Michael Mandrus
456939bac4
Feature Toggles: Remove use of boolPtr in FeatureFlag struct (#79550)
* remove bool ptr and update docs

* fix silly thing

* merge main

* maybe this time

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-18 13:55:21 -05:00
Will Browne
0b511aaace
Plugins: Add backend check for app page role access (#78269)
* add backend check for roles

* tidy

* fix tests

* incorporate rbac

* fix linter

* apply PR feedback

* add tests

* fix logic

* add comment

* apply PR feedback
2023-12-18 16:12:46 +01:00
Ezequiel Victorero
864d91ed3e
Export: Remove no-store headers in pdf and image previews (#78844) 2023-12-18 09:21:57 -03:00
Sofia Papagiannaki
6d9c651b74
Chore: Remove redundant benchmarks (#79626) 2023-12-18 11:31:25 +02:00
Eric Leijonmarck
57ca8fa368
Anonymous: Add device limits to stats (#79494)
* add device limits

* feat: tabs the anon and session stats w. highlight
2023-12-18 09:32:57 +01:00
Sofia Papagiannaki
d89a8a3a82
Nested Folders: Fix /api/folders pagination (#79447)
* Nested Folders: Fix /api/folders pagination

We used to check access to the root folders after fetching them from the DB with pagination.
This fix splits logic for fetching folders in:
- fetching subfolders
- fetching root folders
and refactors the query for the latter so that is filters by folders with permissions

* Add tests

* Update benchmarks
2023-12-15 19:34:08 +02:00
Andres Martinez Gotor
1324186f87
Chore: Evaluate if an app is disabled for API requests (#79564) 2023-12-15 16:37:39 +01:00
Misi
ce1450d4d3
Chore: Configure SkipOrgRoleSync from OAuthInfo for OAuth connectors (#79443)
* Configure SkipOrgRoleSync from OAuthInfo

* Remove skipOrgRoleSync from socialbase and connectors

* Add test to socialimpl.ProvideService

* Deprecate AuthSettings' fields

* clean up misleading init of frontendsettings.Auth
2023-12-15 10:58:08 +01:00
Will Browne
ce8fd14f1f
Plugins: Make renderer service load renderer plugin (#77854)
* rendering service loads renderer plugin

* update naming

* tidy

* apply PR feedback

* fix missing feature manager

* fix step

* set plugin
2023-12-14 17:33:29 +01:00
Karl Persson
a7a51bf2d8
Analytics: Return empty analytic settings for users that are not signed in (#79515)
Return empty analytic settings for users that are not signed in
2023-12-14 16:17:48 +01:00
Ben Sully
315100e2e3
Plugins: Add Grafana config to app plugin context (#79439) 2023-12-13 10:28:24 +01:00
Jo
3647ba7360
Anonymous: Add configurable device limit (#79265)
* Anonymous: Add device limiter

* break auth if limit reached

* fix typo

* refactored const to make it clearer with expiration

* anon device limit for config

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2023-12-12 12:57:25 +02:00
Ieva
19ad788333
RBAC: change annotation scopes back (#79330)
Change the annotation scopes back to what they were
2023-12-12 09:51:08 +02:00
Ryan McKinley
f69516bf47
K8s: Add resource type helper to avoid so many hardcoded names (#79344) 2023-12-11 22:03:48 +02:00
Gábor Farkas
5b4da3a7dc
mssql: prepare logs-handling for decouple-datasource changes (#79214)
mssql: refactor logs-handling
2023-12-11 09:14:06 +01:00
Mihai Doarna
bff2ac3627
Auth: check that oauthProvider is not nil in Logout() func (#79271)
check that oauthProvider is not nil
2023-12-08 18:13:49 +02:00
Misi
50f4e78a39
Auth: Use SSO settings service to load social connectors + refactor (#79005)
* Refactor to prevent cyclic dependencies

* Move list authorization to the API layer

* Init connectors using the SSO settings service in case the ssoSettingsApi feature toggle is enabled

* wip, need to handle the cyclic dep

* Remove cyclic dependency

* Align tests + refactor

* Move back OAuthInfo to social

* Delete pkg/login/social/constants

* Move reloadable registration to the social providers

* Rename connectors.Error to connectors.SocialError
2023-12-08 11:20:42 +01:00
Kat Yang
31fb38723d
Chore: Remove FolderID from DTO Folder (#78420)
* Chore: Remove FolderID from DTO Folder

* chore: add OrgID field to an instance of SaveDashboardCommand

* chore: add another OrgID to pair with the FolderUID:

* chore: add OrgId to Folder struct and expectedParentOrgIDs to testCase struct, unsure if last part is necessary

* Fix folder test, add expected orgID

* chore: regen specs

---------

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2023-12-07 13:56:04 +01:00
idafurjes
550746be71
Fix capitalising Folder structs (#79207)
* Fix capitalising Folder structs

* Add swagger and fix api dashboard test

* Add swagger files with bingo installed
2023-12-07 13:15:58 +01:00
Todd Treece
2a2a132c61
K8s: Refactor metrics to share k8s registry (#79106) 2023-12-06 16:34:23 -05:00
Todd Treece
ea36336c0a
Chore: Ensure BuildVersion is set when using CDN (#79169) 2023-12-06 15:27:08 -05:00
Alexander Zobnin
959ebf82da
Folders: Show dashboards and folders with directly assigned permissions in "Shared" folder (#78465)
* Folders: Show folders user has access to at the root level

* Refactor

* Refactor

* Hide parent folders user has no access to

* Skip expensive computation if possible

* Fix tests

* Fix potential nil access

* Fix duplicated folders

* Fix linter error

* Fix querying folders if no managed permissions set

* Update benchmark

* Add special shared with me folder and fetch available non-root folders on demand

* Fix parents query

* Improve db query for folders

* Reset benchmark changes

* Fix permissions for shared with me folder

* Simplify dedup

* Add option to include shared folder permission to user's permissions

* Fix nil UID

* Remove duplicated folders from shared list

* Folders: Fix fetching empty folder

* Nested folders: Show dashboards with directly assigned permissions

* Fix slow dashboards fetch

* Refactor

* Fix cycle dependencies

* Move shared folder to models

* Fix shared folder links

* Refactor

* Use feature flag for permissions

* Use feature flag

* Review comments

* Expose shared folder UID through frontend settings

* Add frontend type for sharedWithMeFolderUID option

* Refactor: apply review suggestions

* Fix parent uid for shared folder

* Fix listing shared dashboards for users with access to all folders

* Prevent creating folder with "shared" UID

* Add tests for shared folders

* Add test for shared dashboards

* Fix linter

* Add metrics for shared with me folder

* Add metrics for shared with me dashboards

* Fix tests

* Tests: add metrics as a dependency

* Fix access control metadata for shared with me folder

* Use constant for shared with me

* Optimize parent folders access check, fetch all folders in one query.

* Use labels for metrics
2023-12-05 16:13:31 +01:00
Dan Cech
647f576359
Server: Automatically generate a self-signed TLS cert if needed (#78243)
generate a self-signed cert when running in https or http2 mode without a provided cert
2023-12-05 10:04:39 -05:00
Todd Treece
7e2aad1d01
Revert "K8s: Refactor metrics to share k8s registry (#77957)" (#79079)
This reverts commit 38bc41651a.
2023-12-05 09:34:07 -05:00
Alexander Zobnin
043096d652
Team LBAC: Limit access to data source (#78376)
* Team LBAC: Limit access to data source

* Fix tests
2023-12-05 13:45:40 +02:00
Torkel Ödegaard
ed128ea964
Frontend: Foundations for multi tenant frontend (#78815)
* Frontend: Foundations for multi tenant frontend

* improve manifest parsing for multi-tenant frontend (#78876)

* add test

* add test

* ??

* Updates

* Added cache

* test cleanup

* lint

* fix test

* fix error templates

* cleanup

* remove copy

* revert changes to list testdata

* comment cleanup

* prepare integration tests

* Remove integrety

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-05 08:34:22 +01:00
Todd Treece
38bc41651a
K8s: Refactor metrics to share k8s registry (#77957)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-04 10:54:59 -08:00
Gabriel MABILLE
5b70130e6c
Plugins: Rename externalServiceAuthentication to iam (#78686)
Plugins: Rename externalServiceAuthentication to iam
2023-12-04 13:14:21 +01:00
Sofia Papagiannaki
6d4625ad52
Alerting: Fix deleting rules in a folder with matching UID in another organization (#78258)
* Remove usage of obsolete function for deleting alert rules under folder

* Apply suggestion from code review

* Update tests
2023-12-04 11:34:38 +02:00
Ieva
c354c7bfff
RBAC: Update fixed annotation roles (#78756)
* update fixed annotation roles if FlagAnnotationPermissionUpdate is enabled

* add dashboard type scope back in the fixed roles to make the migration easier
2023-12-01 14:50:55 +00:00
Gabriel MABILLE
ef2c79d22a
Chore: use errutil for pluginRepo errors (#78647)
* Chore: use errutil for pluginRepo errors

* Update pkg/util/errutil/status.go

* Use errutil helper functions

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Forgot the log level

* Use entity

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-11-30 15:49:27 +01:00
Eric Leijonmarck
59bdff0280
Auth: Add anonymous users view and stats (#78685)
* Add anonymous stats and user table

- anonymous users users page
- add feature toggle `anonymousAccess`
- remove check for enterprise for `Device-Id` header in request
- add anonusers/device count to stats

* promise all, review comments

* make use of promise all settled

* refactoring: devices instead of users

* review comments, moved countdevices to httpserver

* fakeAnonService for tests and generate openapi spec

* do not commit openapi3 and api-merged

* add openapi

* Apply suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* formatin

* precise anon devices to avoid confusion

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: jguer <me@jguer.space>
2023-11-29 17:58:41 +01:00
venkatbvc
e152323a33
Auth: Split signout_redirect_url into per provider settings (#75269)
* Split signout_redirect_url into per provider settings

* Split signout_redirect_url into per provider settings

* Update docs/sources/setup-grafana/configure-security/configure-authentication/grafana/index.md

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

* Split signout_redirect_url into per provider settings

* Split signout_redirect_url into per provider settings

* Split signout_redirect_url into per provider settings

* Split signout_redirect_url into per provider settings

* Split signout_redirect_url into per provider settings

* Split signout_redirect_url into per provider settings

* update docs

* update devenvs

* add missing struct tag

---------

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-11-29 14:50:21 +01:00
Ieva
d201d3f7db
RBAC: correctly fetch nested folder metadata (#78655)
fix a bug with nested folder metadata
2023-11-28 09:28:47 +00:00
Todd Treece
529271d7a8
Perf: Disable core kind registry (#78568)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-11-28 09:09:54 +01:00
Gabriel MABILLE
24a6ee4a91
Plugins: Check installer's permissions include plugins' permissions (#78211)
* Check installer perm

* Failed eval better output

* Switch fetching json data in the repo

* Comment

* Account for feedback

* Mv single_organization config option

* Inline error check

* Starting to replace errors not to have to do the management in two places

* Continue error translation

* Cover ErrChecksumMismatch

* Refactor a bit

* Lint. Tab

* log instead of erroring out

* Nit.

* Revert change on kinds

* revert file again

* Fix tests

* Match core plugin error status code

* Skip permission check for Grafana Admin

* Use errutil templates

* Use errutil templating

* Inline

* Test templating

* revert error changes

* Remove isGrafanaAdmin skip

* Feature toggle check

* Small refactor on hasPluginRequestedPermissions

* Add test

* Imports

* Post install check

* change log messages so that they make sense

* Cover no scope case

* Inline

* Nit.

* Fix test
2023-11-24 16:02:44 +01:00
Jo
7d559bc69a
AuthProxy: Do not allow sessions to be assigned with other methods (#78602)
do not allow login token with other methods
2023-11-24 11:00:53 +01:00
Misi
7128415529
Auth: Add more context to logs around token rotation, revocation (#78600)
Add more context to logs around token rotation, revocation

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-11-23 16:48:54 +01:00
Ieva
778841cabe
Annotations: Remove dashboard permission checks for annotations (#78352)
remove checks for access to dashboard if FlagAnnotationPermissionUpdate is enabled
2023-11-23 10:47:37 +00:00
Jo
0de66a8099
Authz: Remove use of SignedInUser copy for permission evaluation (#78448)
* remove use of SignedInUserCopies

* add extra safety to not cross assign permissions

unwind circular dependency

dashboardacl->dashboardaccess

fix missing import

* correctly set teams for permissions

* fix missing inits

* nit: check err

* exit early for api keys
2023-11-22 14:20:22 +01:00
Juan Cabanas
9c5daed336
PublicDashboards: Middleware creation (#77941) 2023-11-21 17:56:36 -03:00
Gabriel MABILLE
b6b86bb0b3
RBAC: Check plugins:install globally (#78438)
* RBAC: Check plugins:install globally

* Add disclamer to the RBACSingleOrganization config option
2023-11-21 15:09:43 +01:00
Karl Persson
1eb19befaa
Login: refactor auth info package (#78459)
* Remove unused stats and metrics

* No longer collect metrics

* Remove unused dependency

* Move database from sub package
2023-11-21 14:47:23 +01:00
Karl Persson
d42201dbf4
Login: remove unused function (#78442)
* Move test to the db so we test the queries and not just testing the mock

* Remove unused function and dependencies

* Remove unused functions from the database

* Add some integration tests
2023-11-21 11:44:13 +01:00