feat(session): Use permissions for limiting list results

The session repository can now be passed an optional set of permissions.
The permissions are used to restrict results from the repository.
Currently this only impacts the List method. This enabled the sessions
service to use a single query to retrieve sessions and replaces the
previous behavior where the session service would first request all
sessions for a given set of scopes, evaluate the permissions, and then
request sessions based on a set of session ids.
This commit is contained in:
Timothy Messier committed 2022-09-07 17:53:39 +00:00
1 parent e4bb847ad1
commit 2fbdcf6ce0
7 files changed
+184 -414

No files matched your search

@@ -0,0 +1,11 @@
begin;
-- Partial index to aid session list requests
--
-- If a session list request is made using the default list request options
-- and using the standard grants created by boundary by default,
-- it will include where clauses that:
-- * include a project_id paired with a user_id
-- * and where termination_reason is null
create index session_list_pix on session (project_id, user_id, termination_reason) where termination_reason is null;
analyze session;
end;