Commit Graph

10772 Commits

Author SHA1 Message Date
Will Browne
12dc56ad0c
Plugins: Refactor plugin repository API (#69063)
* support grafana wildcard version

* undo go.mod changes

* tidy

* flesh out tests

* refactor

* add tests

* tidy naming

* undo some changes

* split interfaces

* separation

* update new signature

* simplify

* update var namings

* unexport types

* introduce opts pattern

* reorder test

* fix compat checks

* middle ground

* unexport client

* move back

* fix tests

* inline logger

* make client usable

* use fake logger

* tidy errors

* remove unused types

* fix test

* review fixes

* rework compatibility

* adjust installer

* fix tests

* opts => cfg

* remove unused var

* fix var name
2023-05-30 11:48:52 +02:00
MichaelKo
e7e70dbac6
Chore: Adding "allowed_groups" Configuration Parameter to Generic OAuth Method (#69025)
* feat: add allowed_groups for Generic OAuth

* docs: add allowed_groups more docs for Generic OAuth
2023-05-30 11:07:04 +02:00
Juan Cabanas
9890ff7c92
PublicDashboards: Audit table redesign (#68137) 2023-05-29 12:59:29 -03:00
Sofia Papagiannaki
74e87ccbbd
SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations (#69224)
* Add integration test for primary key and unique constrain violation

* Align SQLite IsUniqueConstraintViolation implementation with other backends
2023-05-29 14:45:08 +00:00
Ivan Ortega Alba
cb83861630
Improve Dashboards schema docs (#68904)
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
2023-05-29 15:15:28 +03:00
Ryan McKinley
effe21fb65
TestData: Support labels in CSV content name (#61337)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2023-05-26 19:36:43 +03:00
enginecan
6758fd4888
MySQL: Add option to allow cleartext passwords (#63232)
* Add "Allow Cleartext Passwords" checkbox to MySQL connection settings

* Fix lint issues

* Add docs

* Add line break and bold text

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2023-05-26 12:33:55 +02:00
Eng Zer Jun
7f7b03d794
Chore: Avoid unnecessary byte/string conversions (#69001)
Avoid unnecessary byte/string conversion

We can use alternative functions/methods to avoid unnecessary
byte/string conversion calls.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-05-26 10:08:50 +00:00
Dimitris Sotirakis
515270f5fd
GoogleAPI: Add retries functionallity to GoogleAPI calls (#69129)
* Add retryer to GoogleAPI calls

* Add comment
2023-05-26 12:59:56 +03:00
Misi
6702f07a87
AuthN: Use EqualFold for skipping introspection endpoint (#69126)
Add equality check for introspect ep in basic.go
2023-05-26 10:22:59 +02:00
Selene
bd622a5381
Chore: Unify references for dataquery (#68963)
* Unify references for dataquery

* Fix ResultFormat in azure types

* Update azure-log with new schema

* Fix cloudwatch query

* Update thema

* Fix test

* More fixes

* More fixes

* Fix lint
2023-05-26 10:16:01 +02:00
Domas
ae1e40dcc6
Navigation: Add app observability plugin to Observability navigation group (#68805)
* add app o11y plugin to monitoring nav group

* Update applinks.go
2023-05-26 09:41:09 +03:00
Matthew Jacobson
97ae6ae6ef
Alerting: Fix flaky TestIntegrationUpdateAlertRules (#69106)
Prevents duplicate alert rule ids and 0 value for BaseInterval and IntervalSeconds
2023-05-25 16:00:06 -04:00
Yuri Tseretyan
b57ef1f2c7
Alerting: Fix TestIntegration_GetAlertRulesForScheduling to make sure rules are created in different org (#69088)
make sure rules are created in different org
2023-05-25 13:51:38 -04:00
Sladyn
a06a5a7393
Alerting: Improve log messages (#67688)
* Rename base logger and capatilize messages
* Remove cflogger from config.go
2023-05-25 18:55:01 +03:00
Yuri Tseretyan
e00260465b
Alerting: Fix provenance guard checks for Alertmanager configuration to not cause panic when compared nested objects (#69009)
* fix current settings parsed as new
* replace map comparison with cmp.Diff and log the diff
2023-05-25 11:41:11 -04:00
Gabriel MABILLE
edf1775d49
AuthN: Embed an OAuth2 server for external service authentication (#68086)
* Moving POC files from #64283 to a new branch

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* Adding missing permission definition

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* Force the service instantiation while client isn't merged

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* Merge conf with main

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* Leave go-sqlite3 version unchanged

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* tidy

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* User SearchUserPermissions instead of SearchUsersPermissions

* Replace DummyKeyService with signingkeys.Service

* Use user🆔<id> as subject

* Fix introspection endpoint issue

* Add X-Grafana-Org-Id to get_resources.bash script

* Regenerate toggles_gen.go
* Fix basic.go

* Add GetExternalService tests

* Add GetPublicKeyScopes tests

* Add GetScopesOnUser tests

* Add GetScopes tests

* Add ParsePublicKeyPem tests

* Add database test for GetByName

* re-add comments

* client tests added

* Add GetExternalServicePublicKey tests

* Add other test case to GetExternalServicePublicKey

* client_credentials grant test

* Add test to jwtbearer grant

* Test Comments

* Add handleKeyOptions tests

* Add RSA key generation test

* Add ECDSA by default to EmbeddedSigningKeysService

* Clean up org id scope and audiences

* Add audiences to the DB

* Fix check on Audience

* Fix double import

* Add AC Store mock and align oauthserver tests

* Fix test after rebase

* Adding missing store function to mock

* Fix double import

* Add CODEOWNER

* Fix some linting errors

* errors don't need type assertion

* Typo codeowners

* use mockery for oauthserver store

* Add feature toggle check

* Fix db tests to handle the feature flag

* Adding call to DeleteExternalServiceRole

* Fix flaky test

* Re-organize routes comments and plan futur work

* Add client_id check to Extended JWT client

* Clean up

* Fix

* Remove background service registry instantiation of the OAuth server

* Comment cleanup

* Remove unused client function

* Update go.mod to use the latest ory/fosite commit

* Remove oauth2_server related configs from defaults.ini

* Add audiences to DTO

* Fix flaky test

* Remove registration endpoint and demo scripts. Document code

* Rename packages

* Remove the OAuthService vs OAuthServer confusion

* fix incorrect import ext_jwt_test

* Comments and order

* Comment basic auth

* Remove unecessary todo

* Clean api

* Moving ParsePublicKeyPem to utils

* re ordering functions in service.go

* Fix comment

* comment on the redirect uri

* Add RBAC actions, not only scopes

* Fix tests

* re-import featuremgmt in migrations

* Fix wire

* Fix scopes in test

* Fix flaky test

* Remove todo, the intersection should always return the minimal set

* Remove unecessary check from intersection code

* Allow env overrides on settings

* remove the term app name

* Remove app keyword for client instead and use Name instead of ExternalServiceName

* LogID remove ExternalService ref

* Use Name instead of ExternalServiceName

* Imports order

* Inline

* Using ExternalService and ExternalServiceDTO

* Remove xorm tags

* comment

* Rename client files

* client -> external service

* comments

* Move test to correct package

* slimmer test

* cachedUser -> cachedExternalService

* Fix aggregate store test

* PluginAuthSession -> AuthSession

* Revert the nil cehcks

* Remove unecessary extra

* Removing custom session

* fix typo in test

* Use constants for tests

* Simplify HandleToken tests

* Refactor the HandleTokenRequest test

* test message

* Review test

* Prevent flacky test on client as well

* go imports

* Revert changes from 526e48ad45

* AuthN: Change the External Service registration form (#68649)

* AuthN: change the External Service registration form

* Gen default permissions

* Change demo script registration form

* Remove unecessary comment

* Nit.

* Reduce cyclomatic complexity

* Remove demo_scripts

* Handle case with no service account

* Comments

* Group key gen

* Nit.

* Check the SaveExternalService test

* Rename cachedUser to cachedClient in test

* One more test case to database test

* Comments

* Remove last org scope

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

* Update pkg/services/oauthserver/utils/utils_test.go

* Update pkg/services/sqlstore/migrations/oauthserver/migrations.go

Remove comment

* Update pkg/setting/setting.go

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

---------

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>
2023-05-25 15:38:30 +02:00
Gilles De Mey
73681a251e
Alerting: Add support for Alert State History Loki primary (#69065)
add support for multiple ash targets with loki as primary
2023-05-25 16:09:44 +03:00
Jean-Philippe Quéméner
5717d8954f
Alerting: Return empty list on export if no rules exist (#69023) 2023-05-25 14:12:18 +02:00
Misi
df4db412cb
Auth: Fix visibility of the Invite button on /admin/users page (#68991)
* Fix for invite button visibility

* Align test
2023-05-25 13:58:41 +02:00
Giuseppe Guerra
e8c1592a47
Datasources: Deprecate and log creating/updating datasources with invalid UIDs (#68800)
* Datasources: Deprecate and log when creating/updating datasources with invalid UIDs

* trigger

* Update invalid uid deprecation log message

* capitalize log
2023-05-25 12:11:51 +02:00
Ryan McKinley
e7da2a179e
Schema: Add schema for role+access policies (#68047) 2023-05-24 10:31:57 -07:00
Yuri Tseretyan
3af95bebe1
Alerting: Migrate unknown NoData\Error settings to the default (#68403)
* use default execution if legacy is not known

* update docs

* Update docs/sources/alerting/migrating-alerts/migrating-legacy-alerts.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/migrating-alerts/migrating-legacy-alerts.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2023-05-24 13:09:17 -04:00
Ryan McKinley
c66d5721f7
Kinds: Use apimachinery ObjectMeta for metadata (#68668) 2023-05-24 09:13:44 -07:00
Ieva
9439649a4c
RBAC: remove unused dash and folder permission logic (#68968)
remove unused HasAdmin and HasEdit permission methods
2023-05-24 15:33:35 +01:00
Will Browne
ae373c662c
Plugins: Refactor env vars to dedicated service (#68960)
* add env vars service

* fix tests

* fix more tests
2023-05-24 14:02:14 +02:00
Ieva
4980b64274
RBAC: Remove legacy ac from authorization middleware (#68898)
remove legacy AC fallback from RBAC middleware, and some unused auth logic
2023-05-24 09:49:42 +01:00
sam boyer
323cbe1997
kindsys: Adapt to new flattened lineage syntax in Thema (#68034)
* Update all core kinds to flattened lineages

* Regen Go types, without any

* Regen Go types, s/interface{}/any/

* Update generated core typescript

* Update generate docs

* Fix defaults gen in veneer index jenny

* Flatten plugindef lineage

* Convert all plugin kinds to flattened form

* Switch back to interface{} for now

* Switch to fs.Sub in plugin DeclParser

* Mostly undesirable codegen changes, to be fixed

* Update mod and sum

* Update pfs tests to flattened lineages

* Update thema to latest, regen docs
2023-05-24 10:47:25 +02:00
Will Browne
286b9e08e9
Plugins: Bump Plugin SDK version and address instance management breaking changes (#68900)
* bump sdk and propagate ctx

* fix tests
2023-05-24 10:19:34 +02:00
Dimitris Sotirakis
7e816d010c
G10: Replace beta with preview references (#68347)
* Update references

* Update grabpl to v3.0.38
2023-05-24 09:46:07 +02:00
owensmallwood
b43206e26b
MySQL: Use transaction_isolation instead of tx_isolation (#68575)
will use the correct system var name for transaction isolation
2023-05-23 09:22:05 -06:00
Ryan McKinley
07e794c312
FeatureFlags: Do not allow spaces in descriptions (#68852) 2023-05-23 07:42:22 -07:00
Ieva
900348f3d9
Chore: remove tests for legacy AC, update other tests to work with RBAC (#68895)
* remove tests for legacy AC, update other tests to work with RBAC

* update usage stat tests to use RBAC
2023-05-23 15:29:20 +01:00
Taewoo K
7f84e83ffe
Datasource: datasource config page header redesign (#66999)
* Wip

* remove name input from page body

* render title & subTitle in datasource page in connections and remove unused prop - uid

* styling on actions button group

* remove unused props in edit datasource page

* set gap as 8px between buttons

* move editable datasourcename to the header

* add subTitle component

* remove useRef and use autoFocus prop

* pass false to isDefault  when dataSource is undefined

* change button text

* remove suffix icon

* remove unused import - Icon

* consolidate duplicate useDataSourceSettingsNav into datasrouces hook

* move dataSource context to useDataSourceSettingsNav

* remove Explore button in the footer

* remove unused props

* fix failing test on button group

* fix typo on file naming

* remove disabled prop

* fix param

* add test

* add test files

* disable editing title in readOnly provision datasource

* update name should save dataSource

* prevent swith toggle change from label clicking and change margin

* update tooltip message

* use datasource update on header instead of state update

* remvoe subTitle component and move subTitle component next to page Info component

* Added title

* remove subTitle in buildNavModel

* replace Button with Badge

* make datasourceheader as a component

* horizontal gap of 24px between pageInfo and actions components

* align page Info value items

* accept react node as page info label and add tooltip to Default item

* update navId for edit datasource page in connections

* update unit testing for Title

* fix gen_que

* betterer

* prettier fix

* fix e2e test

* add data-testid to nameEditIcon selector

* fix tooltip text

* fix navId for connections datasources edit page

* fix e2e selector: change autoSizeInput to Input

* adding ellipsis to EditDataSourceTitle

* override grafana-ui titleContainer h1 styles

* UI cleanup and apply readOnly to default datasource switch

* add period

* datasource name validation

* title and page info alignment

* add feature toggle - dataSourcePageHeader

* restore basicSettings component and apply feature toggle

* go lint

* Revert "title and page info alignment"

This reverts commit 681ac51f11.

* remove editable fields from page Header - name, default datasource switch

* fix go test: toggle generator

* remove test id

* remove alerting badge in BasicSettings component

* Revert "remove alerting badge in BasicSettings component"

This reverts commit fb33ff9028.

* feature toggle on alerting badge

* rename component & filename

* move DataSourceInfo type

* change button to link in test

---------

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Miguel Palau Zarza <mpalauzarza@gmail.com>
2023-05-23 09:18:00 -04:00
ZakharE
5e8bd48c3c
AzureMonitor: Remove simplejson
* tsdb: azuremonitor: Remove usage of simplejson

* Review fixes

* Fix lint errors; review fix
2023-05-23 12:01:49 +01:00
Jo
5e5c751ecd
Auth: Respect cache control for JWKS in auth.jwt (#68872)
* respect cache control for auth.jwt

* add documentation

* add small note on cache control header ignores

* make distinction of env
2023-05-23 12:29:10 +02:00
Dimitris Sotirakis
bad570ee86
Docker: Add mode label when building docker images (#68865)
Add mode label when building docker image
2023-05-23 10:37:52 +02:00
Ryan McKinley
26658d172f
Migrations: Support independent migration log for entity api (#68511) 2023-05-22 11:31:07 -07:00
Ryan McKinley
2c75a51285
Schema: Move TeamDTO properties out of the resource (#68155) 2023-05-22 11:30:36 -07:00
Ieva
d54fa569ec
Chore: Remove legacy AC checks from team (#68715)
* removing legacy AC checks from team API handlers

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

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

* fix typo

* remove redundant tests

* remove another unused function

* fix failing test
2023-05-22 18:41:53 +02:00
Andreas Christou
108acee08e
CloudMonitoring: Initial GCM Schema (#67739)
* Initial GCM schema work

- Split types for convenience
- Update conditionals where needed
- Update type references

* Add additional supporting types

* Add some more accessory and legacy types

* Add missing type

* Rename backend folder

* Add missing generated file

* Review
2023-05-22 17:19:54 +01:00
ismail simsek
670c987409
Prometheus: Update schema with legendFormat and intervalFactor (#68687)
add legendFormat and intervalFactor to the schema
2023-05-22 16:20:15 +02:00
Victor Marin
6dbadf614b
Datagrid: Hide from panel list if toggle disabled (#68482)
Hide datagrid from panel list if ff disabled
2023-05-22 15:34:41 +03:00
Jo
05e71d4c6b
AnonymousAuth: Fix concurrent read-write crash (#68637)
clone http req before tagging
2023-05-22 13:27:28 +02:00
Andreas Christou
bca8428f63
AzureMonitor: Support multi-resource aliases and subscription aliases (#68648)
Update legend aliases

- Add subscription response type
- Update AzureMonitorQuery type
- Update docs
- Update tests
- Add function to retrieve subscription display name if not present
2023-05-22 11:03:43 +01:00
Ryan McKinley
a7cec6dd03
Docs: Fix feature toggle docs generation (#68733) 2023-05-18 13:03:16 -07:00
Alyssa Bull
dfc2ac284b
Azure Monitor: Fix bug with top value so more than 10 resources can be shown (#68333) 2023-05-18 10:50:48 -06:00
Sofia Papagiannaki
633b7875e7
Chore: Ignore unique constrain failure when creating the main organization (#68644)
Chore: Ignore unique constrain failure when creatin the main organization
2023-05-18 11:26:29 +03:00
Andres Martinez Gotor
b7ca2d89b1
Chore: Update ProtonMail/go-crypto (#68641) 2023-05-18 09:52:31 +02:00
Eric Leijonmarck
6a2bcba078
Revert: Allow editors to access GET /datasources (#68632)
Revert "Allow editors to access GET /datasources"

This reverts commit 5a830c43c0.
2023-05-17 18:24:18 +01:00