Commit Graph

11854 Commits

Author SHA1 Message Date
Kat Yang
2f2ce3edbb
Chore: Deprecate ID from Folder (#78281)
* Chore: Deprecate ID from Folder

* chore: add more linter comments

* chore: add missing lint comment
2023-11-20 15:44:51 -05:00
Jo
259ecb1793
AuthZ: Improve team ID fetching for signedInUser (#78378)
* improve team ID fetching for signedInUser

* remove inner join

* rename func

* nit: remove extra params

* nit: spacing and wrapping
2023-11-20 16:23:13 +01:00
Misi
53f53a44e3
Auth: Make clientTokenRotation enabled by default (#78384)
Make clientTokenRotation enabled by default
2023-11-20 15:28:33 +01:00
Ieva
87c3703a0d
Data sources: show data source menu to users who only have access to create a data source (#78347)
* show data source menu to users who only have access to create a data source

* return early if missing permissions
2023-11-20 13:59:02 +00:00
Karl Persson
72db9739c7
UserAuth: clean-up auth entries on update (#78377)
* UserAuth: clean-up auth entries on update

* Update pkg/services/login/authinfoservice/database/database.go

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

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-11-20 14:58:32 +01:00
Ivana Huckova
28f4c3ed44
Elasticsearch: Fix processing of raw_data with not-recognized time format (#78262)
* Elasticsearch: Fix non-standard time field in raw data queries

* Update snapshot tests

* Refactor
2023-11-20 12:01:41 +01:00
Misi
437ae8e8c5
Auth: Refactor OAuth connectors' initialization (#77919)
* Refactor AzureAD to init itself

* Use mapstructure to convert data to OAuthInfo

* Update

* Align tests

* Remove unused functions

* Add owner to mapstructure

* Clean up, lint

* Refactor Okta init, Align tests

* Address review comments, fix name in newSocialBase

* Update newSocialBase first param

* Refactor GitLab init, align tests

* Update pkg/login/social/common.go

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

* Use ini conversion to map

* Leftovers

* Refactor GitHub connector initialization, align tests

* Refactor Google connector init, align tests

* Refactor grafana_com connector, align tests

* Refactor generic_oauth connector init, align tests

* cleanup

* Remove util.go

* Add tests for custom field init

* Change OAuthInfo's Extra type

* Fix

* Replace interface{} with any

* clean up

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-11-20 09:45:40 +01:00
Ryan McKinley
49fc8214a0
K8s: Add etcd tests for dual write (local) (#78161) 2023-11-17 14:20:54 -05:00
Ivan Ortega Alba
ddfe4e1bdd
FeatureToggle: Disable dashgpt by default and mark it as preview (#78348) 2023-11-17 18:51:51 +02:00
Matthew Jacobson
893839d27b
Alerting: Move general alert rule validation from db-layer to model (#78325)
Alerting: Move general alert rule validation to model
2023-11-17 11:20:50 -05:00
Karl Persson
a929e3f2cf
Auth: Remove unused function (#78332)
Remove unused function
2023-11-17 17:07:39 +01:00
Karl Persson
140b5b4a61
AuthN: Add debug logs and check error during oauth token sync (#78323)
Add some debug logs and handle error
2023-11-17 16:03:25 +01:00
Giuseppe Guerra
027a157898
Plugins: Allow disabling "skip host environment variables" per-plugin (#78266)
* Plugins: Allow disabling skipping host environment variables per-plugin

* Renamed SkipEnvVarsDecorateFunc to SkipHostEnvVarsDecorateFunc

* PR review feedback

* fix tests
2023-11-17 16:12:05 +02:00
Will Browne
ddb7406caa
Plugins: Add running method to interface (#78326)
* add running to interface

* add context
2023-11-17 13:52:31 +01:00
Tania
a9208f623a
Nested Folders: Refactor query for getting folders (#78286)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-11-17 13:09:30 +01:00
Mihai Doarna
9da9bbf907
Add swagger code for the removeProviderSettings API method (#78270)
* add swagger code for the remove provider SSO settings API method

* replace fine grained with role based

* address feedback
2023-11-17 14:07:26 +02:00
Domas
6edc86a7ed
Chore: Add app o11y viz as code owners for sparkline related stuff (#78310)
* add app o11y viz as code owners for sparkline related stuff

* run gencue
2023-11-17 14:02:52 +02:00
Esteban Beltran
5a2127c221
Sandbox: Fix configuration key for sandbox exceptions (#78317)
* Sandbox: Disable incident app inside the sandbox code

* Fix wrong key for default config and config key

* Rllback file
2023-11-17 12:35:09 +02:00
Ashley Harrison
7404ed66f6
Chore: Remove navAdminSubsections toggle (#78179)
* remove navAdminSubsections toggle

* missed one!
2023-11-17 10:04:34 +00:00
Ieva
2a5547e1b5
Annotations: Update annotation scope resolver to resolve annotation scopes to dash and folder scopes (#78222)
* update annotation scope resolver to resolve dashboard annotation scopes to dash and folder scopes

* Update annotations.go

remove unwanted changes

* remove unwanted change

* use switch statement
2023-11-17 11:57:25 +02:00
Gabriel MABILLE
36fd9040af
Chore: Fix flaky test (#78309)
* Chore: Fix flaky test

* Found another one
2023-11-17 11:38:57 +02:00
Jean-Philippe Quéméner
2d2e058563
refactor: use constant for prometheus datasource type (#78287) 2023-11-17 01:07:35 +01:00
Gabriel MABILLE
25c2d99350
ExtSvcAuth: Add traces to external service accounts setup (#76779)
* AuthN: Add traces to external service accounts setup
2023-11-16 20:45:31 +01:00
Alexander Zobnin
5e50d9b178
Folders: Fix fetching empty folder (#78280) 2023-11-16 17:50:52 +01:00
Sven Grossmann
a01f8c5b42
Loki: Add backend functionality to parse structured metadata from Loki (#77361)
* prepare backend for structured metadata

* add `lokiStructuredMetadata` feature toggle

* use `lokiStructuredMetadata` feature flag

* add field type check to `labelTypesField`

* remove fixme

* fix feature toggle

* add field in dataplane mode

* use `data.Labels` where possible

* adjust framing tests

* improve verbiage

* improve naming

* update tests to "attributes"
2023-11-16 17:06:14 +01:00
Kat Yang
2d09bac2b8
Chore: Deprecate FolderIDs only used by Swagger (#78219) 2023-11-16 09:57:04 -05:00
Sam
0cf6b94fa2
tsdb/elasticsearch: remove TimeInterval field from tsdb/elasticsearch client (#78264)
remove TimeInterval field from tsdb/elasticsearch client #78187

Co-authored-by: Sam <samucap@users.noreply.github.com>
2023-11-16 14:57:21 +01:00
Ieva
b0448b92e5
Dashboards: Allow updating a dashboard if the user doesn't have access to the parent folder (#78075)
* change where folder checks are done for dash creation/updates

* add test for folder not being found

* test fixes

* more test fixes

* add nlint directive to where folder IDs are used

* fix bad merge

* fix test
2023-11-16 11:11:35 +00:00
Gabriel MABILLE
ba717454e1
ExtSvcAuth: Clean up orphaned external services on start up (#77951)
* Plugin: Remove external service on plugin removal

* Early exit no service account

* Add log

* WIP

* Cable OAuth2Server client removal

* Move function lower

* Add function to test removal

* Add test to RemoveExternalService

* Test RemoveExtSvcAccount

* remove apostrophy in comment

* Add cfg to plugin installer to check features

* Add feature flag check in the service registration service

* Comments

* Move metrics Inc

* Initialize map

* Reorder

* Initialize mutex as well

* Add HasExternalService as suggested

* WIP: CleanUpOrphanedExternalServices

* Commit suggestion

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Nit on test.

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* oauthserver return names

* Name is not Slug

* Use plugin ID not slug

* Add background job

* remove negation on feature check

* Add test to the CleanUp function

* Test GetExternalServiceNames

* rename test

* Add test for ExtSvcAccountsService_GetExternalServiceNames

* Add a todo

* Add todo

* Option based on mix

* Rewrite a bit the comment

* Opinionated choice use slugs instead of names everywhere

* Nit.

* Comments and re-ordering

* Comment

* Add log

* Add context

---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2023-11-16 12:07:42 +01:00
Matias Chomicki
9cb303c3f7
Log Rows: Added popover menu with filter options when a log line is selected (#75306)
* LogRow: detect text selection

* LogRow: refactor menu as component

* LogRow: add actions to menu

* LogRow: hack menu position

* Remove unsused imports

* LogRowMessage: remove popover code

* PopoverMenu: refactor

* LogRows: implement PopoverMenu at log rows level

* PopoverMenu: implement copy

* PopoverMenu: receive row model

* PopoverMenu: fix onClick capture issue

* Explore: add new filter methods and props for line filters

* PopoverMenu: use new filter props

* Explore: separate toggleable and non toggleable filters

* PopoverMenu: improve copy

* ModifyQuery: extend line filter with value argument

* PopoverMenu: close with escape

* Remove unused import

* Prettier

* PopoverMenu: remove label filter options

* LogRow: rename text selection handling prop

* Update test

* Remove unused import

* Popover menu: add unit test

* LogRows: update unit test

* Log row: hide the log row menu if the user is selecting text

* Log row: dont hide row menu if popover is not in scope

* Log rows: rename state variable

* Popover menu: allow menu to scroll

* Log rows: fix classname prop

* Log rows: close popover if mouse event comes from outside the log rows

* Declare new class using object style

* Fix style declaration

* Logs Popover Menu: add string filtering functions (#76757)

* Loki modifyQuery: add line does not contain query modification

* Elastic modifyQuery: implement line filters

* Modify query: change action name to not be loki specific

* Prettier

* Prettier

* Elastic: escape filter values

* Popover menu: create feature flag

* Log Rows: integrate logsRowsPopoverMenu flag

* Rename feature flag

* Popover menu: track interactions

* Prettier

* logRowsPopoverMenu: update stage

* Popover menu: add ds type to tracking data

* Log rows: move feature flag check

* Improve handle deselection
2023-11-16 11:48:10 +02:00
Shirley
9452a6fcf7
CloudWatch: Add missing GameLift metrics (#76102)
Add missing GameLift metrics
2023-11-16 10:02:29 +01:00
ismail simsek
5096806eab
InfluxDB: Don't sort retention policies on the backend (#78252)
don't sort retention policies
2023-11-16 10:39:15 +02:00
Misi
7ae0ff1309
RBAC: Add OAuth provider scopes separately to fixed:authentication.config:writer (#78202)
Add OAuth provider setting scopes to fixed:authentication writer

* Change SSO Settings api scopes

* Remove unused RBAC Action
2023-11-16 09:15:51 +01:00
Ryan McKinley
71f32d4e19
K8s: Ensure there is always a user in appcontext.User (#78247) 2023-11-15 16:52:54 -08:00
Dan Cech
c330b7d18d
Chore: Update settings to support k8s needs (#78235)
use util.SplitString, implement DynamicSection KeysHash
2023-11-15 15:26:28 -05:00
Ben Tasker
f38f657f87
InfluxDB: Add new truthiness operators (Is and Is Not) to InfluxQL Query Builder (#77923)
* InfluxDB: Add new truthiness operators (`Is` and `Is Not`) to InfluxQL Editor for use with boolean fields

* InfluxDB: Make the front-end aware of the new operators so that translation between raw and builder works

* Chore: Add tests

* feat: identify type of field value to allow other types to work with Is/Is Not

Tags: always quote
Integer: Don't quote
Float: Don't quote
Boolean: Don't quote
String: Quote

* Chore: Add test-cases for type inference

* Update front-end to infer type for operators Is and Is Not

* chore: Add front-end tests

* chore: add additional front-end tests

* chore: fix failing lint test

* chore: fix tests (run prettier)
2023-11-15 21:10:37 +01:00
Kyle Brandt
a94acf4b63
Revert "InfluxDB: Response parser improvements (#76852)" (#78224)
This reverts commit 046791e2be.

Is causing malformed frames, and resulting in errors about mismatched field lengths in the logs, No data in the UI, and will cause SSE to panic.

I think this is because of the global slice vars since it seems to take concurrency to replicate it.
2023-11-15 14:01:36 -05:00
Giuseppe Guerra
cb0a88a027
Plugins: Backend: Skip host environment variables (#77858)
* Add pluginsSkipHostEnvVars feature flag

* Set go-plugin's SkipHostEnvVar depending on feature flags

* add missing file

* Re-generate feature flags

* Add allowedHostEnvVarNames

* Fix feature toggles not being passed to plugin context service's plugin env vars

* Fix tests

* PR review feedback: Use cfg.Features

* Fix tests

* PR review feedback: removed DefaultProviderWithFeatures

* merge with master

* fix tests

* use features.IsEnabledGlobally
2023-11-15 18:09:14 +01:00
Yuri Tseretyan
7cec741bae
Alerting: Extract alerting rules authorization logic to a service (#77006)
* extract alerting authorization logic to separate package
* convert authorization logic to service
2023-11-15 18:54:54 +02:00
Ieva
2c73f15839
Revert "Revert "RBAC: remove dashboard ACL logic from dash store, service #78130" (#78203)
Revert "Revert "RBAC: remove dashboard ACL logic from dash store, service #78130 (#78198)"

This reverts commit 8057b9298d.
2023-11-15 16:45:49 +00:00
Taku Maeda
210ec8247b
Plugins: Add AWS/MediaLive metric for CloudWatch (#78163) 2023-11-15 18:42:23 +02:00
Kat Yang
d090dab138
Chore: Deprecate FolderID from SaveDashboardCommand (#77813) 2023-11-15 11:21:02 -05:00
Will Browne
b3ad61e180
Plugins: Add plugin version field to proto interface (#78213)
add plugin version
2023-11-15 16:53:30 +01:00
Dominik Prokop
0122f7ccad
DashboardScene: Support dashboard links (#77855)
* MenuItem: Allow react node as label

* LinkButton: Expose ButtonLinkProps

* Typecheck fix

* DashboardLinks: Refactor and use LinkButton and menu

* DashbaordLinks scene object

* Use flex layout for dashboard controls

* Update public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx

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

* fix keepTime and includeVars

* Add ellipsis to menu item label and description

* Use DashboardLink type from grafana/schema

* Update dashboard scene controls layout

* Fix e2e

* Test fix

* Bring back keyboard navigation

* Remove unused code

* One more fix

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-11-15 17:49:51 +02:00
Kat Yang
8d581b8358
Chore: Deprecate ID in GetFolderQuery (#77647) 2023-11-15 10:30:00 -05:00
Kat Yang
a640d9d395
Chore: Deprecate Id from Folder in DTOs (#77943)
* Chore: Deprecate Id from Folder in DTOs

* chore: regen spec
2023-11-15 10:29:49 -05:00
Kat Yang
ae326eaed1
Chore: Deprecate FolderID from DashboardACLInfoDTO (#77652)
* Chore: Deprecate FolderID from DashboardACLInfoDTO

* chore: regen specs
2023-11-15 10:29:20 -05:00
Kat Yang
3a2e96b0db
Chore: Deprecate FolderID from Dashboard (#77823)
* Chore: Deprecate FolderID from Dashboard

* chore: add two missing nolint comments
2023-11-15 10:28:50 -05:00
ismail simsek
0214b25663
Prometheus: Fix calculating rate interval when there is no interval specified (#78193)
* Use data source scrape interval when no interval is specified

* scrape interval as 15s
2023-11-15 16:20:37 +01:00
Sergey Kostrukov
40152922d3
Azure Monitor: support AzureCredentials in common format on backend (#77424)
* Use GetDefaultCloud from SDK

* Use GetAzureCloud from SDK

* Credentials parser moved to azmoncredentials

* Refactor legacy credentials

* Tests

* Fix test description

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-11-15 14:59:23 +00:00