Commit Graph
14732 Commits
Author SHA1 Message Date
Mariell Hoversholm ea8d46dfd3 Merge remote-tracking branch 'origin/main' into grafana-git-ui-sync 2024-11-28 15:31:03 +01:00
Mariell Hoversholm ee71e18e2a POC/Provisioning: Gosec: Fix/ignore gosec violations (#97166) 2024-11-28 15:26:55 +01:00
Karl PerssonandEric Leijonmarck b2626a2d65 LoginAttempt: Add setting to control max number of attempts before user login gets locked (#97091)
* Add setting to adjust number of login attempts before user login gets locked

* Ensure at least one attempt can be made

* Update documentation with new setting

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

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-11-28 14:33:18 +01:00
Matheus Macabu f2b96593ea SQL: close rows to release connection (#97147)
* SQL: close rows to release connection

* dont return err from rows.Close()
2024-11-28 14:28:55 +01:00
Mariell Hoversholm a600cc6eb7 POC/Provisioning: Import: Apply folder nesting properly (#97143) 2024-11-28 14:03:26 +01:00
Georges Chaudy f6124344ba authnz: Fix panic in the authenticator and rename metric (#97150)
* Fix: panic

* suggestion
2024-11-28 14:03:54 +02:00
Roberto Jiménez Sánchez d8b1834139 [Prototyping] Update resources on github webhook events (#97113)
* Add replicator interface
* Use factory to create replicators
* Use replicator in import
2024-11-28 11:48:42 +01:00
Kévin GomezandIvan Ortega c8d3ea58f8 Support importing local cue modules when generating TS types with cog (#96876)
* Support importing local cue modules when generating TS types with cog

* Generate enums as unions of values instead of an actual `enum` statement

* Update transformers to use the new TS enums

* Update go workspaces

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2024-11-28 10:45:31 +01:00
Alexander Zobnin c8caf787d4 Zanzana: handle service accounts (#97123)
* add service account to the schema

* sync managed permissions for service accounts

* sync SA basic roles

* sync SA roles

* Fix endless loop in reconciler while read openfga
2024-11-28 10:41:30 +01:00
Mariell Hoversholm 2cc3fd7392 feat: pass resources directly 2024-11-28 09:39:44 +01:00
Mihai Doarna feecd30687 API key: Fix API key migration to service account (#97100)
fix api key migration to service account
2024-11-28 09:42:58 +02:00
Ryan McKinleyandMariell Hoversholm 67924e80cb POC/Provisioning: Use the parsed file object access to set fields (#97138)
* client and repo info

* set repo header info

* add ref to header info

* add comment

---------

Co-authored-by: Mariell Hoversholm <mariell.hoversholm@grafana.com>
2024-11-28 08:14:29 +01:00
Mariell Hoversholm 46640cd882 POC/Provisioning: Resources: Move resource interactions to own package (#97107)
* POC/Provisioning: Resources: Move client to its own package

* POC/Provisioning: Resources: Move parsing to resources package

* POC/Provisioning: Test: Align disco response
2024-11-28 08:06:49 +01:00
Sarah Zinger 4b234c4795 Add logging to legacy datasource look up path (#97065) 2024-11-27 14:32:06 -05:00
Mariell Hoversholm a990f67b51 POC/Provisioning: Import: Don't set folder if one should not be set 2024-11-27 15:22:41 +01:00
Ryan McKinley 210b956917 POC/Provisioing: Show list in API (#97090) 2024-11-27 17:09:59 +03:00
Adam Yeats b898a4540d Azure Monitor: Add a feature flag to toggle user auth for Azure Monitor only (#96858)
* Azure Monitor: Add a feature flag to toggle user auth for Azure Monitor only

* Fix condition for userIdentityEnabled

* Re-add removed test

* Remove unused prop

* Refactor onAuthTypeChange in AzureCredentialsForm

* Add frontend unit tests

* Lint
2024-11-27 14:01:54 +00:00
Mariell Hoversholm b5b43112d1 POC/Provisioning: Import: Create and set the appropriate folder (#97097) 2024-11-27 14:40:40 +01:00
Sriram 16c78f6a98 Postgres: Datasource health check error message improvements #96906 (#96990)
* updated postgres health check error messages

* addressed review comments / added tests
2024-11-27 13:14:44 +00:00
Alexander Zobnin 5a91ab46af Zanzana: Use StreamedListObjects to fetch full list of resources (#97025)
* Initial streamed version of list

* instantiate openfga client to use StreamedListObjects

* Add config option for using streamed version

* Use caching

* fix cache init

* Fix hashing

* refactor
2024-11-27 14:05:41 +02:00
Misi 84b8296ffb OAuth: Use the attached external session data in OAuthToken and OAuthTokenSync (#96655)
* wip

* wip + tests

* wip

* wip opt2

* Use authn.Identity struct's SessionToken

* Merge fixes

* Handle disabling the feature flag correctly

* Fix test

* Cleanup

* Remove HasOAuthEntry from the OAuthTokenService interface

* Remove unused function
2024-11-27 11:06:39 +01:00
Roberto Jiménez Sánchez 364637a7e2 [Prototyping] Listen to pull requests and comment (#97040)
* Listen to Pull Requests and comment

* Fix template
2024-11-27 10:38:10 +01:00
Gabriel MABILLE 6e2d3cae5e AuthN: Register flags for grpc_server_authentication configuration (#97063)
* AuthZServer: Add authenticator

* Add flags
2024-11-27 10:35:35 +01:00
Mariell Hoversholm ee91485b32 POC/Provisioning: Create an import endpoint (#97085)
* wip

* fix: don't panic on dirs

* fix: workaround dashboard Get returning 500 on 404
2024-11-27 10:10:29 +01:00
Carl Bergquist 722af820a5 Scopes: Use new flag + app_mode=prod in integration tests (#97081)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2024-11-27 09:38:54 +01:00
Ryan McKinley ab2f168b71 fix test 2024-11-27 11:19:05 +03:00
Karl Persson be54c69fd4 Zanzana: Remove create relation from generic resources (#97042)
Remove create relation from generic resources.

We cant have a create relation to a resource because they don't exist yet. So
in oder to check create we either have to have that permissions on a folder or the namespace
2024-11-27 09:02:29 +01:00
Carl Bergquist 21bd47e512 scopes: behind its own feature flag (#97077)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2024-11-27 08:58:25 +01:00
Ryan McKinley 552a13f0ec fix lint 2024-11-27 09:57:33 +03:00
Ryan McKinley 7a7d6d0c2d POC/Provisioning: Use a single feature toggle to turn on required APIs (#97075) 2024-11-27 09:29:31 +03:00
Ryan McKinley 03c43ae467 merge main 2024-11-27 09:26:00 +03:00
Ryan McKinley f6ccf976e5 UnifiedSearch: Use ResourceIndex from dashboards apiserver (v0alpha1 only) (#96939) 2024-11-27 07:57:53 +02:00
NihalandMatthew Jacobson e73bb34cc0 Alerting: Fix Conflicting Alert Rule Response Has Wrong 'rule_uid' (#95013)
* change to return the right conflicting alert rule uid. see https://github.com/grafana/grafana/issues/89755

Signed-off-by: wasim-nihal <sswasim64@gmail.com>

* correcting the code comment

Signed-off-by: wasim-nihal <sswasim64@gmail.com>

* changes to return the conflicting uid for both insert and update operations

Signed-off-by: wasim-nihal <sswasim64@gmail.com>

* changes to return verbose conflicting alert rule response payload

Signed-off-by: wasim-nihal <sswasim64@gmail.com>

* changes to return verbose conflicting alert rule response payload

Signed-off-by: wasim-nihal <sswasim64@gmail.com>

* Update pkg/services/ngalert/store/alert_rule.go

Co-authored-by: Matthew Jacobson <JacobsonMT@gmail.com>

---------

Signed-off-by: wasim-nihal <sswasim64@gmail.com>
Co-authored-by: Matthew Jacobson <JacobsonMT@gmail.com>
2024-11-26 15:13:31 -05:00
Roberto Jiménez Sánchez 5327c321f1 [Prototyping] validate branch name in backend (#97061)
* Validate branch name

* Add more positive cases

* Make the logic more readable
2024-11-26 20:55:37 +01:00
Eric Leijonmarck 83d050ee1c LBAC for datasources: Adds UID to LBAC rules (#96522)
* swagger

* update with deprecation notice

* adding caching for teams
2024-11-26 16:35:04 +00:00
Matias Chomicki d2b6960593 Feature toggles: remove lokiMetricDataplane (#97024)
* Feature toggles: remove lokiMetricDataplane

* Framing: remove test cases expecting metricDataplane to be false

* Remove test code

* Chore: rename test cases
2024-11-26 18:32:17 +02:00
Gareth Dawson 217a2bce0a MSSQL: Make error consistent with psql and mysql (#97056)
make error consistent with psql and mysql
2024-11-26 17:47:14 +02:00
Karl Persson 76f052e8de Requester: Remove duplicated function (#97038)
* Remove duplicated function

* Remove GetDisplayName from interface

* Use GetName
2024-11-26 15:29:31 +01:00
Arati R. 6d04023aa6 K8s/Folders: Improve k8s client implementation of get (#96434)
* Enable getting folders with kubernetes client
* Add TestIntegrationFolderGetPermissions
* Set full path as part of legacy get
* Replace implementation for setting fullpath
* Add folder get test
* Escape forward slash in parent titles
* Replace test for access control metadata
* Add test case to TestIntegrationFolderGetPermissions
* Improve fetching of access control
2024-11-26 16:20:00 +02:00
e4a1243948 Alerting: Consume k8s API for notification policies tree (#96147)
* Add basic usage of K8s API for notification policies

* Add permissions checks for navtree for routes

* Add and update permissions for routing tree logic

* Add capability to skip calling contact points hook

* Conditionally show list of mute timings depending on permissions

* Conditionally link to mute timings if user can see at least one

* Add work in progress k8s handlers for routing tree

* Update notification policy hooks

* Wire up policies to permissions better (conditionally calling APIs)

* Add additional checks for whether to show grafana AM

* Add permission checks to access control

* Remove accidental permissions after rebase

* Update types and const for k8s routes

* Improve statefulness and reset routing tree in tests

* Update notif policy tests to check k8s and config API

* Fix type assertion

* Move non-grafana test out of .each

* Make failure case safer

* Override tag invalidation for notification policies API

* Pass in error and add new error alert component

* Add basic mock server conflict check

* Add test to check user can save after a conflict

* Add logic to allow reloading policies if changed by another user

* Fix test

* Update translations in Modals

* Add ViewAlertGroups ability

* Tweak provisioning logic and memoize AM config response

* Update snapshots for useAbilities

* Update result destructure

* Use enums for provenance in routingtrees

* Use consistent memoisation

* Fix _metadata for vanilla AM

* useAsync for error / update state

* move k8s api error handling to separate file

* use cause for error codes

* Use `supported` bools from Alertmanager abilities and clarify default policy

---------

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2024-11-26 13:46:39 +00:00
Ezequiel Victorero 5039725da6 Snapshots: Add RBAC roles for creating and deleting (#96126) 2024-11-26 09:13:17 -03:00
Roberto Jiménez Sánchez baca7c250e [Prototyping] Ensure git branch exists in write operations for github repositories (#96998)
* Create branch when ref is passed

* Change approach to ensure branch already exists

* Fix error handling branch not found
2024-11-26 12:26:04 +01:00
Gareth Dawson 768000febd Postgres: Add error source to postgresql (#97027)
* add error source to postgres

* i forgot to save the file with changes
2024-11-26 11:23:49 +00:00
Hugo Kiyodi Oshiro a8174f9285 Plugins: Add token to gcom requests (#96261) 2024-11-26 11:42:55 +01:00
Gareth DawsonandIvana Huckova 3b8499eaee MySQL: add error source to QueryData (#96769)
* add error source to mysql

* Update pkg/tsdb/mysql/sqleng/sql_engine.go

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

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2024-11-26 10:25:48 +00:00
Ryan McKinley 8a2e233dcd POC/Provisioning: Fail read/write when we can not find a valid GVR (#97020)
GRV
2024-11-26 09:44:20 +01:00
Karl Persson 3990637af9 IAM: remove duplicated functions (#96989)
* Remove duplicated function and use the one provided by claims package
2024-11-26 09:22:45 +01:00
Serge Zaitsev 3dbd3a7a81 Chore: Revert golangci PR + bump golangic version (#96326)
* Chore: Clean up some excludes and fix makefile (#96052)

clean up some excludes and fix makefile

* Chore: Enable cache on golangci linter (#95471)

* try to enable cache on golangci linter

* bump version

* exclude G115

* reduce timeout

* remove deprecated linter

* bump linter version in bingo

* try a different syntax for workspace modules

* try another command

* add apps to linter path

* try disabling cue codegen

* skip some linting in devenv

* exclude dirs and try again

* try workaround for pkg

* try path instead of dir

* make it one line

* replace package prefix

* exclude xorm

* exclude wire

* file-based aproach to nolint in workspaces

* missing quote

* simplify command line

* change ownership

* upgrade linter

* revert bingo readme

* revert devenv changes

* upgrade golint

* use dashes to stay consistent with other workflows

* also change name in its own workflow file

* rename in codeowners
2024-11-26 09:19:53 +01:00
Ryan McKinley 3640752dd0 add more reserved names 2024-11-26 10:12:30 +03:00
Brendan O'Handley 287ce2ef40 Prometheus: Add error source, don't swallow errors (#96511)
add error source, don't swallow errors
2024-11-25 10:30:13 -06:00