Commit Graph

5793 Commits

Author SHA1 Message Date
Karl Persson
124e0efe1f
Authn: external identity sync (#73461)
* Authn: Add interface for external identity sync

This interface is implemented by authnimpl.Service and just triggers PostAuthHooks and skipping last seen update by default

* Authn: Add SyncIdentity to fake and add a new mock
2023-08-18 11:11:44 +02:00
Agnès Toulet
878e94ae25
Rendering: Use image for server timeout errors (#73462) 2023-08-18 11:50:49 +03:00
George Robinson
7a9a869d86
Alerting: ScreenshotOptions From and To should be optional (#73325)
This commit updates the screenshot package to make From and To
optional. It also updates the docs for ScreenshotOptions so
this behavior is well documented.
2023-08-18 09:26:51 +01:00
linoman
2e050f25bf
Auth: Allow to auto-assign empty role (#73326)
Allow to auto-assign empty role
2023-08-17 18:32:58 +02:00
Karl Persson
ef6e1a9460
Hooks: Remove AddLoginHook and RunLogin hooks (#73227) 2023-08-17 09:51:45 +02:00
Will Browne
3c50db328d
Plugins: Make Installer responsible for removing plugins from file system (#73323)
* installer is responsible for removing from file system

* take plugin as arg

* remove resolve step

* return plugin in test
2023-08-16 15:44:20 +02:00
Ricardo Christmann
8ec4c1bdc8
DataSourceProxy: Fix url validation error handling (#73087)
* DataSourceProxy: Fix url validation error handling

* DataSourceProxy: Add unit test for proxyDatasourceRequest

* DataSourceProxy: Fix lint error
2023-08-16 11:58:41 +02:00
linoman
1c7f89c41b
Auth: Add empty role usage metrics for service and user accounts (#73108)
* Add tests for service accounts metrics usage

* Add service account store implementation

* Add service account service implementation

* Add tests for org metrics usage

* Add org implementation

* Add service implementation
2023-08-16 10:56:47 +02:00
Will Browne
75b0788377
Plugins: Remove registry dependency from process manager (#73241)
simplify
2023-08-16 10:46:00 +02:00
Dmitry Filimonov
d935e6ff57
Navigation: Remove "preview" from Pyroscope Profiles nav item (#73070)
* Pyroscope: Mark profiles as GA (removes "preview")

* update
2023-08-16 08:38:26 +00:00
Misi
d7166f5f96
RBAC: Remove unused scope from alert.instances:read fixed role (#73268)
Fix alert.instances:read scope for fixed role
2023-08-16 09:55:49 +02:00
Yuri Tseretyan
938e26b59f
Alerting: Add new metrics and tracings to state manager and scheduler (#71398)
* add metrics and tracing to state manager

* propagate tracer to state manager

* add scheduler metrics

* fix backtesting

* add test for state metrics

* remove StateUpdateCount

* update docs

* metrics can be null

* add tracer to new tests
2023-08-16 09:04:18 +02:00
Yuri Tseretyan
90e3f516ff
Alerting: Update Discord settings to treat 'url' as a secure setting (#69588)
* make discord url secure

* support migrating unsecure settings to secure settings

* Update public/app/features/alerting/unified/utils/receiver-form.ts

Co-authored-by: William Wernert <william.wernert@grafana.com>

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: William Wernert <william.wernert@grafana.com>
2023-08-16 09:03:56 +02:00
Yuri Tseretyan
0717ec11d6
Alerting: Update state manager to change all current states in the case when Error\NoData is executed as Ok\Nomal (#68142) 2023-08-15 10:27:15 -04:00
Ivana Huckova
6880ab687c
Elasticsearch: Enable running of queries trough data source backend (#73222)
Elasticsearch: Enable enableElasticsearchBackendQuerying feature toggle by default
2023-08-14 17:05:08 +02:00
Karl Persson
16d24a8429
RBAC: remove LoadPermissionsMiddleware (#73228)
* PubDash: remove LoadPermissionMiddleware from tests

* RBAC: Remove unused LoadPermission middleware
2023-08-14 14:07:09 +02:00
Dan Cech
dd97038b00
Slug: Combine various slugify fixes for special character handling (#73164)
* combine various slugify fixes for special character handling

* a couple more test cases

* update more tests

* goimports
2023-08-10 16:12:50 -04:00
Jo
89c7116720
Auth: Move star service to identity interface (#73114)
* move star service to identity interface

* Update pkg/services/auth/identity/requester.go

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

* Update pkg/services/contexthandler/model/model.go

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-08-10 17:17:27 +02:00
Will Browne
c5e9a82ccb
Plugins: Do not fail bootstrap stage if single decorate step fails (#73147)
* don't fail all if decorate step fails

* fix casing

* include err too

* cover pluginsintegration too
2023-08-10 14:46:38 +02:00
Jo
67de18ff06
Auth: Move Service Account service to SignedInUser Interface (#73142)
* move service account service to identity interface

* Update pkg/services/auth/identity/requester.go
2023-08-10 14:20:58 +02:00
Will Browne
d29f4a8f76
Plugins: Add context to StaticRouteResolver and ErrorResolver interfaces (#73121)
* add ctx

* fix tests
2023-08-10 10:32:12 +02:00
Jean-Philippe Quéméner
2266e09f94
Alerting: optimize rules with multiple loki range queries (#73103) 2023-08-09 19:00:51 +02:00
Will Browne
72da44db0e
Plugins: Add validation stage to plugin loader pipeline (#73053)
* first pass

* change validation signature

* err tracking

* fix

* undo golden

* 1 more

* fix

* adjust doc

* add test helper

* fix linter
2023-08-09 18:25:28 +02:00
Yuri Tseretyan
69c8200fc9
Alerting: Add more tests for state manager ProcessEvalResults (#73019)
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2023-08-09 12:21:12 -04:00
Michael Mandrus
779e0fe311
Feature Toggles: Create API for updating feature toggle state from the feature toggle admin page (#73022)
* create roles for writing feature toggles

* create update endpoint / handler

* api changes

* add feature toggle validations

* hide toggles based on their state

* make FlagFeatureToggle read only

* add username log

* add username string

* refactor for better readability

* refactor unit tests so we can do more validations

* some skeletoning for the set tests

* write unit tests for updater

* break helper functions out

* update sample ini to match defaults

* add more logic to ReadOnly label

* add user documentation

* fix lint issue

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

Co-authored-by: J Stickler <julie.stickler@grafana.com>

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

Co-authored-by: J Stickler <julie.stickler@grafana.com>

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

Co-authored-by: J Stickler <julie.stickler@grafana.com>

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

Co-authored-by: J Stickler <julie.stickler@grafana.com>

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

Co-authored-by: J Stickler <julie.stickler@grafana.com>

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

Co-authored-by: J Stickler <julie.stickler@grafana.com>

---------

Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
2023-08-09 11:32:28 -04:00
Karl Persson
e53e22ef2a
Contexthandler: Remove code that is no longer used (#73101)
* Contexthandler: remove dead code

* Contexthandler: Add tests

* Update pkg/tests/api/alerting/api_alertmanager_test.go

Co-authored-by: Jo <joao.guerreiro@grafana.com>

---------

Co-authored-by: Jo <joao.guerreiro@grafana.com>
2023-08-09 15:17:59 +02:00
Jo
5d8e6aa162
Auth: Org Invite and Team API SignedInUser interfacing (#73085)
* fix ngalert Evaluate sig change

* interface for teams and org invites

* Update pkg/api/org_invite.go

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

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-08-09 12:33:35 +02:00
Sven Grossmann
1343c74362
Logs: Disable query splitting due to conflicts with transformations (#73086)
* disable query splitting for now

* change stage of `lokiQuerySplitting`
2023-08-09 13:21:38 +03:00
Jo
97ba611e4c
Chore: Fix ngalert Evaluate signature change (#73084)
fix ngalert Evaluate sig change
2023-08-09 11:27:14 +02:00
Jo
bd1a856d33
Auth: Add SignedIn user interface NamespacedID (#72944)
* wip

* scope active user to 1 org

* remove TODOs

* add render auth namespace

* import cycle fix

* make condition more readable

* convert Evaluate to user Requester

* only use active OrgID for SearchUserPermissions

* add cache key to interface definition

* change final SignedInUsers to interface

* fix api key managed roles fetch

* fix anon auth id parsing

* Update pkg/services/accesscontrol/acimpl/accesscontrol.go

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

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-08-09 09:35:50 +02:00
Karl Persson
144e4887ee
Auth: Use authn.Service for all tests (#72921)
* Dashboards: Fix tests when authn broker is enabled.
StarService was not configured for tests, the call was guarded by !c.IsSignedIn

* Change default to be anon user to match expectations from tests

* OAuth: rewrite tests to work with authn.Service

* Setup template renderer by default

* Extract cookie options from cfg instead of relying on global variables

* Fix test to work with authn service

* Middleware: rewrite auth tests

* Remvoe session cookie if we cannot refresh access token
2023-08-09 08:54:52 +02:00
Yuri Tseretyan
6b4a9d73d7
Alerting: Export contact points to check access control action instead legacy role (#71990)
* introduce a new action "alert.provisioning.secrets:read" and role "fixed:alerting.provisioning.secrets:reader"
* update alerting API authorization layer to let the user read provisioning with the new action
* let new action use decrypt flag
* add action and role to docs
2023-08-08 19:29:34 +03:00
Jean-Philippe Quéméner
2c6cf66741
Alerting: Optimize external Loki queries (#73014) 2023-08-08 15:13:41 +02:00
Sarah Zinger
deeb1d85f8
Config: making [aws][external_id] part of env (#72062)
* Config: making [aws][external_id] part of env

* Fix go.sum

* Add a test
2023-08-04 16:06:01 -04:00
Yuri Tseretyan
0053b07885
Alerting: Refactor of state manager tests (#72849)
* calculate cacheID instead of literals
   * use mocked clocks
   * advance clocks with the eval results
   * use clearer timestamp aliases
   * make expected state labels be more clear to read
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2023-08-04 13:39:49 -04:00
Will Browne
98f827537b
Plugins: Add remaining steps to inititialization stage (#72894)
add remainder of init steps
2023-08-04 12:35:57 +02:00
Will Browne
60b4a0b2a4
Plugins: Add termination stage to plugin loader pipeline (#72822)
* add termination stage

* uid -> pluginID (for now)

* also fix fakes

* add simple test

* Fix logger name

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>

* inline stop func call

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>

---------

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-08-04 11:57:49 +02:00
Josh Hunt
7bc6d32eb9
Search API: Search by folder UID (#65040)
* Search: Attempt to support folderUID filter

* Search: Use folder UID instead of ID for searching folders

* Update swagger

* Fix JSON property casing

* Add integration test

* Remove redundant query condition

* Fix frontend test

* Fix listing dashboards in General/root

* Add support for fetching top level folders

using `folderUIDs=` (empty string) query parameter

* Add deprecation notice

* Send uid of general in sql.ts

* Use 'general' for query folderUIDs query param for fetching folder

* Add tests

* Fix FolderUIDFilter

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-08-04 12:43:47 +03:00
linoman
64ed77ddce
Auth: Add no role frontend feature flag (#72823)
* Add 'noBasicRole' feature flag

* Hide role options and tooltip with feature flag

* Add feature flag to registry
2023-08-04 11:08:14 +02:00
Ibrahim
0d48ac2419
Feat: Feature toggle admin page frontend interface (#72164)
* feature toggles admin page proto

* feature toggle admin page proto

* keep phase 1 code only

* latest update with api

* fix

* fix

* add correct premissions in admin.go

* move behind toggle

* Use InteractiveTable

* guard behind feature toggle

* use RTK

* route in api.go

* fixes
2023-08-03 14:17:00 -04:00
Ieva
3a2538c2ca
Auth: lock down Grafana admin sync for SAML (#72828)
lock down Grafana admin sync for SAML
2023-08-03 18:02:40 +02:00
Todd Treece
f3ffc850aa
Chore: Revert dskit service additions (#72608) 2023-08-03 09:19:01 -04:00
Stephanie Hingtgen
2c949a6a33
Proxy: Set the proxy information in Grafana for Graphite (#72777) 2023-08-03 15:11:02 +03:00
Jo
2ef334def7
Auth: Move Org service to SignedInUser interface (#72720)
add identity interface for org service
2023-08-03 11:02:38 +02:00
Jo
ba1a8a5634
Auth: Move Support Bundle service to SignedInUser interface (#72723)
add identity interface for support bundles service
2023-08-03 10:09:55 +02:00
Misi
bba11d04cb
Auth: Add key_id config param to auth.jwt (#72711)
* Specify keyID for public key provided in PEM format for JWT Auth

* Update docs

* Update sample.ini
2023-08-03 09:13:23 +02:00
Ryan McKinley
7431c0ddb1
UserSync: Avoid UpdateLastSeenAt with invalid user ids (#72776)
* avoid user zero

* more errors

* more tests

* split
2023-08-03 08:26:02 +02:00
Will Browne
ad2705fa0b
Plugins: Add inititialization stage to plugin loader pipeline (#72667)
* first pass

* migrate tests

* simplify

* fix comments

* fix linter

* nil checks

* remove comment
2023-08-02 16:29:12 +00:00
ismail simsek
77e7ae2a1b
InfluxDB: SQL Support (#72167)
* Add influxdbSqlSupport feature toggle

* Add SQL option to the config page

* Add SQL backend

* Add metadata support in config page

* Implement unified querying

* Fix healthcheck query

* fsql tests

* secure grpc by default

* code cleanup

* Query handing for sql mode

* Implement a placeholder sql editor

* Fix query language dropdown

* go mod updates

* make lint-go

* more make lint-go

* remove unused runQuery

* switch statements with default case

* linting again
2023-08-02 18:27:43 +02:00
Andrej Ocenas
58314e6414
Flamegraph: Remove feature flag and code to switch to pyroscope version (#72689) 2023-08-02 17:01:12 +02:00
Sofia Papagiannaki
8a24e891fe
Nested folders: Fix search query for empty self-contained permissions (#72727)
* Add tests

* Fix query for nested folders with zero self-contained permissions

* Fix query behind  permissionsFilterRemoveSubquery flag

* Apply suggestion from code review
2023-08-02 14:12:46 +03:00
Jo
30274a4f88
Auth: Move Team service to SignedInUserInterface (#72674)
* move SignedInUser to specific file

* add primitive interface for signedInUser
2023-08-02 10:43:56 +02:00
Sofia Papagiannaki
2c26a02b82
Search v1: Remove unnecessary subqueries (#72388)
* Add feature flag

* Introduce interface and dummy implementation

* Add tests for the new filter

* accessControlDashboardPermissionFilterNoFolderSubquery implementation

* join only if it's necessary

* force ordering for tests

* Temporarily enable new query for benchmarks
2023-08-02 10:39:25 +03:00
Ieva
d3b481dac8
Auth: Lock down Grafana admin role updates if the role is externally synced (#72677)
* lock down server admin role updates on the frontend if the user is externally synced

* add tests

* lock Grafana Server admin role updates from the backend

* rename variables

* check that the user has auth info

* add LDAP to providers for which Grafana Server admin role can be synced

* linting
2023-08-01 16:39:08 +01:00
Jo
7d347cd428
Auth: remove org count from signedInUser (#72661)
* tweaks

* remove org count from signedinUser

* remove org count from signedinUser store

* fix broken tests

* restore frontend interface
2023-08-01 14:04:37 +02:00
Sofia Papagiannaki
1869da1d86
Nested folders: Fetch multiple folders from dashboard folder store (#72464) 2023-08-01 11:04:44 +03:00
Serge Zaitsev
7767ab6f43
Chore: Add folder data migration, fix unique index (#72602)
* add folder data migration, fix unique index

* fix unique index

* pass a fake store in tests

* pass store into other providers in tests

* and now with alerting!
2023-08-01 09:36:37 +02:00
Aksel Skaar Leirvaag
6d98d06f6e
Auth: Check id token expiry date (#69829)
* fixed: added id token expiry check to oauth token sync

* use go-jose and id token in cache

* Update pkg/services/authn/authnimpl/sync/oauth_token_sync.go

* refactored getOAuthTokenCacheTTL and added unit tests

* Small changes to oauth_token_sync

* Remove unnecessary contexthandler changes

---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2023-08-01 09:23:47 +02:00
Jo
3353b1a8aa
Auth: Add authed device tagging (#72442)
* add authed device tagging

* fix config

* implement feedback

* implement feedback

* add reverse untag behavior

* remove duplicate stat

* Update pkg/services/anonymous/anonimpl/impl.go
2023-07-31 18:04:28 +02:00
Emil Tullstedt
ab0a115372
Annotations: Improve updating annotation tags queries (#71201)
Annotations: Improve annotation tag updates
2023-07-31 18:19:59 +03:00
Ezequiel Victorero
bffd55efd4
PublicDashboards: Do not return hidden queries (#72554)
* PublicDashboards: Do not return hidden queries

* Update pkg/services/publicdashboards/service/query_test.go

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2023-07-31 10:54:54 -03:00
Jo
e04a6fb08e
Auth: Fix static test fake (#72514)
fix static fake
2023-07-31 10:41:37 +02:00
Matias Chomicki
0d121bab29
Elasticsearch: Implement modify query using a Lucene parser (#71954)
* Lucene: add dependency

* ModifyQuery: use Lucene parser to detect key:values in queries

* ModifyQuery: use Lucene parser to remove filters

* Remove test code

* Modify query: switch to recursive implementation

* Modify query: implement remove filter

* Update query normalizing function

* FlagElasticToggleableFilters: remove feature flag

* Remove unused feature flag from test

* Elasticsearch: escape quotes in filter values
2023-07-28 14:49:02 +02:00
Gabriel MABILLE
261045d182
RBAC: Batch update on scope split migration (#72182)
* RBAC: Make the SplitScope migration concurrent

* Benchmark multiple alternatives: (updates in a loop, batch update, concurrent batch update)

* Only keep batching since mysql 5.7 does not seem to support concurrent batching

* Update pkg/services/accesscontrol/migrator/migrator.go

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

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-07-28 12:37:24 +02:00
Andres Martinez Gotor
a331c892a0
Chore: Refactor error when retrieving the plugin manifest key (#72492) 2023-07-28 10:22:21 +02:00
Juan Cabanas
427714f8d0
Export: Remove DS input when dashboard is imported with a lib panel that already exists (#69412) 2023-07-27 13:11:15 -03:00
Yuri Tseretyan
143683bd05
Alerting: Add more clear error to migration when rule cannot be parsed (#72374) 2023-07-27 09:47:04 -04:00
Will Browne
758d9884bc
Plugins: Plugins loader pipeline (#71438)
* discovery

* flesh out

* add docs

* remove unused func

* bootstrap stage

* fix docs

* update docs

* undo unnecessary changes

* add end tag

* update doc

* fix linter

* fix

* tidy

* update docs

* add class to filter func

* apply PR feedback

* fix test
2023-07-27 15:29:13 +02:00
Hugo Kiyodi Oshiro
a912c970e3
Provisioning: Fix overwrite SecureJSONData on provisioning (#72395)
* Overwrite SecureJSONData on provisioning
2023-07-27 11:11:43 +02:00
Jo
a4a87f6228
Auth: Rename Sessions to Devices in counting (#72432)
* rename session to device

* rename session to device
2023-07-27 11:09:08 +02:00
Yuri Tseretyan
c7598cc6fb
Alerting: Add ability to control scheduler tick interval via config (#71980)
* add ability to control scheduler interval via config
* add feature flag `configurableSchedulerTick`
2023-07-26 12:44:12 -04:00
Brendan O'Handley
98cb3ce3b6
Prometheus: Config overhaul part two, auth and DataSourceHttpSettings overhaul (#71250)
* build httpsettings overhaul with new auth component

* remove test code

* add connection and advanced http settings components

* use tooltip with link

* add correct styling and spacing

* save option select for sigV4

* fix styles in Azure auth to fit new auth component

* add types in overhaul folder that are not available yet in grafana

* update e2e tests for new connection component

* update e2e tests for new connection component

* update width of azure inputs

* fix non custom auth selects

* add feature toggle

* wrap azure style changes behind the feature flag

* fix feature toggle rebase fix error

* move advanced http setting and wrap everything in the config subsection component to fix font

* fix input width

* use cx for conditional classes

* use cx for conditional class
2023-07-26 12:09:53 -04:00
Yuri Tseretyan
5ba164d92b
Alerting: Exclude expression refIDs from NoData state (#72219) 2023-07-26 11:42:04 -04:00
Yuri Tseretyan
78fc3bcdf4
Alerting: Fix state manager to not keep datasource_uid and ref_id labels in state after Error (#72216) 2023-07-26 11:41:46 -04:00
Andre Pereira
89092a1e69
Tempo: Use feature toggle to control TraceQL streaming (#72288)
Rename traceql streaming feature toggle. Remove the manual toggle from Options component and use the feature toggle
2023-07-26 13:33:16 +00:00
Ludovic Viaud
f629698876
Toggle transformationsRedesign for prod (#72207)
* Toggle transformationsRedesign for prod
2023-07-26 14:08:46 +02:00
ismail simsek
876f96e5e8
InfluxDB: Change feature toggle stage (#72348)
Change feature toggle stage
2023-07-26 14:06:42 +02:00
Josh Hunt
488eac0e49
Chore: Remove topnav feature flag (#72337)
* Remove topnav feature flag

* Allow deprecated flags to be enabled by default

* change topnav feature flag to deprecated instead

* fix lint
2023-07-26 11:07:18 +00:00
mikkancso
7a97bf7f15
Data Sources: Remove Admin/Data sources page in favour of Connections/Data sources (#72102)
* don't show Admin/Data sources page in navtree

* redirect from admin/datasources to connections/datasources

* update link of DS plugins to connections/datasources

* redirect edit page from datasources to connections

* redirect to new datasource page under connections

* redirect to datasouce dashboard page under connections

* fix navId on datasource dashboards page

* fix datasource dashboard page's nav

* Revert "update link of DS plugins to connections/datasources"

This reverts commit 0ebcb09b03.
2023-07-26 12:23:05 +02:00
Matthew Jacobson
d31d175109
Alerting: Fix contact point testing with secure settings (#72235)
* Alerting: Fix contact point testing with secure settings

Fixes double encryption of secure settings during contact point testing and removes code duplication
that helped cause the drift between alertmanager and test endpoint. Also adds integration tests to cover
the regression.

Note: provisioningStore is created to remove cycle and the unnecessary dependency.
2023-07-25 10:04:27 -04:00
Galen Kistler
51847cc797
Prometheus: Turn browser resource cache on by default (#72105)
* turn prometheus browser cache flag on by default
2023-07-25 07:39:56 -05:00
Sofia Papagiannaki
1f742fcf93
Guardian: Split dashboard and folder guardian implementation (#69722)
* Split dashboard and folder guardian implementations

* Replace guardian constructors

* Simplify tests

* Add tests

* Apply suggestion from code review

Differentiate errors for dashboard and folders

* Remove tests for general folder

* Add tests for general scope
2023-07-25 15:31:12 +03:00
Ieva
f7c6491f73
Auth: add a feature toggle for locking user roles for users synced through GCom (#72202)
* add a new feature toggle for locking down role sync for users managed by GCom

* protect the frontend and the backend using the new feature toggle

* fix merge
2023-07-25 13:27:02 +01:00
Arati R
20ffbbc41e
NestedFolders: Add library panels counting and deletion to folder registry (#69149)
* Expose library element service's folder service
* Register library panels, add count implementation
* Expand folder counts test
* Update registry deletion method interface
* Allow getting library elements from any folder
* Add test for library panel deletion
* Add test for library panel counting
2023-07-25 13:05:53 +02:00
Ieva
e9ba6922c0
Auth: Lock organization roles for users who are managed through an external auth provider (#72204)
remove onlyExternalOrgRoleSync feature flag
2023-07-25 10:51:47 +01:00
github-actions[bot]
24872370b5
Alerting: Update Swagger spec (#72177)
chore: update alerting swagger spec

Co-authored-by: rwwiv <rwwiv@users.noreply.github.com>
2023-07-25 11:34:00 +02:00
Alexander Weaver
8c8b3ecb5b
Alerting: Add dashboardUID and panelID query parameters for loki state history (#72119)
* read query parameters

* Generate loki query from params
2023-07-24 23:46:46 -05:00
Matthew Jacobson
cfb1656968
Alerting: Add notification policy provisioning file export (#70009)
* Alerting: Add notification policy provisioning file export

- Add provisioning API endpoint for exporting notification policies.
- Add option in notification policy view ellipsis dropdown for exporting.
- Update various provisioning documentation.
2023-07-24 17:56:53 -04:00
João Calisto
4ba83173ea
Feature toggles management: Define get feature toggles api (#72106)
* Feature Toggle Management: Define get feature toggles api

* lint
2023-07-24 16:12:59 -04:00
Matthew Jacobson
c7eb7fb58a
Alerting: Keep legacy alert rule maxDataPoints and intervalMs during migration (#71989)
Keep legacy alert rule max-data-points and interval during migration
2023-07-24 13:36:34 -04:00
Andre Pereira
bd59a27b99
Tempo: Remove traceqlSearch feature toggle (#72029)
* Remove feature flag from registry.go

* Remove usages of toggle

* Refactor and cleanup Tempo's query field components

* Added deprecation alert

* Mark nativeSearch fields as deprecated

* Also show deprecated search tab if queryType is nativeSearch

* Update deprecation message to list grafana version

* Fix merge conflict

* Remove mention of toggle from docs
2023-07-24 16:26:10 +01:00
Jo
ed780ce0e9
Auth: Fix Last Seen being updated on every request (#72036)
* make sure LastSeen hook has information to decide if update is necessary

* make user service check if it should update the user's last seen

* do not run last seen hook if is a login request

* make service return error when last seen is up to date

* fix err

* Update pkg/services/contexthandler/contexthandler.go

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

* fix golint

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-07-24 16:37:35 +02:00
Josh Hunt
f917fbfe42
NestedFolders: Enable new nested folder picker by default for nested folders (#72129)
NestedFolders: Enable new nested folder picker by default
2023-07-24 13:51:00 +00:00
Kyle Brandt
ee60d8c82d
Azure: AzureMonitorMetrics - change response to be dataplane compliant (#69308)
* Azure: AzureMonitorMetrics - change response to be dataplane compliant
can be disabled via toggle azureMonitorDataplane
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-07-24 16:50:49 +03:00
Ivana Huckova
5bb280cb3f
Logs: Remove logsSampleInExplore feature toggle (#72092)
* Logs: Remove logsSampleInExplore feature toggle

* Remove unused import

* Fix incorrect import
2023-07-24 14:24:43 +02:00
Kristin Laemmert
76abbef32d
chore: refactor SecretMigrationProviderImpl as a dskit module (#71944)
* chore: refactor SecretMigrationProviderImpl as a dskit service
2023-07-24 08:14:53 -04:00
mikkancso
b08271da32
Connections: Stop using dataConnectionsConsole feature toggle (#72111)
* remove dataConnectionsConsole feature toggle

* fix imports

* reintroduce dataConnectionsConsole

To prevent breaking change
2023-07-24 10:54:52 +02:00
Matias Chomicki
84f94cdc24
Logs: Show active state of "filter for value" buttons in Logs Details (#70328)
* Datasource test: fix describe nesting

* Parsing: export handleQuotes function

* Modify query: add functions to detect the presence of a label and remove it

* Loki: add support to toggle filters if already present

* Datasource test: fix describe nesting

* Loki: add support to toggle filter out if present

* Remove label: handle escaped values

* Datasource: add test case for escaped label values

* Loki: remove = filter when applying !=

* Remove selector: add support for Selector node being far from Matcher

* Modify query: add unit tests

* Elasticsearch: create modifyQuery for elastic

* Elastic modify query: implement functions

* Elasticsearch: implement modifyQuery functions in datasource

* Elasticsearch: update datasource test

* Loki modify query: check for streamSelectorPositions length

* Elasticsearch query has filter: escape filter value in regex

* Remove unused type

* Modify query: add functions to detect the presence of a label and remove it

* Remove label: handle escaped values

* Logs: create props to check for label filters in the query

* Log Details Row: use label state props to show visual feedback

* Make isCallbacks async

* Explore: add placeholder for checking for filter in query

* Datasource: define new API method

* Inspect query: add base implementation

* Remove isFilterOutLabelActive as it will not be needed

* Check for "isActive" on every render

Otherwise the active state will be out of sync

* Elasticsearch: implement inspectQuery in the datasource

* Logs: update test

* Log details: update test

* Datasources: update tests

* Inspect query: rename to analize query to prevent confusion

* Datasource types: mark method as alpha

* Explore: add comment to log-specific functions

* Remove duplicated code from bad rebase

* Remove label filter: check node type

* getMatchersWithFilter: rename argument

* Fix bad rebase

* Create DataSourceWithQueryManipulationSupport interface

* Implement type guard for DataSourceWithQueryManipulationSupport

* DataSourceWithQueryManipulationSupport: move to logs module

* hasQueryManipulationSupport: change implementation

`modifyQuery` comes from the prototype.

* DataSourceWithQueryManipulationSupport: expand code comments

* AnalyzeQueryOptions: move to logs module

* DataSourceWithQueryManipulationSupport: add support for more return types

* Fix merge error

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

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* DatasourceAPI: deprecate modifyQuery

* Explore: refactor isFilterLabelActive

* DataSourceWithQueryModificationSupport: rename interface

* Split interfaces into Analyze and Modify

* Query analysis: better name for interface

* Fix guard

* Create feature flag for active state

* Use new feature flag in Explore

* DataSourceToggleableQueryFiltersSupport: create a specific interface for this feature

* Rename feature flag

* De-deprecate modifyQuery

* DataSourceToggleableQueryFiltersSupport: Rethink types and methods

* Explore: adjust modifyQuery and isFilterLabelActive to new methods

* Loki: implement new interface and revert modifyQuery

* DataSourceToggleableQueryFiltersSupport: better name for arguments

* Elasticsearch: implement new interface and revert modifyQuery

* Loki: better name for arguments

* Explore: document current limitation on isFilterLabelActive

* Explore: place toggleable filters under feature flag

* Loki: add tests for the new methods

* Loki: add legacy modifyQuery tests

* Elasticsearch: add tests for the new methods

* Elasticsearch: add legacy modifyQuery tests

* Toggle filter action: improve type values

* Logs types: update interface description

* DataSourceWithToggleableQueryFiltersSupport: update interface name

* Update feature flag description

* Explore: add todo comment for isFilterLabelActive

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-07-24 11:22:47 +03:00
Ryan McKinley
10ea92fa09
Schemas: minor updates from the k8s branch (#71688)
Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-07-21 19:17:11 +03:00
Isabella Siu
56913fbd95
Redshift: Support caching async aws queries (#71682)
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2023-07-21 11:34:07 -04:00
Ieva
cfa1a2c55f
RBAC: Split non-empty scopes into kind, attribute and identifier fields for better search performance (#71933)
* add a feature toggle

* add the fields for attribute, kind and identifier to permission

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

* set the new fields when new permissions are stored

* add migrations

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

* remove comments

* Update pkg/services/accesscontrol/migrator/migrator.go

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

* feedback: put column migrations behind the feature toggle, added an index, changed how wildcard scopes are split

* PR feedback: add a comment and revert an accidentally changed file

* PR feedback: handle the case with : in resource identifier

* switch from checking feature toggle through cfg to checking it through featuremgmt

* don't put the column migrations behind a feature toggle after all - this breaks permission queries from db

---------

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-07-21 15:23:01 +01:00
Ieva
59eb2f68b7
AuthN: Lock down manual role updates for users synced through Grafana Com portal (#72044)
take into account auth.grafananet config section when checking if gcom auth is enabled
2023-07-21 15:22:28 +01:00
Gareth Dawson
4e42f9b619
Loki: Add the ability to prettify logql queries (#64337)
* pushed to get help of a genius

* fix: error response is not json

* feat: make request on click

* refactor: remove print statement

* refactor: remove unnecessary code

* feat: convert grafana variables to value for API request

* use the parser to interpolate and recover the original query (#64591)

* Prettify query: use the parser to interpolate and recover the original query

* Fix typo

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Fix typo

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* fix: reverse transformation not working

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Gareth Dawson <gwdawson.work@gmail.com>

* fix: bugs created from merge

* refactor: move prettify code out of monaco editor

* fix: variables with the same value get converted back to the incorect variable

* refactor

* use consistent styling with bigquery

* fix: only allow text/plain and application/json

* fix: only make the request if the query is valid

* endpoint now returns application/json

* prettify from js

* WIP: not all cases are handles, code still needs cleaning up

* WIP

* large refactor, finished support for all pipeline expressions

* add tests for all format functions

* idk why these files changed

* add support for range aggregation expr & refactor

* add support for vector aggregation expressions

* add support for bin op expression

* add support for literal and vector expressions

* add tests and fix some bugs

* add support for distinct and decolorize

* feat: update variable replace and return

* fix: lezer throws an errow when using a range variable

* remove api implementation

* remove api implementation

* remove type assertions

* add feature flag

* update naming

* fix: bug incorrectly formatting unwrap with labelfilter

* support label replace expr

* remove duplicate code (after migration)

* add more tests

* validate query before formatting

* move tests to lezer repo

* add feature tracking

* populate feature tracking with some data

* upgrade lezer version to 0.1.7

* bump lezer to 0.1.8

* add tests

---------

Co-authored-by: Matias Chomicki <matyax@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2023-07-21 13:03:56 +01:00
Matias Chomicki
c84d689ce0
Loki: Enable Query Splitting by default (#72094)
* lokiQuerySplitting: enable feature flag by default

* Query stats: add special note for stats + splitting
2023-07-21 13:53:10 +02:00
Kyle Brandt
1df4d332c9
SSE: Use errutil to show better error messages in prod (#71658)
- include public message
- propagate data source query errors so they are shown as well to which fixes #70026
2023-07-21 06:38:29 -04:00
Alexander Weaver
ff48a145cc
Alerting: Add exported getters for PanelKey fields (#72064)
Add getters
2023-07-20 15:47:20 -05:00
Yuri Tseretyan
cbbbe2e6f6
SSE: DSNode to update result with names to make each value identifiable by labels (only Graphite and TestData) (#71246)
* introduce a function checkIfSeriesNeedToBeFixed to scan all value fields in the response and provide a function that updates Series so they can be uniquely identifiable. Only Graphite and TestData are checked.

* update `convertDataFramesToResults` to run this function and provide it to WideToMany
* update WideToMany to run the fix function if it is not nil
2023-07-20 14:44:12 -04:00
Matthew Jacobson
13121d3234
Alerting: Add contact point provisioning file export (#71692)
* Add contact point provisioning file export apis

* Regenerate api

* docs

* frontend

* add mock to tests

* Fix missing row-level export button on viewer role w/ prov. read

* Address review comments

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-07-20 14:35:56 -04:00
George Robinson
8dd3eb856d
Alerting: Improve performance of matching captures (#71828)
This commit updates eval.go to improve the performance of matching
captures in the general case. In some cases we have reduced the
runtime of the function from 10s of minutes to a couple 100ms.
In the case where no capture matches the exact labels, we revert to
the current subset/superset match, but with a reduced search space
due to grouping captures.
2023-07-20 09:07:00 +01:00
Jo
3300488667
AccessControl: Remove acmock.New from accesscontrol service tests (#71942)
* remove mock ac provider from service accounts

* remove mock ac provider from accesscontrol tests

* remove mock ac from ac service tests
2023-07-20 10:00:46 +02:00
Gábor Farkas
2c82a6b6c4
Traces: Enable showing trace ids (#71950)
* traces: enable showing trace ids by default

* removed unused imports
2023-07-20 07:59:38 +02:00
Steve Simpson
2d5300ce3a
gRPC Server: Instrument requests made to the server. (#71914)
* gRPC Server: Instrument requests made to the server.

Expose metrics from the gRPC server in order to monitor for failed responses
and response latency. Uses code from the already vendored weaveworks/common.

* Review comments.
2023-07-19 16:01:54 +02:00
Joey
090b8d61e2
Tracing: Remove newTraceViewHeader feature toggle (#71818)
* Remove TracePageHeader, uiFind, setTrace and many spanFindMatches

* Removed TracePageSearchBar

* Update useSearch

* Update filterSpans

* Update docs

* Updated tests

* Add trace to tests

* Remove feature toggle

* Renames in useSearch

* Renames in filter-spans

* Cleanup fixes

* Rename TracePageHeader

* Rename TracePageSearchBar

* Update test

* Update style for long urls

* Style and check
2023-07-19 14:31:58 +01:00
George Robinson
f1af0502db
Alerting: Add tests for matching captures (#71928)
This commit adds tests for matching captures, which we do not have
at present.
2023-07-19 12:52:26 +01:00
George Robinson
89dcaaf049
Alerting: Sort NumberCaptureValues in EvaluationString (#71927)
This commit changes extractEvalString to sort NumberCaptureValues
in ascending order of Var before building the output string. This
means that users will see EvaluationString in a consistent order,
but also make it possible to assert its output in tests.
2023-07-19 12:09:21 +01:00
Ieva
25c4292a5f
RBAC: search v1 permission filter part 1 - cleanup & updating tests (#71913)
* update tests and remove some AC disabled checks

* remove test for old permission filter builder
2023-07-19 10:37:27 +01:00
Ibrahim
600f623610
Adminstration: Feature toggle for feature toggle admin page (#71887) 2023-07-18 16:43:32 -04:00
Todd Treece
d280fedb3f
Chore: Wrap provisioning in dskit service (#71598) 2023-07-18 15:37:25 -04:00
Alexander Weaver
d6db9a5b3c
Alerting: Add exported constructor for panelKey (#71872)
Exported constructor for panelKey
2023-07-18 13:37:43 -05:00
Alexander Weaver
18b910e654
Alerting: Refactor annotation historian to isolate dashboard service dependency (#71689)
* Refactor annotation historian to isolate dashboard service dependency

* Export PanelKey

* Don't export parsePanelKey

* Remove commented out code
2023-07-18 08:18:55 -05:00
Andres Martinez Gotor
8f76647386
Chore: Update golangci-lint to v1.53.3 (#71771) 2023-07-18 10:03:35 +02:00
Kousik Mitra
60496fbae3
Chore: Return correct error for name taken and validation error on add/update datasource (#70465) 2023-07-17 16:27:19 +02:00
Matthew Jacobson
8c6cdf51fc
Alerting: No longer silence paused alerts during legacy migration (#71596)
* Alerting: No longer silence paused alerts during legacy migration

Now that we migrate paused legacy alerts to paused UA alert rules, we no longer need to silence them.
2023-07-17 09:37:53 -04:00
Giordano Ricci
c5d2d55654
Explore: Remove exploreMixedDatasource feature toggle (#71534) 2023-07-17 12:25:49 +01:00
Will Browne
a8577c21ba
Plugins: Migrate PluginStore mock to pre-existing fakes package (#71664)
* migrate to existing fakes package

* fix imports
2023-07-17 10:21:44 +00:00
ismail simsek
a8819dedcf
Chore: Remove prometheusAzureOverrideAudience feature toggle (#71599)
* Remove prometheusAzureOverrideAudience feature toggle

* Remove overrideAudienceAllowed flag
2023-07-16 23:30:14 +02:00
Todd Treece
52121b7165
Chore: Add grafana-apiserver (#70721)
* add grafana-apiserver
* remove watchset & move provisioning and http server to background
services
* remove scheme
* otel fixes (#70874)
* remove module ProvideRegistry test
* use certgenerator from apiserver package
* Control collector/pdata from going to v1.0.0-rc8 (as Tempo 1.5.1 would have it)
2023-07-14 12:22:10 -07:00
Andre Pereira
c1709c9301
Tempo: TraceQL query response streaming (#69212)
* Refactor Tempo datasource backend to support multiple queryData types.
Added traceId query type that is set when performing the request but doesn't map to a tab.

* WIP data is reaching the frontend

* WIP

* Use channels and goroutines

* Some fixes

* Simplify backend code.
Return traces, metrics, state and error in a dataframe.
Shared state type between FE and BE.
Use getStream() instead of getQueryData()

* Handle errors in frontend

* Update Tempo and use same URL for RPC and HTTP

* Cleanup backend code

* Merge main

* Create grpc client only with host and authenticate

* Create grpc client only with host and authenticate

* Cleanup

* Add streaming to TraceQL Search tab

* Fix merge conflicts

* Added tests for processStream

* make gen-cue

* make gen-cue

* goimports

* lint

* Cleanup go.mod

* Comments

* Addressing PR comments

* Fix streaming for tracel search tab

* Added streaming kill switch as the disableTraceQLStreaming feature toggle

* Small comment

* Fix conflicts

* Correctly capture and send all errors as a DF to client

* Fix infinite error loop

* Fix merge conflicts

* Fix test

* Update deprecated import

* Fix feature toggles gen

* Fix merge conflicts
2023-07-14 15:10:46 +01:00
Misi
dcf26564db
OAuth: Introduce user_refresh_token setting and make it default for the selected providers (#71533)
* First changes

* WIP docs

* Align current tests

* Add test for UseRefreshToken

* Update docs

* Fix

* Remove unnecessary AuthCodeURL from generic_oauth

* Change GitHub to disable use_refresh_token by default
2023-07-14 14:03:01 +02:00
Yuri Tseretyan
541bfe636d
SSE: Support for ML query node (#69963)
* introduce a new node-type ML and implement a command outlier that uses ML plugin as a source of data.
* add feature flag mlExpressions that guards the feature
2023-07-13 20:37:50 +03:00
Sofia Papagiannaki
32ff712e98
Swagger: Fix response for the search users endpoint (#71272)
* Regenerate OpenAPI specs for fetching the latest changes

* Fix swagger annotations for search users API
2023-07-13 11:35:03 +03:00
Gábor Farkas
e045860fbf
loki: generate dataplane-compliant logs dataframes (behind feature flag) (#69909)
* add feature flag

* prepare tests

* enable dataplane-format in loki-backend
2023-07-13 09:58:00 +02:00
Andres Martinez Gotor
9990d5025d
Chore: Embed CSV files with the test data source (#71435) 2023-07-13 09:34:40 +02:00
Yuri Tseretyan
64aa5465ac
Alerting: do not expand template for labels\annotations if value is not a template (#71492) 2023-07-12 14:53:40 -04:00
Ludovic Viaud
5099e88227
Transformation redesign (#70834)
Transformation redesign
2023-07-12 18:35:49 +02:00
Jo
9b22342b91
Auth: Move LDAP debug to Authentication menu (#71285)
* move LDAP page to Authentication

* tweak Auth menu showing permissions
2023-07-12 18:15:02 +02:00
Sven Grossmann
7e4e743a42
Logs: Add experimental table visualisation in Explore (#71120)
* add table visualisation for logs

* add `logsExploreTableVisualisation` feature flag

* add feature flag to visualisation switch

* fix english

* improve state when no data is present

* improve margin

* add missing prop to test

* add tests

* fix logs table height

* fix linting

* move visualisation toggle

* add field config overrides

* update tests

* fix explore test

* fix explore test

* add missing header and revert test changes

* use timefield from logsFrame.ts

* add TODO

* move to new file

* hide fields that should be hidden

* add test to hide fields

* remove unused lines
2023-07-12 15:52:42 +02:00
Misi
5efc3386d3
AuthZ: Extend /api/search to work with self-contained permissions (#70749)
* Search sql filter draft, unfinished

* Search works for empty roles

* Add current AuthModule to SignedInUser

* clean up, changes to the search

* Use constant prefixes

* Change AuthModule to AuthenticatedBy

* Add tests for using the permissions from the SignedInUser

* Refactor and simplify code

* Fix sql generation for pg and mysql

* Fixes, clean up

* Add test for empty permission list

* Fix

* Fix any vs all in case of edit permission

* Update pkg/services/authn/authn.go

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

* Update pkg/services/sqlstore/permissions/dashboard_test.go

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

* Fixes, changes based on the review

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-07-12 12:31:36 +02:00
Jo
e56b2cae00
MESA: Allow using synced permissions (#71377)
* wip

* cover authorize in org behavior

* revert export

* fix org tests

* change permissions nit
2023-07-12 13:28:04 +03:00
Sofia Papagiannaki
e21872bb15
SQLStore: Fix regression in PostgreSQL connection string (#71368)
* SQLStore: Fix connection string for PostgreSQL

* better testing
2023-07-11 16:47:35 +03:00
Andrej Ocenas
6f102ccad0
Flamegraph: Remove feature toggle for sandwich view and color schemes (#71305) 2023-07-11 14:58:43 +02:00
Kyle Brandt
f6a28cadbc
Alerting: (Chore/Instrumentation) Add traceID to logs with contextual logger (#71289)
Alerting: (Chore) Add traceID to logs with contextual logger
2023-07-11 10:59:52 +02:00
Matthew Jacobson
e3787de470
Alerting: Fix Alertmanager change detection for receivers with secure settings (#71307)
* Alerting: Make ApplyAlertmanagerConfiguration only decrypt/encrypt new/changed secure settings

Previously, ApplyAlertmanagerConfiguration would decrypt and re-encrypt all secure settings. However, this caused re-encrypted secure settings to be included in the raw configuration when applied to the embedded alertmanager, resulting in changes to the hash. Consequently, even if no actual modifications were made, saving any alertmanager configuration triggered an apply/restart and created a new historical entry in the database.

To address the issue, this modifies ApplyAlertmanagerConfiguration, which is called by POST `api/alertmanager/grafana/config/api/v1/alerts`, to decrypt and re-encrypt only new and updated secure settings. Unchanged secure settings are loaded directly from the database without alteration.

We determine whether secure settings have changed based on the following (already in-use) assumption: Only new or updated secure settings are provided via the POST `api/alertmanager/grafana/config/api/v1/alerts` request, while existing unchanged settings are omitted.

* Ensure saving a grafana-managed contact point will only send new/changed secure settings

Previously, when saving a grafana-managed contact point, empty string values were transmitted for all unset secure settings. This led to potential backend issues, as it assumed that only newly added or updated secure settings would be provided.

To address this, we now exclude empty ('', null, undefined) secure settings, unless there was a pre-existing entry in secureFields for that specific setting. In essence, this means we only transmit an empty secure setting if a previously configured value was cleared.

* Fix linting

* refactor omitEmptyUnlessExisting

* fixup

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-07-11 08:23:07 +02:00
Emil Tullstedt
5c19272065
Slug: Use urlencoding to support non-ASCII characters (#70691) 2023-07-10 21:05:39 +02:00
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
Jo
932c24986d
Auth: Resolve isGrafanaAdmin for debug logging (#71145)
resolve isGrafanaAdmin for debug logging
2023-07-10 11:14:51 +02:00
Jo
49e42d1a8d
AccessControl: Add resource permission deletion helper (#71222)
* add method for deleting managed resource permissions

* test method
2023-07-10 11:13:05 +02:00
Jo
a7aca983a5
AccessControl: Fix nuid permission deletion when deleting dashboards and folders (#71225)
* fix nuid permission deletion when deleting dashboards and folders

* fix lint
2023-07-10 11:12:04 +02:00
Misi
607670a9fa
Auth: Use SHA-1 for generating an ID for External Service Role (#71079)
* Use sha1 (160 bit hash)

* Update pkg/services/accesscontrol/database/externalservices.go

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

* Satisfy linter, clean up

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-07-10 09:47:33 +02:00
Sofia Papagiannaki
22147c6230
NestedFolders: Do not perform guardian checks for subfolders (#69769)
Nested folders: Do not perform guardian checks for subfolders

Permissions are inherited so if the parent has access then
the subfolder has access too
2023-07-07 21:26:01 +03:00