Commit Graph

158 Commits

Author SHA1 Message Date
Sarah Zinger c0b2fafd5e Ensure that datasource apiservers receive and forwards headers (#92304)
* Ensure that datasource apiservers receive and forwards headers for datasources:
- adds log line for prometheus to see when from alert header is received
- add logging to the datasource apiserver
- Updates the Connect func in sub query to forward expected headers to datasources and log unexpected ones.
2024-08-29 11:06:25 -04:00
Todd Treece 2bb2183b41 Scopes: Move title and groups to status in ScopeDashboardBinding (#92377)
---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2024-08-28 08:59:18 -04:00
Karl Persson 1eb49e1b0f Chore: restructure legacy store for identity (#92572)
* Restructure user queries

* restructure display query

* restructure team queries

* restructure team bindings query

* Restructure team members

* Restructure store
2024-08-28 14:15:26 +02:00
Karl Persson 4addd9637e Team: Add sub resource and api for team members (#92492)
* Add team members as a sub resource

* Fix and clean up pagination for teams

* Fix and clean up pagination for users

* Fix and clean up pagination for service accounts

* Update snapshots
2024-08-28 10:30:23 +02:00
Todd Treece 85ef26a85d K8s: Add generic support for status (#92378) 2024-08-28 03:45:04 +03:00
Ryan McKinley 5a30e12a10 SQLTemplate: Make Ident only work for identifiers (not any string) (#92387) 2024-08-27 13:22:40 +03:00
Ryan McKinley 419edef4dc LibraryPanels: Expose library panels in dashboard apiserver (#92213) 2024-08-27 12:12:22 +03:00
Karl Persson 2872e11c13 Teams: Add apis for team membership (#92204)
* Add TeamBinding resource

* Implement read api:s for TeamBindings
2024-08-27 08:31:29 +02:00
Matthew Jacobson 32f06c6d9c Alerting: Receiver API complete core implementation (#91738)
* Replace global authz abstraction with one compatible with uid scope

* Replace GettableApiReceiver with models.Receiver in receiver_svc

* GrafanaIntegrationConfig -> models.Integration

* Implement Create/Update methods

* Add optimistic concurrency to receiver API

* Add scope to ReceiversRead & ReceiversReadSecrets

migrates existing permissions to include implicit global scope

* Add receiver create, update, delete actions

* Check if receiver is used by rules before delete

* On receiver name change update in routes and notification settings

* Improve errors

* Linting

* Include read permissions are requirements for create/update/delete

* Alias ngalert/models to ngmodels to differentiate from v0alpha1 model

* Ensure integration UIDs are valid, unique, and generated if empty

* Validate integration settings on create/update

* Leverage UidToName to GetReceiver instead of GetReceivers

* Remove some unnecessary uses of simplejson

* alerting.notifications.receiver -> alerting.notifications.receivers

* validator -> provenanceValidator

* Only validate the modified receiver

stops existing invalid receivers from preventing modification of a valid
receiver.

* Improve error in Integration.Encrypt

* Remove scope from alert.notifications.receivers:create

* Add todos for receiver renaming

* Use receiverAC precondition checks in k8s api

* Linting

* Optional optimistic concurrency for delete

* make update-workspace

* More specific auth checks in k8s authorize.go

* Add debug log when delete optimistic concurrency is skipped

* Improve error message on authorizer.DecisionDeny

* Keep error for non-forbidden errutil errors
2024-08-26 10:47:53 -04:00
Dave Henderson df3d8915ba Chore: Bump Go to 1.23.0 (#92105)
* chore: Bump Go to 1.23.0

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* update swagger files

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore: update .bingo/README.md formatting to satisfy prettier

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore(lint): Fix new lint errors found by golangci-lint 1.60.1 and Go 1.23

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* keep golden file

* update openapi

* add name to expected output

* chore(lint): rearrange imports to a sensible order

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-08-21 11:40:42 -04:00
Karl Persson b6540e2a18 SSOSettings: Add api:s (#92018)
* apis: add sso setting resource

* Implement Storage for sso

* Rename packages

* Merge identity and sso package

* Update table format and expose GetNestedBool

* Restructure identity api package
2024-08-21 09:16:47 +02:00
Ryan McKinley 9567275365 SQL: Add more legacy helpers (#92006) 2024-08-19 12:15:43 +03:00
Ryan McKinley f432a1713b SQLTemplate: Swap the IFace with the concrete struct (#92008) 2024-08-16 15:12:37 +03:00
Ryan McKinley d9cabe5e14 SQL: Add sql template test helper (#91953) 2024-08-16 14:36:56 +03:00
Ryan McKinley a0cd89860e Identity: Add endpoint to get display info for an identifier (#91828) 2024-08-15 14:38:43 +03:00
Karl Persson 8bcd9c2594 Identity: Remove typed id (#91801)
* Refactor identity struct to store type in separate field

* Update ResolveIdentity to take string representation of typedID

* Add IsIdentityType to requester interface

* Use IsIdentityType from interface

* Remove usage of TypedID

* Remote typedID struct

* fix GetInternalID
2024-08-13 10:18:28 +02:00
Ryan McKinley 21d4a4f49e Auth: use IdentityType from authlib (#91763) 2024-08-12 09:26:53 +03:00
Ryan McKinley 243c0935fc Auth: Use claims.AuthInfo in requester (#91739) 2024-08-09 19:46:56 +03:00
Todd Treece b4126d3bce Chore: Update k8s.io dependencies (#91692) 2024-08-08 18:39:44 +03:00
Ryan McKinley 9e116d13a5 K8s/Dashboards: Fix dashboard list and add tests (#91523) 2024-08-07 13:43:13 +03:00
Ryan McKinley a223c46506 APIServer: Make TableConverter part of ResourceInfo (#91520) 2024-08-05 15:38:12 +03:00
Yuri Tseretyan 96f7f0f486 Alerting: Use Unstructured type for settings of K8s model Integration + code owners (#91430)
* remove nonnamespaced paths
* use common.Unstructed for Intergration.Settings
* update codeowners to include alerting
* fix json name of secure fields to start with lower case
2024-08-02 20:02:58 +03:00
Ryan McKinley f804b0baa3 Storage: Return an iterator from backend List (#91185) 2024-07-31 12:05:59 +03:00
Ryan McKinley 160fe2a3a4 Storage: Remove entity store (#91233) 2024-07-31 09:25:39 +03:00
Ryan McKinley da65825c5f Storage: Consolidate error handling (#91167) 2024-07-30 10:16:16 +00:00
Yuri Tseretyan 1b4b1af9b7 Alerting: Receiver API to use same logic for calculating UID as backend serivce (#91153)
use same logic for calculating uID as backend serivce
2024-07-29 15:55:49 -04:00
Yuri Tseretyan 6b0d20c96a Alerting: time interval service to support addressing intervals by Base64 encoded name (#90563)
* rename to getMuteTimingByName

* add UID to api model of MuteTiming

* update GetMuteTiming to search by UID

* update UpdateMuteTiming to support search by UID

* update DeleteMuteTiming to support uid

* make sure UID is populated

* update usages

* use base64 url-safe, no padding encoding for UID
2024-07-26 16:43:40 -04:00
Ryan McKinley ec6c6bd6c3 Identity: Add read-only identity apiserver (#90418) 2024-07-26 17:09:08 +03:00
Ryan McKinley be7b1ce2df Chore: Replace appcontext.User(ctx) with identity.GetRequester(ctx) (#91030) 2024-07-26 16:39:23 +03:00
Ryan McKinley 9db3bc926e Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
Ryan McKinley 6e39f24588 Storage: Update storage.Interface for backend (#90382) 2024-07-18 07:47:47 -07:00
Ryan McKinley f409f8c169 K8s/Dashboards: Implement dashboards as StorageBackend (#90295) 2024-07-17 10:49:23 -07:00
Jean-Philippe Quéméner 283280f329 fix(querier): use most specific timerange available (#90540)
* fix(querier): use most specific timerange available

* return zero values
2024-07-17 20:22:45 +04:00
Matthew Jacobson b7f422b68d Alerting: Receiver API Get+List+Delete (#90384) 2024-07-16 10:02:16 -04:00
Piotr Jamróz f14ba32ea6 Query Library: Use current namespace when calling API (#90423)
* Use the current namespace

* Enable PeakQ API

* Enable PeakQ API when Query API is enabled

* Enable PeakQ API when Query API & Query Library are enabled
2024-07-16 11:50:38 +02:00
Ryan McKinley d2bc4f3255 DualWrite: Cleanup and centralize the dual write creation (#90013) 2024-07-11 23:23:31 +03:00
Stephanie Hingtgen bb187ce4b1 K8s: Match status codes from single tenant (#90153)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-07-10 20:48:02 +02:00
Giuseppe Guerra 9216a3df7d Plugins: Remove datasourceQueryMultiStatus feature toggle (#90191)
* Remove datasourceQueryMultiStatus feature toggle

* PR review suggestion
2024-07-10 11:15:10 +02:00
Yuri Tseretyan 5ae5fa3a7a Alerting: Support field selectors in time interval API (#90022)
* fix kind of TimeInterval
* register custom fields for selectors
* support field selectors in legacy storage
* support selectors in storage

===== Misc
* refactor conversions to build in one place
* hide implementation of provenance status behind accessors to use the key in selectors
* fix provenance error
2024-07-08 22:45:30 +03:00
Andres Martinez Gotor f41ee615ba Chore: Add basic admission handlers for registered API services (#89824) 2024-07-03 09:19:54 +02:00
Charandas f50c8566df K8s: handle queries being an empty slice (#89928)
* K8s: handle queries being an empty slice

* remove unnecessary comment

* remove redundant break
2024-07-02 19:44:29 +00:00
Todd Treece 9c6d3590a2 Chore: Fix apiserver circular dependencies (#89918) 2024-07-01 11:42:34 -04:00
Matthew Jacobson e121e2609f Alerting: Receiver API (#89707) 2024-06-26 20:03:25 +03:00
Isabella Siu 3ac109e759 AWS: Update deprecated aws-sdk functions from env variable versions (#89643) 2024-06-26 11:56:39 -04:00
Ryan McKinley 3db4e5a0c6 K8s: remove dashboard summary abstraction (#89761) 2024-06-26 15:00:24 +03:00
Leonor Oliveira 2645958c8c Use global function to compare any entity to both stores (#89282)
* WIP implement generic compare interface

* Use global compare fn for all entities

* Lint

* Update pkg/apiserver/rest/dualwriter.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Don't need to hash, just compare bytes

* Fix tests

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-06-26 10:19:40 +02:00
Ryan McKinley 4651506319 K8s/Dashboards: Replace multiple calls with a single endpoint (#89639) 2024-06-26 07:27:52 +03:00
Todd Treece 71270f3203 Storage: Avoid relying on RequestInfo (#89635) 2024-06-25 10:06:03 -04:00
Jean-Philippe Quéméner bc43078320 fix(grafana-apps): copy namespace from connect ctx (#89569) 2024-06-21 20:05:55 +03:00
Ryan McKinley 93ef90a1e4 K8s: remove (not great) example api (#89524) 2024-06-21 10:23:08 +03:00