Commit Graph

7855 Commits

Author SHA1 Message Date
Gabriel MABILLE
b68b69c2b4
AuthN: Use tokens for unified storage server authentication (#95086)
* Extract server code

---------

Co-authored-by: Claudiu Dragalina-Paraipan <drclau@users.noreply.github.com>
2024-10-23 15:04:15 +02:00
Eric Leijonmarck
9ab064bfc5
Folders: Add admin permissions upon creation of a folder w. SA (#95072)
* add admin permissions upon creation of a folder w. SA

* Update pkg/services/folder/folderimpl/folder.go

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

* Grant service account permissions for creation of dashboards

* Grant service account admin permissions upon creating a datasource

* fetch user using the userservice with the userid

* Revert "fetch user using the userservice with the userid"

This reverts commit 23cba78752.

* revert back to original datasource creation

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-10-23 14:02:22 +01:00
Matias Chomicki
2573cbec08
Loki: Added support to split queries by stream shard (#94245)
* Add shard query splitting implementation

* Shard query splitting: reuse function from query splitting

* Shard query splitting: remove max line limit

* Shard query splitting: update test

* Shard query splitting: fix types and non-sharded queries

* Merge responses: fix log merging

* Merge responses: remove legacy code

* Query splitting: add support to retry failed requests

* Query splitting: unit test request retrying

* Query splitting: add unsubscriptions

* Shard query splitting: fix retrying

* Shard query splitting: switch to dynamic grouping

* Shard query splitting: update group size thresholds and fix -1 query

* Shard query splitting: update initial group size + don't retry parse errors

* Shard query splitting: update unit test

* chore: update mock value

* Shard query splitting: add support for multiple targets

* chore: update description

* Shard query splitting: use group targets

* chore: filter hidden queries

* Shard query splitting: issue initial log query without sharding

* Splitting: fix retrying in both methods

* Merge responses: keep execution time

* Shard query splitting: remove no-shard attempt

* Shard query splitting: adjust groups based on rate of change

* chore: clean up experiments

* Shard query splittng: remove log query restrictions

* Shard query splitting: remove fallback to time splitting

* Loki: add new query direction

* Missing generated file

* LokiOptionField: integrate new query direction

* Shard query splitting: delegate non-scan queries to time splitting

* Query splitting: do not retry queries with parse errors

* Loki datasource: add placeholder for feature flag

* Shard query splitting: add function with support criteria

* Shard query splitting: refactor query modification and shard logs volume

* Shard query splitting: update unit tests

* chore: Update scan direction tooltip

* chore: formatting

* LogsVolumePanel: fix missing state in logs volume panel data

* Merge responses: better handle missing nanoseconds

* LokiQueryOptionFields: display query direction for log queries

* loki: process scan direction as backward

* Loki datasource: restrict sharding to Explore

* Retrying: invert criteria and move to response utils

* Formatting

* Use log volume refId constant

* Fix import order

* Create feature flag

* Use feature toggle

* LogsVolumePanel: prevent flashing no data while streaming
2024-10-23 14:21:03 +03:00
Josh Hunt
2cf6a6388b
Combobox: Add prometheusUsesCombobox feature toggle (#95238)
Add prometheusUsesCombobox feature toggle
2024-10-23 12:18:33 +01:00
Torkel Ödegaard
b700de8122
Dashboard: New layouts feature toggle and basic skeleton for a responsive grid layout (#94805)
* Wip

* Update

* Fix adding new panels

* reuse fromVizPanels

* Fixes

* Update

* Update

* Update

* Fixes

* Update
2024-10-23 10:55:45 +02:00
Gábor Farkas
1dbbbd9ca7
query: handle the x-rule-uid header (#95223) 2024-10-23 10:49:54 +02:00
Karl Persson
6f7528f896
Migration: Remove table aliasing in delete statement to make it work for mariadb (#95226)
Migration: remove table aliasing in delete statement to make it work in mariadb
2024-10-23 10:49:20 +02:00
Gábor Farkas
3a719a2cfd
api: use alerting headers (#95118)
* api: use alerting headers

* improve code, add integration test

* better comment

* fixed test

* merged tests
2024-10-23 09:39:22 +02:00
Matthew Jacobson
26162a53e6
Alerting: Allow config api receiver create/delete with alertingApiServer (#95207)
Previously all receiver modifications were denied with alertingApiServer
enabled. This allows pure creates and deletes through as these specific
cases can be handled simply and without risk of rbac shenanigans.
2024-10-22 16:54:05 -04:00
Gabriel MABILLE
7aeb1adff2
Fix: Check JSON data is not nil (#95189)
* Fix: Fix panic when json data are nil

* Use Interface()

* Feedback

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Need to check inside the if statement

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-10-22 18:09:44 +01:00
Will Browne
25abd57029
Plugins: Update to latest go plugin SDK (0.256.0) (#95065)
* update to latest go plugin SDK

* make update-workspace

* update alerting tests
2024-10-22 15:44:53 +01:00
Matthew Jacobson
4aad44e848
Alerting: Fix per-receiver RBAC for receivers with long names (#95084)
* Implement uidToResourceID

* add middleware

* Move uidToResourceID to alerting package

* Only hash uid if it's too long

* Use hashed uid in access control

* Move ReceiverUidToResourceId to ScopeProvider

* resolve uid in middleware only if param exists

* Tests

* Linting

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-10-22 10:04:13 -04:00
Alexander Zobnin
e709de603d
Chore: Init auth model on server side (#95142)
* Chore: Init auth model on server side

* fix linter
2024-10-22 14:50:52 +02:00
Gabriel MABILLE
0704ae734f
AuthZ: Refactor authentication modes for the Authz package (#95120)
* AuthZ: Fix authentication modes for the Authz package

Co-Authored-By: Claudiu Dragalina-Paraipan <drclau@users.noreply.github.com>
2024-10-22 13:38:59 +02:00
Andrej Ocenas
3bf3290340
Grafana/ui: TimeRangePicker with automatic sync across instances (#94074) 2024-10-22 12:52:33 +02:00
Tito Lins
71d04a326b
Alerting: Support tls config for webhook receiver (#93513)
Adds the ability to configure tls settings on the webhook receiver (e.g. to skip server certificate validation)
2024-10-22 12:44:32 +02:00
linoman
3270a9c959
Session Refactor: Add auth module label to session's list (#94958)
* Add AuthModule to token API

* Add badge to UserSessions

* Change idp label rendering

* Render IdP label for User Profile page

* Add i18n labels
2024-10-22 10:57:36 +02:00
Alexander Akhmetov
d0481bb568
Alerting: Refactor state manager Warm method to accept instance store as an argument (#95098) 2024-10-22 09:45:50 +02:00
Santiago
4f8f82f5f1
Alerting: Fix remote Alertmanager readiness check path (#95063) 2024-10-21 17:24:51 +02:00
Yuri Tseretyan
19a1d9d188
Fix: Initialize tracer in file provisioning (#95007)
initialize tracer
2024-10-21 10:03:58 -04:00
Karl Persson
b4366ebed2
Zanzana: bootstrap authz server (#95036)
Bootstrap authz extended server
2024-10-21 14:58:57 +02:00
linoman
640bc0de97
SSO SAML: Remove SettingProvider settings from SSO interactions (#94900)
* Remove SettingProvider settings from SSO interactions

* Mock Settings Provider for SSO Settings test

* Ignore error from SettingsProvider

* Add test for backend
2024-10-21 11:28:55 +02:00
Dana Axinte
98e5048370
CloudMigration - Display different error messages for create migration errors (#94683)
* start on tokens

* more error messages

* more handling

* rephrased with suggestions from Daniel

* separate gms parse method

* use translation

* refactor initial idea to use error obj

* use error dto result

* handle gms client

* clean logs and comments

* fix tests

* tests for gms

* test and lint

* lint

* one more handling from gms

* typing in fe

* use error interface

* use validation error

* remove unused gms error

* use errorlib and helper function in fe

* regen api

* use same error util

* one more error to handle
2024-10-21 09:45:54 +01:00
William Wernert
0920e8bcc6
Alerting: Clear ignored fields of recording rules for API response (#95004)
* Clear ignored fields of recording rules for API response

* Move field clearing to compat function

* Run make update-workspace

* Cleanup changes
2024-10-19 01:03:12 +03:00
lean.dev
3438196010
Anonymous User: Adds validator service for anonymous users (#94700) 2024-10-18 13:10:41 -03:00
William Wernert
053a806ab1
Alerting: Validate namespace when updating rules through the provisioning API (#94643)
* Also validate folder on provisioning update

* Move folder check before auth check

When checking for the existence of a folder we go through the folder
service which requires auth. Doing so prevents an unprivileged user from
accessing information about whether a particular folder exists or not.
2024-10-18 18:21:26 +03:00
Alexander Zobnin
2baf4883cc
Zanzana: add action sets to dashboard and folder schema (#94602) 2024-10-18 16:58:30 +02:00
Karl Persson
a82d01214d
Auth: Update authlib (#94947)
* Update authlib
2024-10-18 13:36:21 +02:00
Alexander Akhmetov
0b804e720f
Alerting: Add RuleGroup field to ListAlertInstancesQuery struct (#94615)
Alerting: add RuleGroup field to ListAlertInstancesQuery struct
2024-10-18 09:44:16 +02:00
Santiago
4c15266a77
Alerting: Add X-Remote-Alertmanager header to the remote AM client (#94913) 2024-10-17 22:38:13 +02:00
Charandas
2fd4fe40f0
K8s: for tests to use kubectl access, port-forwarding requires 0.0.0.0 (#94836) 2024-10-17 11:15:57 -07:00
Matheus Macabu
8673c757a5
CloudMigrations: only append notification policy if feature flag is on and it exists (#94896) 2024-10-17 17:15:30 +02:00
Karl Persson
4083b2208e
Zanzana: periodic sync of team members (#94752)
* Rewrite zanzana collector to fetch all available pages

* Register access control as a background service

* If zanzana is enabled we run Syncs and start Reconciliation job

* Update pkg/services/authz/zanzana/client/client.go

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

* Use server lock when doing performing reconciliation
2024-10-17 15:28:33 +02:00
Dana Axinte
a50507e645
CloudMigration: Interpret error code from migration resource item (#94407)
* start on loading the error code

* error code to message mapping

* use resource code type

* use defined error code

* partial updates from comments

* i18nKey gen

* fixed t

* fixed translations

* typing
2024-10-17 14:09:09 +01:00
Matheus Macabu
1051561154
CloudMigrations: create snapshot for Notification Policies (#94852)
* CloudMigrations: create snapshot for Notification Policy

* CloudMigrations: add notification policy constants and components

* CloudMigrations: add uid to resources that have it
2024-10-17 14:58:05 +02:00
Eric Leijonmarck
a46ff09bf9
LBAC for datasources: Override lbac rules if present when updating via datasources endpoints (#94608)
bloc updates to datasources
2024-10-17 11:29:30 +01:00
Ryan McKinley
3457f219be
Storage: Add blob storage interfaces (#90932)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-10-17 12:18:29 +02:00
Ashley Harrison
ba6829f4a7
Topnav: Remove from feature toggle registry + hardcode in config (#94736)
remove topnav from feature toggle registry + hardcode to true
2024-10-17 10:18:30 +01:00
Misi
50a635bc7e
Auth: Introduce authn.SSOClientConfig to get client config from SSOSettings service (#94618)
* wip

* possible solution

* Separate interface for SSO settings clients

* Rename interface

* Fix tests

* Rename

* Change GetClientConfig to comma ok idiom
2024-10-16 16:27:44 +02:00
Ieva
ca1fd028a2
Service Accounts: Run service account creation in transaction (#94744)
* run service account creation DB queries in transaction

* extract the signed in user from the context

* undo unneeded change

* don't error out if a user is not found

* Update pkg/services/serviceaccounts/manager/service.go

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

* Update pkg/services/serviceaccounts/manager/service.go

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

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-10-16 11:45:21 +01:00
Arati R.
65fc7cf004
K8s/Folders: Fix mode 2 folder creation (#94796)
* Use user UID as identifier instead of ID
* Remove malformed error
2024-10-16 10:44:09 +02:00
Igor
0a255ac5fb
ShareInternally: Make stale short link expiry optional (#88137)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Irene Rodriguez <irene.rodriguez@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2024-10-16 11:36:54 +03:00
Karl Persson
7fba9ba522
SA: Fix name validation so we can prevent creating service account with protected prefix (#94762)
Fix name validation so we can prevent creating service account with protected prefix
2024-10-16 10:27:06 +02:00
Alexander Akhmetov
bfbbdf5efb
Alerting: Default pending period (for) to 0s when the rule is created using file provisioning (#94646)
Alerting: default for to 0s when the rule is created using file provisioning
2024-10-16 10:15:10 +02:00
Charandas
b4234cb06e
K8s: add aggregator metrics (#94579) 2024-10-15 12:41:27 -07:00
Stephanie Hingtgen
644a16048f
K8s: add feature toggle for dashboard backend (#94753) 2024-10-15 14:30:05 -05:00
Alexander Zobnin
9f1b584c85
Chore: Update authlib version (#94714)
* Chore: Update authlib version

* update workspace

* use ParseNamespace()
2024-10-15 16:58:46 +02:00
Matheus Macabu
47115c714a
CloudMigrations: create snapshot for Contact Points (#94719)
* CloudMigrations: create snapshot for Contact Points

* CloudMigrations: add contact point copies and components in frontend

* CloudMigrations: temporarily use bell for all alerts resources
2024-10-15 16:27:28 +02:00
Gabriel MABILLE
ba3629c01c
Fix: Account for conflicting logins in dedupOrgInlogin migration (#94669) 2024-10-15 15:02:34 +02:00
Marcus Efraimsson
b28085110d
Plugins: Auto instrumentation improvements (#94193) 2024-10-15 14:02:34 +02:00