Commit Graph

86 Commits

Author SHA1 Message Date
Andres Martinez Gotor
3b96eb854a
Chore: Replace config with datasource in names (#81098) 2024-01-24 16:44:40 +01:00
Misi
c47b55ae10
Auth: Add SSO settings usage stats (#81143)
* Add usage stats

* UsageStats test + svc rename

* Fix test
2024-01-24 15:39:50 +01:00
Ryan McKinley
c7c594dba0
K8s/DataSource: Introduce PluginConfigProvider (#80928) 2024-01-22 11:32:25 -08:00
Will Browne
2a0f1900d5
Datasources: Add wireset for datasource.DataSourceAPIBuilder (#80914)
tidy up
2024-01-22 15:21:27 +01:00
Will Browne
3f30cbf91c
DataSources: Add datasource fetching + querying interface (#80749)
* first pass

* separate oss + enterprise

* tidy things up

* add ctx

* fix tests

* use standalone svcs

* mv plugin context provide

* fix wire

* fix import
2024-01-19 15:56:52 +01:00
Ryan McKinley
41e523bde7
K8s/FeatureFlags: Add an apiserver to manage feature flags (dev only) (#80501)
* add deployment registry API cloud only

* update versions

* add feature flag endpoints

* use helpers

* merge main

* update AllowSelfServie and re-run code gen

* fix package name

* add allowselfserve flag to payload

* remove config

* update list api to return the full registry including states

* change enabled check

* fix compile error

* add feature toggle and split path in frontend

* changes

* with status

* add more status/state

* add back config thing

* add back config thing

* merge main

* merge main

* now on the /current api endpoint

* now on the /current api endpoint

* drop frontend changes

* change group name to featuretoggle (singular)

* use the same settings

* now with patch

* more common refs

* more common refs

* WIP actually do the webhook

* fix comment

* fewer imports

* registe standalone

* one less file

* fix singular name

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2024-01-17 21:32:44 -08:00
Andres Martinez Gotor
0d1462cbbb
Add real instances to testdata standalone API server (#80473)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2024-01-17 09:22:51 +01:00
Ryan McKinley
e1d387d826
K8s/Storage: Register field-selector on all kinds (#79822)
Co-authored-by: Dan Cech <dcech@grafana.com>
2024-01-16 08:30:01 -08:00
Dan Cech
d76defe517
K8s: Move GrafanaMetaAccessor into grafana-apiserver and remove usage of kinds metadata (#79602)
* move GrafanaMetaAccessor into pkg/apis, add support for Spec.Title & Spec.Name

* K8s: Move GrafanaMetaAccessor (PR into another) (#79728)

* access titles

* remove title

* remove title

* remove kinds metadata accessor

* remove kinds metadata accessor

* fixes

* error handling

* fix tests

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-12 16:18:14 -05:00
Ryan McKinley
bb05a6f58f
K8s: Move shared apis to a common folder with shared openapi spec (#80484) 2024-01-12 12:05:30 -08:00
Dan Cech
771fc6c78d
Fix issue registering dashboard summary resource (#80402) 2024-01-11 16:59:12 -05:00
Ryan McKinley
2c09f969f1
K8s: Add dashboard service (requires dev mode) (#78565) 2024-01-11 01:20:30 +02:00
Ryan McKinley
6be6724433
K8s/Testdata: Expose testdata in standalone apiserver (#80248) 2024-01-10 17:45:23 +02:00
Mihai Doarna
772e5993b6
Auth: reload SSO settings for HA setups (#80231)
* reload SSO settings for HA setups

* remove check for grafana HA

* add unit tests

* fetch all sso settings with one sql query

* register background service
2024-01-10 16:01:37 +02:00
Ryan McKinley
53411eeaa0
K8s: Expose testdata connection as an api-server (dev mode only) (#79726) 2024-01-09 12:26:24 -08:00
Charandas
48612063dd
Grafana app platform: an aggregator cmd and package (#79948) 2024-01-08 22:33:42 +02:00
Dan Cech
b2b4d89501
Storage: Support grafana.app/folder field selector & label selectors (#79816)
* support grafana.app/folder field selector & label selectors

* lint fix
2023-12-21 18:08:01 -05:00
Ryan McKinley
539bc6d31b
Playlist: Implement a more efficient List command to support k8s list (#79820) 2023-12-21 15:03:12 -08:00
Ryan McKinley
10bb02e026
K8s: fix UID creator and paths (#79769) 2023-12-20 14:42:38 -08:00
Ryan McKinley
67bbdd7c05
K8s/Folders: Add folders api service (with legacy storage) (#79413) 2023-12-20 20:28:56 +02:00
Ryan McKinley
33d2d0a12d
K8s: Refactor authorization initialization (#79670) 2023-12-19 19:12:35 +02:00
Ryan McKinley
139025af1e
K8s: Update OpenAPI post processing structures (#79553)
* add prefix

* update extra paths
2023-12-15 07:53:35 -08:00
Dan Cech
0c1d1c6b6e
Storage: raise errors when timestamps cannot be parsed (#79405)
* raise errors when timestamps cannot be parsed

* return partial origin info if timestamp parsing fails
2023-12-12 15:55:10 -05:00
Ryan McKinley
f69516bf47
K8s: Add resource type helper to avoid so many hardcoded names (#79344) 2023-12-11 22:03:48 +02:00
Ryan McKinley
439edebcd6
K8s: fix standalone command and add hack scripts (#79052)
Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
2023-12-05 14:31:49 -08:00
Gabriel MABILLE
99580d60f5
Chore: Fix flaky test by removing the extsvcauth background service (#79044) 2023-12-04 22:26:55 +01:00
Todd Treece
529271d7a8
Perf: Disable core kind registry (#78568)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-11-28 09:09:54 +01:00
Karl Persson
1eb19befaa
Login: refactor auth info package (#78459)
* Remove unused stats and metrics

* No longer collect metrics

* Remove unused dependency

* Move database from sub package
2023-11-21 14:47:23 +01:00
Gabriel MABILLE
ba717454e1
ExtSvcAuth: Clean up orphaned external services on start up (#77951)
* Plugin: Remove external service on plugin removal

* Early exit no service account

* Add log

* WIP

* Cable OAuth2Server client removal

* Move function lower

* Add function to test removal

* Add test to RemoveExternalService

* Test RemoveExtSvcAccount

* remove apostrophy in comment

* Add cfg to plugin installer to check features

* Add feature flag check in the service registration service

* Comments

* Move metrics Inc

* Initialize map

* Reorder

* Initialize mutex as well

* Add HasExternalService as suggested

* WIP: CleanUpOrphanedExternalServices

* Commit suggestion

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

* Nit on test.

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

* oauthserver return names

* Name is not Slug

* Use plugin ID not slug

* Add background job

* remove negation on feature check

* Add test to the CleanUp function

* Test GetExternalServiceNames

* rename test

* Add test for ExtSvcAccountsService_GetExternalServiceNames

* Add a todo

* Add todo

* Option based on mix

* Rewrite a bit the comment

* Opinionated choice use slugs instead of names everywhere

* Nit.

* Comments and re-ordering

* Comment

* Add log

* Add context

---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2023-11-16 12:07:42 +01:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Ryan McKinley
1be1432926
K8s: Add subresource to the example apiserver (#78030) 2023-11-14 05:51:58 +02:00
Ryan McKinley
6ab79a9f2f
K8s: Improve table converter (support non runtime.Object values) (#77816) 2023-11-08 10:59:19 -08:00
Misi
5285e9503b
Auth: SSO settings foundations (#77724)
* inital changes, db migration

* changes

* Implement basic GetAll, Delete

* Add first batch of tests

* Add more tests

* Add service tests for GetForProvider, List

* Update http_server.go + wire.go

* Lint + update fixed role

* Update CODEOWNERS

* Change API init

* Change roles, rename

* Review with @kalleep

* Revert a mistakenly changed part

* Updates based on @dmihai 's feedback

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-11-08 10:50:01 +01:00
Charandas
8a46dc39d0
Grafana App Platform: provide an example-apiserver to easily deploy aggregated APIservers (#77826) 2023-11-07 22:35:15 -08:00
Ryan McKinley
549787d4f9
Playlist: Implement the entire API with k8s client (#77596) 2023-11-03 09:25:29 -07:00
Ryan McKinley
dd654fdc87
K8s/Playlist: Refactor apis packages so the types and registry are in different packages (#77586) 2023-11-03 08:07:55 -07:00
Todd Treece
384f5ccdc6
Playlist: Add internal API version (#77318) 2023-11-01 09:44:04 -04:00
Matthew Jacobson
c2efcdde09
Alerting: Fix flaky SQLITE_BUSY when migrating with provisioned dashboards (#76658)
* Alerting: Move migration from background service run to ngalert init

sqlite database write contention between the migration's single transaction and
dashboard provisioning's frequent commits was causing the migration to
 fail with SQLITE_BUSY/SQLITE_BUSY_SNAPSHOT on all retries.

 This is not a new issue for sqlite+grafana, but the discrepancy between the
 length of  the transactions was causing it to be very consistent. In addition,
 since a failed migration has implications on the assumed correctness of the
 alertmanager and alert rule definition state, we cause a server shutdown on
 error. This can make e2e tests as well as some high-load provisioned
 sqlite installations flaky on startup.

 The correct fix for this is better transaction management across various
 services and is out of scope for this change as we're primarily interested in
 mitigating the current bout of server failures in e2e tests when using sqlite.
2023-10-19 10:03:00 -04:00
Ryan McKinley
29cf60988b
Playlist: Use a different go struct for sql service vs k8s (#76393) 2023-10-12 08:29:06 -07:00
Matthew Jacobson
82f3127e23
Alerting: Move legacy alert migration from sqlstore migration to service (#72702) 2023-10-12 13:43:10 +01:00
Jo
466f8a1f5a
Teams: Move team API to own service (#76347)
* move team API to its own service

* remove uneeded import

* reshare pref api logic
2023-10-12 10:10:54 +02:00
Alexander Weaver
f6649d7a97
Revert "Alerting: Remove vendored models in migration service" (#76387)
Revert "Alerting: Remove vendored models in migration service (#74503)"

This reverts commit 6a8649d544.
2023-10-11 14:21:21 -05:00
Matthew Jacobson
6a8649d544
Alerting: Remove vendored models in migration service (#74503)
This PR replaces the vendored models in the migration with their equivalent ngalert models. It also replaces the raw SQL selects and inserts with service calls.

It also fills in some gaps in the testing suite around:

    - Migration of alert rules: verifying that the actual data model (queries, conditions) are correct 9a7cfa9
    - Secure settings migration: verifying that secure fields remain encrypted for all available notifiers and certain fields migrate from plain text to encrypted secure settings correctly e7d3993

Replacing the checks for custom dashboard ACLs will be replaced in a separate targeted PR as it will be complex enough alone.
2023-10-11 17:22:09 +01:00
Ryan McKinley
717a9dd616
K8s: Add example api service (#75911) 2023-10-06 21:55:22 +03:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Karl Persson
b9b4246432
IDForwarding: Add auth hook to generate id token (#75555)
* AuthN: Move identity struct to its own file

* IDForwarding: Add IDToken property to usr and identity structs and add GetIDToken to requester interface

* Inject IDService into background services

* IDForwarding: Register post auth hook when feature toggle is enabled
2023-09-28 09:22:05 +02:00
Todd Treece
bb9e66e671
K8s: Add storage dual writer (#75403) 2023-09-26 17:15:15 -04:00
Todd Treece
440f9a6ffb
K8s: Register apiserver as background service, and list real playlists (#75338)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-09-25 15:31:58 -07:00
Jo
40a1f8434d
Anon: Scaffold anon service (#74744)
* remove API tagging method and authed tagging

* add anonstore

move debug to after cache

change test order

fix issue where mysql trims to second

* add old device cleanup

lint

utc-ize everything

trim whitespace

* remove dangling setting

* Add delete devices

* Move anonymous authnclient to anonimpl

* Add simple post login hook

* move registration of Background Service

cleanup

* add updated_at index

* do not untag device if login err

* add delete device integration test
2023-09-25 16:25:29 +02:00
Will Browne
e855efb13d
Plugins: Move store and plugin dto to pluginsintegration (#74655)
move store and plugin dto
2023-09-11 13:59:24 +02:00