grafana/pkg/services/accesscontrol
Michael Mandrus 5626461b3c
Caching: Refactor enterprise query caching middleware to a wire service (#65616)
* define initial service and add to wire

* update caching service interface

* add skipQueryCache header handler and update metrics query function to use it

* add caching service as a dependency to query service

* working caching impl

* propagate cache status to frontend in response

* beginning of improvements suggested by Lean - separate caching logic from query logic.

* more changes to simplify query function

* Decided to revert renaming of function

* Remove error status from cache request

* add extra documentation

* Move query caching duration metric to query package

* add a little bit of documentation

* wip: convert resource caching

* Change return type of query service QueryData to a QueryDataResponse with Headers

* update codeowners

* change X-Cache value to const

* use resource caching in endpoint handlers

* write resource headers to response even if it's not a cache hit

* fix panic caused by lack of nil check

* update unit test

* remove NONE header - shouldn't show up in OSS

* Convert everything to use the plugin middleware

* revert a few more things

* clean up unused vars

* start reverting resource caching, start to implement in plugin middleware

* revert more, fix typo

* Update caching interfaces - resource caching now has a separate cache method

* continue wiring up new resource caching conventions - still in progress

* add more safety to implementation

* remove some unused objects

* remove some code that I left in by accident

* add some comments, fix codeowners, fix duplicate registration

* fix source of panic in resource middleware

* Update client decorator test to provide an empty response object

* create tests for caching middleware

* fix unit test

* Update pkg/services/caching/service.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* improve error message in error log

* quick docs update

* Remove use of mockery. Update return signature to return an explicit hit/miss bool

* create unit test for empty request context

* rename caching metrics to make it clear they pertain to caching

* Update pkg/services/pluginsintegration/clientmiddleware/caching_middleware.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Add clarifying comments to cache skip middleware func

* Add comment pointing to the resource cache update call

* fix unit tests (missing dependency)

* try to fix mystery syntax error

* fix a panic

* Caching: Introduce feature toggle to caching service refactor (#66323)

* introduce new feature toggle

* hide calls to new service behind a feature flag

* remove licensing flag from toggle (misunderstood what it was for)

* fix unit tests

* rerun toggle gen

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-04-12 12:30:33 -04:00
..
acimpl Chore: Fix goimports grouping (#62426) 2023-01-30 09:34:18 +01:00
actest Benchmarks for searchv2 (#60730) 2023-01-27 15:42:08 +00:00
api Chore: Fix goimports grouping (#62426) 2023-01-30 09:34:18 +01:00
database Users: Fix org user always getting org id = 1 on auto assign false (#63708) 2023-02-24 18:08:44 +01:00
mock Access control: endpoint for searching single user permissions (#59669) 2022-12-14 10:53:25 +00:00
ossaccesscontrol RBAC: inherit folder permissions when resolving managed permissions (#62244) 2023-01-30 14:19:42 +00:00
pluginutils Plugins: Migrate licensing and access control to pkg/services/pluginsintegration package (#65258) 2023-03-27 11:15:37 +02:00
resourcepermissions Caching: Refactor enterprise query caching middleware to a wire service (#65616) 2023-04-12 12:30:33 -04:00
accesscontrol_test.go Chore: remove unused feature flag showFeatureFlagsInUI (#62908) 2023-02-08 19:01:34 -05:00
accesscontrol.go Chore: Move ReqContext to contexthandler service (#62102) 2023-01-27 08:50:36 +01:00
checker_test.go Chore: Fix goimports grouping (#62426) 2023-01-30 09:34:18 +01:00
checker.go RBAC: Permission check performance improvements for the new search (#60729) 2023-01-27 12:12:30 +00:00
errors.go RBAC: Validate plugin app access permission targets the plugin (#59468) 2022-11-30 13:55:07 +01:00
evaluator_test.go RBAC: Split up service into several components (#54002) 2022-08-24 13:29:17 +02:00
evaluator.go Perfomance: add preallocation for some slices (#59263) 2022-11-28 13:10:24 +01:00
filter_bench_test.go Chore: Remove Result field from datasources (#63048) 2023-02-09 15:49:44 +01:00
filter_test.go Chore: Remove Result field from datasources (#63048) 2023-02-09 15:49:44 +01:00
filter.go RBAC: Improve performance of dashboard filter query (#56813) 2022-10-25 11:14:27 +02:00
metadata_bench_test.go RBAC: Add function to generate wildcards from prefix (#54275) 2022-08-26 17:10:35 +02:00
metadata_test.go RBAC: Add function to generate wildcards from prefix (#54275) 2022-08-26 17:10:35 +02:00
metadata.go RBAC: Add function to generate wildcards from prefix (#54275) 2022-08-26 17:10:35 +02:00
middleware_test.go Caching: Refactor enterprise query caching middleware to a wire service (#65616) 2023-04-12 12:30:33 -04:00
middleware.go Auth: Add feature flag to move token rotation to client (#65060) 2023-03-23 14:39:04 +01:00
models.go Refactor: move displayname logic from backend to frontend (#62845) 2023-02-03 10:39:44 +00:00
resolvers_test.go Chore: Fix goimports grouping (#62426) 2023-01-30 09:34:18 +01:00
resolvers.go RBAC: Allow role registration for plugins (#57387) 2022-11-07 11:30:45 +01:00
roles_test.go AccessControl: Remove package lists for roles and grants (#47141) 2022-04-06 09:31:14 +02:00
roles.go RBAC: Add an endpoint to list all user permissions (#57644) 2022-11-30 15:38:49 +01:00
scope_test.go RBAC: Add function to generate wildcards from prefix (#54275) 2022-08-26 17:10:35 +02:00
scope.go RBAC: Permission check performance improvements for the new search (#60729) 2023-01-27 12:12:30 +00:00