Commit Graph

3329 Commits

Author SHA1 Message Date
Ieva
a65cb4d808
RBAC: remove simple RBAC disabled checks (#71137)
* remove simple RBAC disabled checks

* fixing tests

* remove old AC tests
2023-07-10 15:14:21 +03:00
Sofia Papagiannaki
e82d437e0e
Drone: Enable running go benchmarks on demand (#70359)
* Add benchmark

* Run pkg/api benchmarks in CI

* Conditionally run benchmarks for provided go packages

* Bypass fork check for promotes
2023-07-07 11:55:01 +03:00
Alex Khomenko
420b19e0e4
Dashboards: Add dashboard embed route (#69596)
* Dashboard embed: Set up route

* Dashboard embed: Cleanup

* Dashboard embed: Separate routes

* Dashboard embed: Render dashboard page

* Dashboard embed: Add toolbar

* Dashboard embed: Send JSON on save

* Dashboard embed: Add JSON param

* Dashboard embed: Make the dashboard editable

* Fix sending dashboard to remote server

* Add notifications

* Add "dashboardEmbed" feature toggle

* Use the toggle

* Update toggles

* Add toggle on backend

* Add get JSON endpoint

* Add drawer

* Close drawer on success

* Update toggles

* Cleanup

* Update toggle

* Allow embedding for the d-embed url

* Allow embedding via custom X-Allow-Embedding header

* Use callbackUrl

* Cleanup

* Update public/app/features/dashboard/containers/EmbeddedDashboardPage.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Use theme for spacing

* Update toggles

* Update public/app/features/dashboard/components/EmbeddedDashboard/SaveDashboardForm.tsx

Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>

* Add select data source modal

---------

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>
2023-07-06 17:43:20 +03:00
Esteban Beltran
d618bc46d1
Plugins: Add config option to exclude specific plugins from frontend sandbox (#70899) 2023-07-05 11:16:56 +02:00
Andres Martinez Gotor
4ff0abd0d1
SaveExternalService (OAuth) on plugin load (#69764) 2023-06-26 16:38:43 +02:00
Giuseppe Guerra
cca9d89733
Plugins: Angular detector: Remote patterns fetching (#69843)
* Plugins: Angular detector: Remote patterns fetching

* Renamed PatternType to GCOMPatternType

* Renamed files

* Renamed more files

* Moved files again

* Add type checks, unexport GCOM structs

* Cache failures, update log messages, fix GCOM URL

* Fail silently for unknown pattern types, update docstrings

* Fix tests

* Rename gcomPattern.Value to gcomPattern.Pattern

* Refactoring

* Add FlagPluginsRemoteAngularDetectionPatterns feature flag

* Fix tests

* Re-generate feature flags

* Add TestProvideInspector, renamed TestDefaultStaticDetectorsInspector

* Add TestProvideInspector

* Add TestContainsBytesDetector and TestRegexDetector

* Renamed getter to provider

* More tests

* TestStaticDetectorsProvider, TestSequenceDetectorsProvider

* GCOM tests

* Lint

* Made detector.detect unexported, updated docstrings

* Allow changing grafana.com URL

* Fix API path, add more logs

* Update tryUpdateRemoteDetectors docstring

* Use angulardetector http client

* Return false, nil if module.js does not exist

* Chore: Split angualrdetector into angularinspector and angulardetector packages

Moved files around, changed references and fixed tests:
- Split the old angulardetector package into angular/angulardetector and angular/angularinspector
- angulardetector provides the detection structs/interfaces (Detector, DetectorsProvider...)
- angularinspector provides the actual angular detection service used directly in pluginsintegration
- Exported most of the stuff that was private and now put into angulardetector, as it is not required by angularinspector

* Renamed detector.go -> angulardetector.go and inspector.go -> angularinspector.go

Forgot to rename those two files to match the package's names

* Renamed angularinspector.ProvideInspector to angularinspector.ProvideService

* Renamed "harcoded" to "static" and "remote" to "dynamic"

from PR review, matches the same naming schema used for signing keys fetching

* Fix merge conflict on updated angular patterns

* Removed GCOM cache

* Renamed Detect to DetectAngular and Detector to AngularDetector

* Fix call to NewGCOMDetectorsProvider in newDynamicInspector

* Removed unused test function newError500GCOMScenario

* Added angularinspector service definition in pluginsintegration

* Moved dynamic inspector into pluginsintegration

* Move gcom angulardetectorsprovider into pluginsintegration

* Log errUnknownPatternType at debug level

* re-generate feature flags

* fix error log
2023-06-26 15:33:21 +02:00
Jo
4821175d40
Auth: Add auth.azure_ad security improvements (#912)
* security improvements id_token

* add audience validation

* add allowOrganizations

* add allowOrganizations tests and documentation

* add log warn on no configuration

* anonymize tenant id

* Apply suggestions from code review

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

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

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Update pkg/login/social/azuread_oauth_test.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Update pkg/login/social/azuread_oauth_test.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* optimize key validation and add mising fields

* fix missing key_id

* lint

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

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* lint docs

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-06-23 09:13:38 +02:00
Jo
b8a336c9d7
Auth: Remove Email Lookup from oauth integrations (#894)
Remove email lookup from oauth integrations

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
2023-06-23 09:08:02 +02:00
Andreas Deininger
95b1f3c875
Fixing typos (#70487) 2023-06-22 09:43:38 +01:00
Michael Mandrus
66d2214c3b
Config: Add configuration option to define custom user-facing general error message for certain error types (#70023)
---------

Co-authored-by: Summer Wollin <summer.wollin@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
2023-06-16 10:46:47 -05:00
Alexander Zobnin
6c7d5bf95f
Authn UI: Remove feature toggle (#70073)
* Authn UI: Remove feature toggle

* remove feature flag usage
2023-06-14 19:58:15 +03:00
Jo
914daef0fd
Auth: Add request context to UserInfo calls (#70007)
* use context for UserInfo requests

* set timeouts for oauth http client

* Update pkg/login/social/common.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-06-14 14:30:40 +02:00
Will Browne
91b0cdc871
Plugins: Account for nil user when constructing plugin context (#69811)
cater for nil user
2023-06-08 19:36:41 +03:00
Will Browne
624777258b
Plugins: Refactor creation of plugin context to dedicated service (#66451)
* first pass

* fix tests

* return errs

* change signature

* tidy

* delete unnecessary fields from test

* tidy

* fix tests

* simplify

* separate error check in API

* apply nits
2023-06-08 13:59:51 +02:00
Will Browne
a221e1d226
Plugins: Standardize Golang enum naming convention (#69449)
* standardize enum pattern

* fix up
2023-06-08 12:21:19 +02:00
Giuseppe Guerra
f148b5fb28
Plugins: Forbid loading Angular plugins when Angular is disabled (#69679)
* Plugins: Forbid loading Angular plugins when Angular is disabled

* Plugins: Made angulardetector a service, add tests for angular loader cases

* Fix missing import

* Add nolint:gocyclo to loadPlugins
2023-06-07 11:08:01 +02:00
Jo
aee5c6dea0
Auth: Use auth broker by default (#69620)
remove authnservice toggle
2023-06-07 08:57:41 +02:00
Jev Forsberg
c0a1fc2cbd
SQL Datasources: Reinstate SQL data source behavior around database selection when default configured databases already exist (#65659)
* badlm0mma/sql_datasource_update/ initial notes

* baldm0mma/sql_datasource_update/ solution

* baldm0mma/sql_datasource_update/ clean datasetSelector

* baldm0mma/sql_datasource_update/ clean up queryEditor.tsx

* baldm0mma/sql_datasource_update/ clewan up queryHeader.tsx

* baldm0mma/sql_datasource_update/ clean up tableSelector.tsx

* baldm0mma/sql_datasource_update/ clean up mysqlDatasource.ts

* baldm0mma/sql_datasource_update/ clean up configurationEditor.tsx

* baldm0mma/sql_datasource_update/ rem conlog from queryEditor.tsx

* baldm0mma/sql_datasource_update/ rem conlog from queryEditor.tsx

* baldm0mma/sql_datasource_update/ remove conlog in tableSelector.tsx

* baldm0mma/sql_datasource_update/ rem conlog in sqlDatasource.ts

* baldm0mma/sql_datasource_update/ update deafult database value in sqlDatasource.ts

* baldm0mma/sql_datasource_update/ update logic to accomidate no preconfig

* baldm0mma/sql_datasource_update/ update props

* baldm0mma/sql_datasource_update/ update prop names

* baldm0mma/sql_datasource_update/ update prop names in tableSelector

* baldm0mma/sql_datasource_update/ update annos in datasetSelector

* baldm0mma/sql_datasource_update/ update naming

* baldm0mma/sql_datasource_update/ update to standard langauae

* baldm0mma/sql_datasource_update/ update prop names

* baldm0mma/sql_datasource_update/ update annos in datasetSelector

* baldm0mma/sql_datasource_update/ remove unused import in tableSelector.tsx

* baldm0mma/sql_datasource_update/ remove addDefaultdataset

* baldm0mma/sql_datasource_update/ reset query when needed

* baldm0mma/sql_datasource_update/ update asymc return val

* baldm0mma/sql_datasource_update/ remove psql query editor

* baldm0mma/sql_datasource_update/ remove con logs in defaults.ts

* baldm0mma/sql_datasource_update/ revert postgres changes

* baldm0mma/sql_datasource_update/ update postgres naming

* baldm0mma/sql_datasource_update/ add altert

* baldm0mma/sql_datasource_update/ update annos and add alerts and alert logic

* baldm0mma/sql_datasource_update/ update postgres nomenclature

* baldm0mma/sql_datasource_update/ update annos and remove con logs

* baldm0mma/sql_datasource_update/ update nomenclature

* baldm0mma/sql_datasource_update/ drone fix

* baldm0mma/sql_datasource_update/ export and format

* baldm0mma/sql_datasource_update/ update docs for mysql datasource with dataset dropdown disable info

* baldm0mma/sql_datasource_update/ update mssql docs

* baldm0mma/sql_datasource_update/ update postgres docs and alert logic

* baldm0mma/sql_datasource_update/ add tests

* baldm0mma/sql_datasource_update/ update docs

* baldm0mma/sql_datasource_update/ update test names

* baldm0mma/sql_datasource_update/ update alert language

* baldm0mma/sql_datasource_update/ correct spelling

* baldm0mma/sql_datasource_update/ update postgres query builder image

* baldm0mma/sql_datasource_update/ update annos

* baldm0mma/sql_datasource_update/ update tests

* baldm0mma/sql_datasource_update/ docs updated

* baldm0mma/sql_datsource_update/ refactor determinePlaceholder

* Update public/app/features/plugins/sql/components/QueryEditor.tsx

spelling

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update public/app/features/plugins/sql/components/QueryEditor.tsx

spelling

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* baldm0mma/sql_datasource_update/ remove superfluous cleanup data from tests

* baldm0mma/sql_datasource_update/ update spelling

* Update public/app/features/plugins/sql/components/SqlComponents.test.tsx

spelling

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* baldm0mma/sql_datasource_update/ add logic to prevent db call for tables if dataset it nullish

* baldm0mma/sql_datasource_update/ update alert tests

* baldm0mma/sql_datasource_update/ update button text

* baldm0mma/sql_datasource_update/ update tests to preferred standard

* baldm0mma/sql_datasource_update/add feature flag

* baldm0mma/sql_datasource_update/ update mssql docs

* baldm0mma/sql_datasource_update/ add feature flag to registry

* baldm0mma/sql_datasource_update/ adjust table and dataset dropdown logic

* baldm0mma/sql_datasource_update/ update testing to deal with feature flag

* baldm0mma/sql_datasource_update/ update wioth cascadeDisable

* baldm0mma/sql_datasource_update/ update naming

* baldm0mma/sql_datasource_update/ update tests to reflect enabled feature flag

* baldm0mma/sql_datasource_update/ update annotations

* baldm0mma/sql_datasource_update/ update annos in queryEd

* baldm0mma/sql_datasource_update/ update test names

* baldm0mma/sql_datasource_update/ update anno issues

* baldm0mma/slq_datasource_update/ add query to sqlDatasource with error

* baldm0mma/sql_datasource_update/ update docs language

* baldm0mma/sql_datasource_update/ remove notes to self

* baldm0mma/sql_datasource_update/ add QueryEditorFeatureFlag.utils.ts

* baldm0mma/sql_datasource_update/ update database into json

* baldm0mma/sql_datasource_update/ found file

* Update docs/sources/datasources/mssql/query-editor/index.md

Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>

* baldm0mma/sql_datasource_update/ update feature flag and toggles

* baldm0mma/sql_datasource_update/ add hasConfigIssue, update annos, rethink disable logic

* baldm0mma/sql_datasource_update/ update warning language

* baldm0mma/sql_datasource_update/ update button content

* baldm0mma/sql_datasource_update/ update jsonData logic in frontendsettings.go

* baldm0mma/sql_datasource_update/ update jsonData logic

* baldm0mma/sql_datasource_update/ update annos in frontendsettings.go

* baldm0mma/sql_datasource_update/ update sql editor docs

* baldm0mma/sql_datasource_update/ update mysql docs

* baldm0mma/sql_datasource_update/ update postgres docs

* baldm0mma/sql_datasource_update/ remove unused code in datasetSelector.tsx

* baldm0mma/sql_datasource_update/ update syntax conventions

* baldm0mma/sql_datasource_update/ add logs

* baldm0mma/sql_datasource_update/ remove unused code

* baldm0mma/sql_datasource_update/ remove conlogs

* baldm0mma/sql_datasource_update/ update tests

* baldm0mma/sql_datasource_update/ add second error to query

* baldm0mma/sql_datasource_update/ run make gen-cue

* baldm0mma/sql_database_update/ lint registry

* baldm0mma/sql_datasource_update/ update registry

* baldm0mma/sql_datasource_update/ upate datasource logic

* baldm0mma/sql_datasource_update/ add logs

* baldm0mma/sql_datasource_update/ add comms to self

* baldm0mma/sql_datasource_update/ comment out false pos tests, and add investigatory comments

* baldm0mma/sql_database_update/ update query error to only test for config change if query was made in "builder" mode

* baldm0mma/sql_datasource_update/ update annos in frontendsettings.go

* baldm0mma/sql_datasource_update/ update error logic to datasource

* baldm0mma/sql_datasource_update/ remove alerts from query editor

* baldm0mma/sql_datasource_update/ remove unused imports

* baldm0mma/sql_datasource_update/ update tests

* baldm0mma/sql_datasource_update/ remove comments

* baldm0mma/sql_datasource_update/ remove logs in queryGroup.tsx

* baldm0mma/sql_datasource_update/ remove outdated annotation in datasetSelector.tsx

* baldm0mma/sql_datasource_update/ remove superfluous test and update test description

* baldm0mma/sql_datasource_update/ remove feature flag

* baldm0mma/sql_datasource_update/ add back feature flag

* baldm0mma/sql_datasource_update/ update to enums

* baldm0mma/sql_datasource_update/ update panel caps

* baldm0mma/sql_datasource_update/ update dataset selector to default update the database correctly

* baldm0mma/sql_datasource_update/ move onChange into conditional

* baldm0mma/sql_datasource_update/ add logic for previous datasets choice

* baldm0mma/sql_datasource_update/ add back previous logic for assigning default datasets

* baldm0mma/sql_datasource_update/ update useEffect dep array

* baldm0mma/sql_datasource_update/ remove feature toggle

* baldm0mma/sql_datasource_update/ add feature toggle

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
2023-06-06 10:28:52 -06:00
Giuseppe Guerra
7a132680ef
Revert "Plugins: Forbid loading Angular plugins when Angular is disabled (#69225)" (#69657)
This reverts commit ff34279ff4.
2023-06-06 18:09:41 +02:00
Giuseppe Guerra
ff34279ff4
Plugins: Forbid loading Angular plugins when Angular is disabled (#69225)
* Plugins: Forbid loading Angular plugins when Angular is disabled

* Plugins: Made angulardetector a service, add tests for angular loader cases

* Fix missing import
2023-06-06 17:14:31 +02:00
Marcus Efraimsson
dcc1169ab2
Chore: Remove unused code/dependencies in testdata datasource (#69386) 2023-06-05 11:34:02 +02:00
Esteban Beltran
1ed4c0382b
Plugins: Add Initial implementation for frontend plugins sandboxing (#68889) 2023-06-05 10:51:36 +02:00
Ryan McKinley
422684d8b0
Plugins: Support changing plugin IDs (hardcoded) (#67867) 2023-06-02 10:46:12 -07:00
Ashley Harrison
5a98348faf
Chore: remove i18n toggle (#69389)
* remove i18n toggle

* remove beta badge on language picker

* remove toggle from go code

* Revert "remove beta badge on language picker"

This reverts commit 3b76300aa7.
2023-06-02 09:24:40 +01:00
Stephanie Hingtgen
29a4e3d7da
Secure socks proxy: allow for UI to be disabled (#69408) 2023-06-01 12:58:51 -06:00
Ashley Harrison
778963849e
News: Expose config option to disable News feed (#69365)
* customize news feed

* remove url customisation
2023-06-01 13:35:05 +01:00
Ieva
d8b66d5c4b
RBAC: remove some IsDisabled checks (#69272)
* remove some access contorl IsDisabled() checks

* cleaning up tests

* update tests

* linting
2023-05-31 09:58:57 +01:00
Ieva
d98813796c
RBAC: Remove legacy AC from HasAccess permission check (#68995)
* remove unused HasAdmin and HasEdit permission methods

* remove legacy AC from HasAccess method

* remove unused function

* update alerting tests to work with RBAC
2023-05-30 14:39:09 +01:00
Will Browne
12dc56ad0c
Plugins: Refactor plugin repository API (#69063)
* support grafana wildcard version

* undo go.mod changes

* tidy

* flesh out tests

* refactor

* add tests

* tidy naming

* undo some changes

* split interfaces

* separation

* update new signature

* simplify

* update var namings

* unexport types

* introduce opts pattern

* reorder test

* fix compat checks

* middle ground

* unexport client

* move back

* fix tests

* inline logger

* make client usable

* use fake logger

* tidy errors

* remove unused types

* fix test

* review fixes

* rework compatibility

* adjust installer

* fix tests

* opts => cfg

* remove unused var

* fix var name
2023-05-30 11:48:52 +02:00
Gilles De Mey
73681a251e
Alerting: Add support for Alert State History Loki primary (#69065)
add support for multiple ash targets with loki as primary
2023-05-25 16:09:44 +03:00
Misi
df4db412cb
Auth: Fix visibility of the Invite button on /admin/users page (#68991)
* Fix for invite button visibility

* Align test
2023-05-25 13:58:41 +02:00
Ieva
9439649a4c
RBAC: remove unused dash and folder permission logic (#68968)
remove unused HasAdmin and HasEdit permission methods
2023-05-24 15:33:35 +01:00
Ieva
4980b64274
RBAC: Remove legacy ac from authorization middleware (#68898)
remove legacy AC fallback from RBAC middleware, and some unused auth logic
2023-05-24 09:49:42 +01:00
Ieva
900348f3d9
Chore: remove tests for legacy AC, update other tests to work with RBAC (#68895)
* remove tests for legacy AC, update other tests to work with RBAC

* update usage stat tests to use RBAC
2023-05-23 15:29:20 +01:00
Ieva
d54fa569ec
Chore: Remove legacy AC checks from team (#68715)
* removing legacy AC checks from team API handlers

* Chore: remove `UserIDFilter` from team queries (#68820)

* remove userIDfilter from team queries in favour of RBAC SQL filtering

* fix typo

* remove redundant tests

* remove another unused function

* fix failing test
2023-05-22 18:41:53 +02:00
Victor Marin
6dbadf614b
Datagrid: Hide from panel list if toggle disabled (#68482)
Hide datagrid from panel list if ff disabled
2023-05-22 15:34:41 +03:00
Eric Leijonmarck
6a2bcba078
Revert: Allow editors to access GET /datasources (#68632)
Revert "Allow editors to access GET /datasources"

This reverts commit 5a830c43c0.
2023-05-17 18:24:18 +01:00
Torkel Ödegaard
3ffbd2a1db
Preferences: Fixing preference PUT validation (#68557) 2023-05-16 19:38:51 +02:00
Sergey Kostrukov
eafba8fa69
Azure: Configuration for user identity authentication in datasources (Experimental) (#50277)
* Configuration for user identity authentication

* Use token endpoint form Azure AD settings

* Documentation update

* Update Grafana Azure SDK

* Fix secret override

* Fix lint

* Fix doc wording
2023-05-15 18:00:54 +01:00
Jo
5ec0f82baa
Separate authn flow from analytics (#68327)
* separate authn flow from analytics

* lint fix
2023-05-15 18:38:54 +02:00
Giuseppe Guerra
16359c82a2
Plugins: Angular deprecation: Detect Angular plugins and expose in API (#66824)
* Plugins: Angular deprecation: Detect Angular plugins and expose in API

* Plugins: Angular detector: Close module.js

* Plugins: Angular detector: consistent error messages

* Plugins: Angular detector: Add test for missing module.js

* Plugins: Angular detector: Fix integration tests

* Plugins: Angular detector: Changed Angular detection patterns

* Moved inMemoryFS to test_utils.go

* Add different angular detectors

* Plugins: Update plugins/data/expectedListResp.json

* Plugins: Rename angular property to angularDetected

* Plugins: Rename angular to angularDetected in Plugin and PluginDTO

* Plugins: Add angularDetected to datasources, apps and plugins frontendsettings

* Plugins: Add test for AngularDetected frontend settings
2023-05-12 12:51:11 +02:00
Torkel Ödegaard
f8cf67347f
Themes: Adds support for extraThemes (behind feature toggle) (#67981)
* Foundations to support more themes

* Fixes

* add another test theme

* Refactorings

* more refactoring

* Update

* Fixing tests

* Fix

* Update
2023-05-10 15:37:04 +02:00
venkatbvc
b9e53f628f
HTTP: Add TLS version configurability for Grafana server (#67482)
Co-authored-by: Rao B V Chalapathi <b_v_chalapathi.rao@nokia.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-05-08 17:11:36 +02:00
Eric Leijonmarck
a3b10b2c8d
RBAC: remove rbac disabled from preferences tests (#67712)
remove rbac disabled from preferences tests
2023-05-03 12:02:48 +01:00
mikkancso
76284ed3a6
Connections: Rename "Your data source" to "Data source" page (#67662)
rename "Your data source" to "Data source" page

This page was meant to be named "Data source" in the previous PR [0].
I just made a mistake by naming it wrongly.

[0]: https://github.com/grafana/grafana/pull/66813/files
2023-05-03 09:39:13 +02:00
Josh Hunt
c4a31390ef
NestedFolders: Use new Browse Dashboards UI behind feature flag (#67416)
NestedFolders: Put feature flagged new Browse Dashboards UI at main route
2023-05-02 17:25:03 +01:00
Domas
15d4169813
Frontend logging: Remove Sentry javascript agent support (#67493)
* remove Sentry

* fix sourcemap resolve
2023-05-02 12:10:56 +03:00
Torkel Ödegaard
9614dc2446
Connections: Simplify connections nav (#66813)
* Connections: Simplify connections nav

* rename Connections pages everywhere

---------

Co-authored-by: Miklós Tolnai <miklos.tolnai@grafana.com>
2023-05-02 10:51:59 +02:00
Marcus Efraimsson
4cbda914bd
Plugins: Refactor call resource API handling (#67234)
Moving call resource API stream handling within plugin management as a utility/wrapper. 

Closes #66889

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2023-04-28 14:02:27 +02:00
Ieva
533f8caafd
SAML: change the config option for making SAML UI accessible to org Admins (#67399)
* change from role grant overrides to SAML UI specific config option

* update permissions needed to access SAML UI

* PR feedback: change config name, change required perms to write, add a comment
2023-04-28 11:48:26 +01:00
Kyle Cunningham
1fbac96bd4
SQL Datasources: Update behavior of default connection limits (#66687)
* Update behavior of defaults in connection limits

* Refactor to use config object instead

* Refactor remove unneeded function

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2023-04-28 13:23:08 +07:00
Ryan McKinley
ca1f79b9ba
Kindsys: Target k8s style resource definitions (#67008)
Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-04-27 23:32:38 +03:00
Kristian Bremberg
35407142d0
Feature: Trusted Types support (#64975)
* Draft: Feature: Trusted Types support

* remove trusted-types package

* Create policy before jQuery and Angular is loaded and add feature flag

* Add trustedTypePolicies

* Sanitize scriptURL

* Add TT meta tag for test env

* Move trusted types into core

* Add DOMParser support for TrustedHTML

* Seperate RSS sanitization and add better TrustedHTML support

* Get test CSP header from config

* Remove dompurify dep from core

* Add documentation for trusted types

* Apply suggestions from code review

Co-authored-by: Kristian Bremberg <114284895+KristianGrafana@users.noreply.github.com>

* Add comment about Github discussion thread and things breaking

* Remove changes from News panel

* Remove TT feature toggle

* Expose TT and CSPReportOnly to frontend

* Log errors in console when CSP report only is enabled

* Log error for reporting and remove test mode

* Only insert CSP header in HTML for dev env

* Update docs

---------

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2023-04-27 18:20:37 +02:00
Andres Martinez Gotor
aa9838bd25
Chore: Refactor manifest verifier (#67218) 2023-04-27 17:54:28 +02:00
Arati R
a5206a1cda
Nested folders: Provide count of all descendant dashboards and folders (#67184)
* Add a method for getting descendant folders
* Include dashboard count for descendant folders
* Return subfolder count
* Replace references to children with descendants
* Update openapi specs
* Add test for descendant counts
* Add logging to GetDescendantCounts
2023-04-27 17:00:09 +02:00
Sofia Papagiannaki
893bf08dcf
Nested folders: Fix API response ordering when fetching subfolders (#67258)
* Nested folders: Fix ordering when getting subfolders

* Update endpoint swagger description

* Modify test
2023-04-27 17:24:47 +03:00
Giuseppe Guerra
bfe1b68800
Plugins: Fs: Add option to access unallowed files in dev mode (#66492)
* Plugins: Fs: Add option to access unallowed files in dev mode

* Plugins: Fs: allow accessing unallowed files only when in dev mode

* Plugins: Fs: Add ProvideLocalFinder

* Plugins: FS: Pass whole config in NewLocalFinder()

* Plugins: FS: Add AllowListLocalFS

* Plugins: FS: Fix some tests

* Plugins: FS: Update tests

* Plugins: FS: Removed dead code

* Plugins: FS: Add tests for AllowListFS

* Plugins: FS: Update comments

* Plugins: FS: Use variadic arguments for allow list rather than map

* Plugins: FS: Remove unnecessary log

* Plugins: FS: Do not escape plugin root dir

* Fix merge conflict

* Plugins: FS: Update comments

* Plugins: FS: PR review changes

* Fix merge conflict

* Fix tests

* Cleanup

* Fix flaky test

* Changes from PR review

* Lint

* Add comment to LocalFS.Remove

* Fix Windows

* Renamed devMode to production
2023-04-27 10:26:15 +02:00
Marcus Efraimsson
73920b1e34
Plugins: Refactor cleaning of call resource response headers (#67145)
First part of #66889 moving cleaning of call resource response headers 
within plugin management client.
2023-04-25 19:44:32 +02:00
Misi
b3aaf544a6
Auth: Add authentication config frontend routes to api.go (#66931)
* Add auth config frontend routes to api.go

* Remove SAML related endpoints

* Fix routes

* Enable authconfig for Enterprise, Cloud Pro and Advanced

* Fix

* Update public/app/routes/routes.tsx

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

---------

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2023-04-25 13:13:55 +02:00
Andres Martinez Gotor
9d7c3a101d
Chore: Use KVStore for the manifest public key (#66839) 2023-04-25 13:01:49 +02:00
Sofia Papagiannaki
7dbcd5ecd0
NestedFolders: Return full folder hierarchy in Folder response (#66835)
* Delete redundant struct

* Include parent folders in DTO

* Add test

* Update swagger
2023-04-25 11:22:20 +03:00
Sofia Papagiannaki
3bc002cd27
API: Add add deprecation notice for getting folder by sequential ID (#67091)
* API: Add deprecation notice

* Update Swagger/openAPI
2023-04-25 10:33:47 +03:00
Arati R
fd434cab58
NestedFolders: Add API endpoint for descendant count in a folder (#66550)
* Add CountInFolder to RegistryService interface
* Add folder children counts api route
* Update fake GetFolderChildrenCounts
* Add test for getting folder children counts
* Add validation to folder children counts handler
* Update openapi specs
* Update pkg/services/folder/folderimpl/folder.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-04-24 15:57:28 +02:00
Torkel Ödegaard
57701fd2f2
ServeFromSubPath: Redirect to URL with subpath when subpath missing (#66724)
* ServeFromSubPath: Redirect to URL with subpath when subpath missing

* Review fixes

* Added tests

* Use constant

* change to useMiddleware

* Update pkg/middleware/subpath_redirect.go

---------

Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com>
2023-04-24 09:55:55 +02:00
Konrad Lalik
91704cf7de
Alerting: Loki-based alert state history modal (#66595)
* adds alertstatehistory backend config to grafanaBootData

* add alertStateHistory api

* show different ASH modal when using loki implementation

* group log lines by instance (unique set of labels)
Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com>

* render log lines for each instance
Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com>

* Add visual improvements to the log record of state changes

* Add values to log records

* compute common labels and show unique labels

* Add state changes visualization

* fix common labels extraction

* Code cleanup

* Add timespan-based log record view

* WIP

* scroll to timestamp - poc

* Use SortedVector for timestamp field

* add conditional accessor for frames

* update some of the log formats and styles

* Timestamp-based visualization with scrolling

* minor improvements

* Split Loki's state history viewer into multiple files

* Add memoization to prevent graph rerender on filter updates

* make chart size shrink when fewer instances

* style updates

* show warning when instances are hidden

* Add basic label-based filtering

* Improve label-based filtering

* Add regex validation

* Improve no instances message when everything was filtered out

* Update warning message

* Move timeline viewer to a separate file, refactor handling timeline pointer changes

* Remove unused component, add comments

* Fix test snapshot, fix type error

* adds tests for common.ts

* Add tests for converting log records into data frames

* Add basic component test, fix type guards

* Use a constant for timeseries limit

* Improve a11y, update component test

* Memoize AlertStateTag, migrate from deprecated ArrayVector

* Update public/app/features/alerting/unified/components/rules/state-history/common.ts

* Move helper hook into a separate file. Add Search input component

* Change the limit of visible time series on the timeline

* Add LogRecordViewer perf improvements, refactor timeline cursor events tracking

* Use callback to pass timeline refs

* Add grouping tests for the log record viewer

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-04-24 09:28:11 +02:00
Michael Mandrus
a29cfe5d46
Caching: Consolidate resource cache checking and updating in plugin middleware (#67002)
* Update the HandleResourceRequest function to mimic the HandleQueryRequest function

* Remove CacheResourceResponse function from interface

* revert additional thing I missed
2023-04-21 13:03:49 -04:00
Ieva
5d7433d820
RBAC: Make access control metadata for folders work with nested folders (#66464)
* remove metadata for single folder listing

* extendTests

* remove ac metadata from dash and folder search results

* remove test

* remove one more test

* put ac metadata back for single folder API responses

* extend tests

* remove ac metadata from folder frontend object

* undo unneeded change

* PR feedback

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-04-21 15:05:11 +01:00
Vardan Torosyan
f70f31744b
Require access to all settings to read Grafana Settings (#66992)
* Require access to all settings to read Grafana Settings

* Handle PR comments
2023-04-20 19:58:50 +03:00
Josh Hunt
78d7b6c0c9
NestedFolders: Backend nested-dashboards route (#66955)
* NestedFolders: Add backend route for temp browse dashboards page

* tweak 'preview new ui' badge

* tweak 'preview new ui' badge
2023-04-20 14:34:35 +01:00
Ashley Harrison
9ff221098d
Navigation: refactor RemoveEmptySection... logic into main navtree code (#66878)
refactor RemoveEmptySection logic into main navtree code
2023-04-20 11:10:12 +01:00
Will Browne
739c7f1c68
Plugins: Simplify plugin file removal (#66115)
* make explicit class check when attempting to remove plugin

* simplify plugin file tracking

* fix test

* apply feedback

* fix linter
2023-04-20 11:52:59 +02:00
linoman
4e10118c3a
Add verbose settings (#65469)
* Add `settings.CurrentVerbose` function

* Add function to retrieve verbose settings

* Add `/settings-verbose` endpoint

* Restrict the verbose source types
2023-04-20 04:43:28 -04:00
Jean-Philippe Quéméner
42cdec369d
Datasources: provide generic function to extract custom headers (#66738) 2023-04-19 17:04:30 +02:00
Andres Martinez Gotor
98778289cb
Catalog: Show install error with incompatible version (#65059) 2023-04-19 10:22:24 +02:00
Stephanie Hingtgen
255d8f3326
Plugins: Remove secure socks proxy feature toggle (#66611) 2023-04-18 11:11:23 -06:00
Andres Martinez Gotor
98c695c68f
Chore: Use Grafana API to retrieve the public key to validate plugins (#66439) 2023-04-18 16:12:05 +02:00
Eric Leijonmarck
15c9ced944
Revert "APIkeys: Add metrics for apikey endpoints (#66732)" (#66754)
This reverts commit c505d26430.
2023-04-18 13:05:52 +01:00
Eric Leijonmarck
c505d26430
APIkeys: Add metrics for apikey endpoints (#66732)
add metrics for apikey endpoints
2023-04-18 11:12:19 +01:00
Ryan McKinley
39c04a8e36
Chore: Remove deprecated dashboardId from panel query runner (#64786) 2023-04-14 16:50:10 -07:00
Arati R
cab3ba519a
NestedFolders: Add folder service registry with dashboard service implementation (#65033)
* Delete folders, dashboards with registry service
Co-authored-by: Serge Zaitsev <hello@zserge.com>
* Update signature of ProvideDashboardServiceImpl
* Regenerate mockery file
* Add test for DeleteInFolder
* Add test for DeleteDashboardsInFolder
* Delete child dashboard associations via registry
* Add validation of folder uid and org id

---------

Co-authored-by: Serge Zaitsev <hello@zserge.com>
2023-04-14 11:17:23 +02:00
Ashley Harrison
4abe0249ba
Chore: Clean up old navigation (#66287)
* remove code outside of the topnav feature flag

* delete NavBar folder

* remove topnav toggle from backend

* restructure AppChrome folder

* fix utils mock

* fix applinks tests

* remove tests since they're covered in e2e

* fix 1 of the approotpage tests

* Fix another dashboardpage test

* remove reverse portalling + test for plugins using deprecated onNavChanged method

* kick drone

* handle correlations
2023-04-14 09:43:11 +01:00
Artur Wierzbicki
2136e680c4
Previews: remove dashboard previews backend (#66176)
* remove dashboard previews backend

* remove dashboard previews backend

* bring back the migration

* bring back the migration

* bring back the migration
2023-04-13 21:42:24 +04:00
Michael Mandrus
5626461b3c
Caching: Refactor enterprise query caching middleware to a wire service (#65616)
* define initial service and add to wire

* update caching service interface

* add skipQueryCache header handler and update metrics query function to use it

* add caching service as a dependency to query service

* working caching impl

* propagate cache status to frontend in response

* beginning of improvements suggested by Lean - separate caching logic from query logic.

* more changes to simplify query function

* Decided to revert renaming of function

* Remove error status from cache request

* add extra documentation

* Move query caching duration metric to query package

* add a little bit of documentation

* wip: convert resource caching

* Change return type of query service QueryData to a QueryDataResponse with Headers

* update codeowners

* change X-Cache value to const

* use resource caching in endpoint handlers

* write resource headers to response even if it's not a cache hit

* fix panic caused by lack of nil check

* update unit test

* remove NONE header - shouldn't show up in OSS

* Convert everything to use the plugin middleware

* revert a few more things

* clean up unused vars

* start reverting resource caching, start to implement in plugin middleware

* revert more, fix typo

* Update caching interfaces - resource caching now has a separate cache method

* continue wiring up new resource caching conventions - still in progress

* add more safety to implementation

* remove some unused objects

* remove some code that I left in by accident

* add some comments, fix codeowners, fix duplicate registration

* fix source of panic in resource middleware

* Update client decorator test to provide an empty response object

* create tests for caching middleware

* fix unit test

* Update pkg/services/caching/service.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* improve error message in error log

* quick docs update

* Remove use of mockery. Update return signature to return an explicit hit/miss bool

* create unit test for empty request context

* rename caching metrics to make it clear they pertain to caching

* Update pkg/services/pluginsintegration/clientmiddleware/caching_middleware.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Add clarifying comments to cache skip middleware func

* Add comment pointing to the resource cache update call

* fix unit tests (missing dependency)

* try to fix mystery syntax error

* fix a panic

* Caching: Introduce feature toggle to caching service refactor (#66323)

* introduce new feature toggle

* hide calls to new service behind a feature flag

* remove licensing flag from toggle (misunderstood what it was for)

* fix unit tests

* rerun toggle gen

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-04-12 12:30:33 -04:00
Misi
2c21090931
AccessControl: Allow editors to access GET /api/datasources (#66343)
Allow editors to access GET /datasources
2023-04-12 14:53:05 +02:00
Eric Leijonmarck
2031997994
API keys: Add deprecation to api keys (#65948)
* add: deprecation to api keys write path

* boolean w. meessage

* add read and delete endpoints

* better description of deprecation

* updated with puncutations
2023-04-11 15:58:35 +01:00
Will Browne
bff9f4c890
Plugins: Move config factory to pluginsintegration package (#65716)
* move config to pluginsintegration package

* change to all plugin toggle

* fixes

* fixes

* fix lerna

* fix test
2023-04-05 14:40:08 +02:00
Will Browne
819c2f4ad8
Plugins: Remove unnecessary CDN code (#65929)
remove unnecessary code
2023-04-04 17:01:49 +02:00
Karl Persson
46cfb73e21
AuthToken: client token rotation fix (#65709)
* AuthToken: respond with 401 if token is not found

* Set retry to one so we don't retry a failed token rotation
2023-03-31 16:44:08 +02:00
Emil Tullstedt
be9361cb9e
Logger: Add feature toggle for errors in HTTP request logs (#64425) 2023-03-31 15:38:09 +02:00
Giuseppe Guerra
09078b14e1
Plugins: Support for distributed tracing in backend plugins SDK (#63714)
* Tracing: Pass OTLP address and propagation format to plugins

* Fix unit tests

* Fix indentation

* Fix plugin manager integration tests

* Goimports

* Pass plugin version to plugins

* Do not add GF_PLUGIN_VERSION if plugin version is not set, add tests

* Allow disabling plugins distributed tracing on a per-plugin basis

* Moved disabled plugins to tracing.opentelemetry config section

* Pre-allocate DisabledPlugins map to the correct size

* Moved disable tracing setting flags in plugin settings

* Renamed plugin env vars for tracing endpoint and propagation

* Fix plugin initializer tests

* Refactoring: Moved OpentelemetryCfg from pkg/infra to pkg/plugins

* Changed GetSection to Section in parseSettingsOpentelemetry

* Add tests for NewOpentelemetryCfg

* Fix test case names in TestNewOpentelemetryCfg

* OpenTelemetry: Remove redundant error checks
2023-03-30 23:31:14 +02:00
Sofia Papagiannaki
3cd3bb00ec
API: Fix "Updated by" Column in dashboard versions table (#65351)
* API: Fix dashboard versions created by field

* Add tests

* Update OpenAPI specs

* Apply suggestion from code review
2023-03-30 17:31:53 +03:00
Serge Zaitsev
f19569d61d
Chore: Remove result field from search (#65583)
remove result field from search
2023-03-30 11:28:12 +02:00
Sofia Papagiannaki
c65cd5833a
Nested folders: Fix move (#65526)
* Nested Folders: Fix move response

Fix JSON tags to be consistent with the GET endpoint

* Add API test for moving to root folder

* Allow move to root folder

* Fix failure message

* Update OpenAPI specification
2023-03-30 11:46:11 +03:00
Serge Zaitsev
2025c1dac1
Chore: Remove result field from stats (#65166)
remove result field from stats
2023-03-30 08:08:47 +02:00
Will Browne
7bbe255150
Plugins: Add file store abstraction for handling plugin files (#65432)
* add file store

* fix markdown fetch bug

* add markdown tests

* fix var name
2023-03-29 12:55:55 +02:00
Serge Zaitsev
46605a3791
Chore: Fix authinfo api after result field removal (#65487)
fix authinfo api after result field removal
2023-03-28 23:12:57 +03:00
Serge Zaitsev
a38f230d37
Chore: Remove result fields from login (#65136)
* remove result fields from login

* fix tests

* fix tests

* another shadowing
2023-03-28 20:32:21 +02:00
Serge Zaitsev
b2ab57d14b
Chore: Remove result field from notifications (#65170)
* remove result field from notifications

* fix test
2023-03-28 13:44:15 +02:00
Giuseppe Guerra
a89202eab2
Plugins: Improve instrumentation by adding metrics and tracing (#61035)
* WIP: Plugins tracing

* Trace ID middleware

* Add prometheus metrics and tracing to plugins updater

* Add TODOs

* Add instrumented http client

* Add tracing to grafana update checker

* Goimports

* Moved plugins tracing to middleware

* goimports, fix tests

* Removed X-Trace-Id header

* Fix comment in NewTracingHeaderMiddleware

* Add metrics to instrumented http client

* Add instrumented http client options

* Removed unused function

* Switch to contextual logger

* Refactoring, fix tests

* Moved InstrumentedHTTPClient and PrometheusMetrics to their own package

* Tracing middleware: handle errors

* Report span status codes when recording errors

* Add tests for tracing middleware

* Moved fakeSpan and fakeTracer to pkg/infra/tracing

* Add TestHTTPClientTracing

* Lint

* Changes after PR review

* Tests: Made "ended" in FakeSpan private, allow calling End only once

* Testing: panic in FakeSpan if span already ended

* Refactoring: Simplify Grafana updater checks

* Refactoring: Simplify plugins updater error checks and logs

* Fix wrong call to checkForUpdates -> instrumentedCheckForUpdates

* Tests: Fix wrong call to checkForUpdates -> instrumentedCheckForUpdates

* Log update checks duration, use Info log level for check succeeded logs

* Add plugin context span attributes in tracing_middleware

* Refactor prometheus metrics as httpclient middleware

* Fix call to ProvidePluginsService in plugins_test.go

* Propagate context to update checker outgoing http requests

* Plugin client tracing middleware: Removed operation name in status

* Fix tests

* Goimports tracing_middleware.go

* Goimports

* Fix imports

* Changed span name to plugins client middleware

* Add span name assertion in TestTracingMiddleware

* Removed Prometheus metrics middleware from grafana and plugins updatechecker

* Add span attributes for ds name, type, uid, panel and dashboard ids

* Fix http header reading in tracing middlewares

* Use contexthandler.FromContext, add X-Query-Group-Id

* Add test for RunStream

* Fix imports

* Changes from PR review

* TestTracingMiddleware: Changed assert to require for didPanic assertion

* Lint

* Fix imports
2023-03-28 11:01:06 +02:00
Will Browne
1387fec51d
Plugins: Markdown fetch retry with lowercase (#65384)
* retry with lowercase

* undo incorrect err check

* re-add defer to close file

* fix test
2023-03-27 19:44:06 +03:00
Will Browne
31d6416157
Plugins: Migrate licensing and access control to pkg/services/pluginsintegration package (#65258)
* migrate licensing + access control

* update package name
2023-03-27 11:15:37 +02:00
Karl Persson
382b24742a
Auth: Add feature flag to move token rotation to client (#65060)
* FeatureToggle: Add toggle to use a new way of rotating tokens

* API: Add endpoints to perform token rotation, one endpoint for api request and one endpoint for redirectsd

* Auth: Aling not authorized handling between auth middleware and access
control middleware

* API: add utility function to get redirect for login

* API: Handle token rotation redirect for login page

* Frontend: Add job scheduling for token rotation and make call to token rotation as fallback in retry request

* ContextHandler: Prevent in-request rotation if feature flag is enabled and check if token needs to be rotated

* AuthN: Prevent in-request rotation if feature flag is enabled and check if token needs to be rotated

* Cookies: Add option NotHttpOnly

* AuthToken: Add helper function to get next rotation time and another function to check if token need to be rotated

* AuthN: Add function to delete session cookie and set expiry cookie

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-03-23 14:39:04 +01:00
Ryan McKinley
f96637b5fc
Live: Remove (alpha) ability to configure live pipelines (#65138) 2023-03-22 20:09:44 +02:00
Eric Leijonmarck
3cd952b8ba
Auth: Fix orgrole picker disabled if isSynced user (#64033)
* fix: disable orgrolepicker if externaluser is synced

* add disable to role picker

* just took me 2 hours to center the icon

* wip

* fix: check externallySyncedUser for API call

* remove check from store

* add: tests

* refactor authproxy and made tests run

* add: feature toggle

* set feature toggle for tests

* add: IsProviderEnabled

* refactor: featuretoggle name

* IsProviderEnabled tests

* add specific tests for isProviderEnabled

* fix: org_user tests

* add: owner to featuretoggle

* add missing authlabels

* remove fmt

* feature toggle

* change config

* add test for a different authmodule

* test refactor

* gen feature toggle again

* fix basic auth user able to change the org role

* test for basic auth role

* make err.base to error

* lowered lvl of log and input mesg
2023-03-22 17:41:59 +00:00
Joao Silva
14607e78d1
Admin: Change permissions to /admin page so org admins don't get redirected (#65098) 2023-03-22 15:35:17 +01:00
Serge Zaitsev
743d66396a
Chore: Remove result field from API keys commands and queries (#65055)
* Chore: remove result field from api keys

* fix shadowing

* actually shadowing was all right
2023-03-21 13:26:33 +01:00
Ryan McKinley
91a4b8b529
Chore: remove dashboardsFromStorage (#65058) 2023-03-20 18:36:49 +02:00
Artur Wierzbicki
4274b9414f
Chore: remove querylibrary feature toggle (#65021)
* chore: remove querylibrary

* chore: remove querylibrary

* chore: remove querylibrary
2023-03-20 20:00:14 +04:00
Will Browne
ee2dd62a1f
Plugins: Refactor loader + finder to support multiple sourcing methods (#64735)
* it's cdn time

* tidy body closing

* auto signed

* fix close

* update log name

* remove comments
2023-03-20 14:35:49 +01:00
Ieva
7860ca6c3d
RBAC: protect folder creation and moving (#64636)
* protect moving folders to a subfolder and creating folders in a subfolder

* folder update endpoint isn't used for folder parent update

* lint

* move permission check logic to services, fix tests

* linting
2023-03-20 11:04:22 +00:00
Ezequiel Victorero
8f0a9729f0
PublicDashboards: Allow hidden queries execution (#64858) 2023-03-16 15:39:17 -03:00
Jo
6b6cf5f4b7
Cfg: Move ViewersCanEdit into cfg (#64876)
move ViewersCanEdit into cfg
2023-03-16 10:54:01 +01:00
Jo
ccbf200c4a
SupportBundles: Add OAuth bundle collectors (#64810)
* wip

* add oauth support bundles

* add specific configs for generic oauth and azureAD

* add doc entry

* optimize struct packing

* Update pkg/login/social/azuread_oauth.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* nit update

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-03-16 09:46:25 +02:00
Ryan McKinley
d5a9a0cea0
Chore: remove comments feature (#64644) 2023-03-11 04:28:12 -08:00
Ashley Harrison
3336327306
Navigation: Fix Home logo always going to /login (#62658)
* only redirect to /login when anonymous access is disabled

* only search for dashboards when not logged in if anon access is enabled

* fix go logic

* add unit tests
2023-03-09 16:42:45 +00:00
Eric Leijonmarck
17537b033d
API keys: Add last_used_at and docs changes for migration (#64293)
* feat: last_used_at for apikeys

* add: docs and copy changes

* refactor: use br correctly

* remove docs

* removed more docs
2023-03-09 14:16:42 +00:00
owensmallwood
1a5a280c86
Pubdash: Email sharing handle dashboard deleted (#64247)
dashboard service calls pubdash service when dashboard deleted
2023-03-08 14:54:35 -06:00
Ryan McKinley
42e7ec9fe4
Chore: cleanup dashboard service names (#64442) 2023-03-08 14:37:45 -05:00
Misi
6543259a7d
Auth: Add SyncPermissions post auth hook (#64205)
* Add SyncPermissionsFromDB post auth hook

* Delete FromDB prefix

* Align tests

* Fixes

* Change SyncPermissionsHook prio
2023-03-08 13:35:54 +01:00
Sofia Papagiannaki
43095d84e4
Snapshots: Fix deleting snapshot with non existent dashboard ID (#64345)
* Add test for deleting snapshot for non existent dashboard

* Add test for failure to fetch guardian other than ErrDashboardNotFound

* Fix dashboard snapshot delete
2023-03-08 10:12:02 +02:00
Will Browne
94f39e69a3
Plugins: Migrate plugincontext, adapters and pluginsettings to pkg/services/pluginsintegration package (#64154)
* migrate plugincontext, adapter and pluginsettings

* add to CODEOWNERS

* fix imports

* fix CODEOWNERS

* take pluginsettings

* migrate wire stuff
2023-03-07 11:22:30 -05:00
Will Browne
68df83c86d
Plugins: Add Plugin FS abstraction (#63734)
* unexport pluginDir from dto

* first pass

* tidy

* naming + add mutex

* add dupe checking

* fix func typo

* interface + move logic from renderer

* remote finder

* remote signing

* fix tests

* tidy up

* tidy markdown logic

* split changes

* fix tests

* slim interface down

* fix status code

* tidy exec path func

* fixup

* undo changes

* remove unused func

* remove unused func

* fix goimports

* fetch remotely

* simultaneous support

* fix linter

* use var

* add exception for gosec warning

* fixup

* fix tests

* tidy

* rework cfg pattern

* simplify

* PR feedback

* fix dupe field

* remove g304 nolint

* apply PR feedback

* remove unnecessary gosec nolint

* fix finder loop and update comment

* fix map alloc

* fix test

* remove commented code
2023-03-07 16:47:02 +01:00
Karl Persson
872d2d1e1c
AuthN: Login error handling (#64239)
* Social: Fix type so it appears in error responses

* AuthN: construct errutil.Error from social.Error

* login: Check for errutil.Error and use public message

* Login: redirectURLWithErrorCookie for authn errors

Co-authored-by: Jo <joao.guerreiro@grafana.com>
2023-03-07 09:57:25 +01:00
Sofia Papagiannaki
fde96c91c1
Chore: Differentiate the ErrOrgNotFound error messages (#64131)
* Better org not found error messages
2023-03-06 09:57:46 +02:00
Sofia Papagiannaki
e6e8351ee9
Chore: Remove CreateUserForTests() (#64125)
* Chore: Remove CreateUserForTests

* Apply suggestion from code review
2023-03-03 11:01:23 -05:00
Ieva
a52999a886
Access Control: revert to using folder store from the scope resolvers (#64132)
* revert to using folder store from the resolvers

* fixing tests after revert

* api test fixes

---------

Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
2023-03-03 10:56:33 -05:00
Ashley Harrison
d61bcdf4ca
Chore: Pass signed user_hash to Intercom via Rudderstack (#63921)
* move analytics identifiers to backend

* implement hash function

* grab secret from env

* expose and retrieve intercom secret from config

* concat email with appUrl to ensure uniqueness

* revert to just using email

* Revert "revert to just using email"

This reverts commit 8f10f9b1bc.

* add docstring
2023-03-03 14:39:53 +00:00
Karl Persson
f258adadbf
AuthN: add utility functions for different type of login responses (#64133)
* AuthN: add utility functions to handle response and redirect after
successful login

* API: Reuse utility functions for logins if authnService flag is enabled
2023-03-03 14:17:09 +01:00
Jack Westbrook
8c8f584b41
Plugins: Extend panel menu with links from plugins (#63089)
* feat(plugins): introduce dashboard panel menu placement for adding menu items

* test: add test for getPanelMenu()

* added an unique identifier for each extension.

* added context to getPluginExtensions.

* wip

* Wip

* wiwip

* Wip

* feat: WWWIIIIPPPP 🧨

* Wip

* Renamed some of the types to align a bit better.

* added limit to how many extensions a plugin can register per placement.

* decreased number of items to 2

* will trim the lenght of titles to max 25 chars.

* wrapping configure function with error handling.

* added error handling for all scenarios.

* moved extension menu items to the bottom of the more sub menu.

* added tests for configuring the title.

* minor refactorings.

* changed so you need to specify the full path in package.json.

* wip

* removed unused type.

* big refactor to make things simpler and to centralize all configure error/validation handling.

* added missing import.

* fixed failing tests.

* fixed tests.

* revert(extensions): remove static extensions config in favour of registering via AppPlugin APIs

* removed the compose that didn't work for some reason.

* added tests just to verify that validation and error handling is tied together in configuration function.

* adding some more values to the context.

* draft validation.

* added missing tests for getPanelMenu.

* added more tests.

* refactor(extensions): move logic for validating extension link config to function

* Fixed ts errors.

* Update packages/grafana-data/src/types/app.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update packages/grafana-runtime/src/services/pluginExtensions/extensions.test.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* refactor(extensions): rename limiter -> pluginPlacementCount

* refactor(getpanelmenu): remove redundant continue statement

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2023-03-02 15:42:00 +01:00
Kristin Laemmert
bb798e24f3
chore(services): replace dependencies on dashboard store with dashboard service (#63937)
* chore(services): replace dependencies on dashboard store with dashboard service

This continues the backend service/store split by replacing dashboard store dependencies with service dependencies. the folder service remains the single exception for now; otherwise we'd have a dependency cycle between the folder and dashboard services. I have some ideas for that, but I'll take care of all the easy parts first.

While doing this, I identified and removed a number of unused arguments from the following functions:

NewFolderNameScopeResolver
NewFolderIDScopeResolver
NewFolderUIDScopeResolver
NewDashboardIDScopeResolver
NewDashboardUIDScopeResolver
resolveDashboardScope

I have a small enterprise PR to support this commit.

* lingering fmt
2023-03-02 08:09:57 -05:00
Torkel Ödegaard
27070c252d
ErrorHandling: Fixes issues with bad error messages (#63775) 2023-03-02 13:09:58 +01:00
Kristin Laemmert
157c270ad3
chore: remove export service POC from main (#63945)
* chore: remove export service POC from main

This is a POC and we'll see it, or something like it, again!

* remove frontend changes

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-03-01 12:42:53 -05:00
Sofia Papagiannaki
8aae7be4e5
API: Enable serving Swagger UI by default and add docs and guidelines (#63489)
* Enable serving Swagger UI by default

It used to be served behind the `swaggerUi` feature toggle.

* Remove `swaggerUi` feature toggle

* Add docs and guidelines for updating swagger

* Apply suggestions from code review

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2023-03-01 16:36:37 +02:00
Joey
fbd049a094
Profiling: Enable flame graph & Phlare/Parca data sources for all users (#63488)
* Remove flame graph toggle

* Remove beta badge from panel

* Update expectedListResp.json

* Update flame graph container to only show if there is data
2023-03-01 11:32:39 +00:00
Will Browne
ab8de1a0e3
Plugins: Add simple plugin sources service (#63814)
add simple plugin sources svc
2023-02-28 15:27:11 +01:00
zhichli
3c218d742f
Datasources: Add user_agent header customization for outgoing HTTP requests (#63769) 2023-02-28 14:10:05 +01:00
Will Browne
32aa0ad272
Plugins: Remove stream handler from plugins DTO (#63812)
remove stream handler from DTO
2023-02-27 19:48:18 +01:00
Karl Persson
8484d0c4ef
Settings: Remove global variables for auth settings (#63795)
* Setting: Remove global DisableLoginForm and add it to cfg

* Setting: Remove unused BasicAuthEnabled global

* Setting: Remove global OAuthAutoLogin and use from cfg

* Setting: Remove global AnonymousEnabled

* Setting: Remove global values for AuthProxy settings
2023-02-27 15:28:49 +01:00
Jo
3b22955ebb
Orgs: Remove auto assign globals (#63754)
* remove auto assign globals

* add missing gitignore entries
2023-02-27 10:23:38 +01:00
Jo
c8db771939
Users: Fix org user always getting org id = 1 on auto assign false (#63708)
* fix org user always getting org id = 1 on auto assign false

* make tests explicit

* use correct cfg in service accounts

* fix api tests

* fix database test of ac

* fix InsertOrgUser returning affected rows as orgID
2023-02-24 18:08:44 +01:00
Giuseppe Guerra
966bcd3545
Plugins: Fix plugins CDN not working when plugins are not in domain's root path (#63202)
* Plugins CDN: Add support for different CDN root path

* Plugins CDN: Make frontendsettings return the correct CDN base path

* Update comments

* Fix version detection

* Undo frontend changes

* Fix system.js asset path construction

* fix(plugins): translate all plugin css asset paths loaded via cdn

* refactor(plugins): rename extractPluginNameVersionFromUrl and add comments

* Fix typo in comment

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Hardcode CDN URL structure

/{id}/{version}/public/plugins/{id}/{assetPath} is not required anymore in the cdn url template config

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2023-02-24 14:28:13 +01:00
Will Browne
200d2ad249
Plugins: Invalidate plugin context app settings cache post update (#63279)
invalid plugin settings
2023-02-24 12:13:22 +01:00
Emil Tullstedt
3abaf32cf2
Chore: Upgrade golangci-lint to v1.51.2 (#63630)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-02-23 15:10:03 +01:00
Jo
ff78103a24
Authn: Anon session service (#63052)
* add anon sessions package

* add usage stat fn

* implement count for cache

* add anonservice to authn broker

* lint

* add tests for remote cache count

* move anon service to services

* wrap tagging in goroutine

* make func used
2023-02-21 16:21:18 +01:00
Selene
7ace44c8b5
Chore: Update oapi-codegen library (#62962)
* Update oapi library and thema

* Use fork commit to fix elasticsearch and cloudwatch generators

* Update thema

* Fixes

* Update thema with last fixes

* Sync

* Fix test

* Update thema and schemas

* Update thema
2023-02-21 12:34:24 +01:00
Emil Tullstedt
0caacb3333
Cookies: Provide a mechanism for per user control over cookies (#61566) 2023-02-21 11:19:07 +01:00
Karl Persson
5eaaf9b9b7
RBAC: Rewrite search and plugin list rbac test (#63483)
* API: rewrite rbac tests for search

* API: rewrite rbac tests for listing plugins

* API: remove unused rbac test setup code
2023-02-21 11:13:35 +01:00
Jo
d4cfbd9fd3
LDAP: Move LDAP globals to Config (#63255)
* structure dtos and private methods

* add basic LDAP service

* use LDAP service in ldap debug API

* lower non fatal error

* remove unused globals

* wip

* remove final globals

* fix tests to use cfg enabled

* restructure errors

* remove logger from globals

* use ldap service in authn

* use ldap service in context handler

* fix failed tests

* fix ldap middleware provides

* fix provides in auth_test.go
2023-02-10 19:01:55 +01:00
Jo
c70571c536
SupportBundles: Replace feature toggle with enabled (#63241)
replace feature toggle with enabled
2023-02-10 10:12:04 +01:00
Ryan McKinley
0018c8e9c1
K8S: cleanup and consolidate feature toggles (#63212) 2023-02-09 09:54:00 -08:00