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:
7 files changed
+184
-414
No files matched your search
@@ -117,21 +117,6 @@ session_connection_limit(expiration_time, connection_limit) as (
|
||||
select expiration_time, connection_limit, current_connection_count
|
||||
from
|
||||
session_connection_limit, session_connection_count;
|
||||
`
|
||||
nonTerminatedSessionPublicIdList = `
|
||||
select public_id, project_id, user_id from session
|
||||
where
|
||||
session.termination_reason is null
|
||||
and
|
||||
project_id = any(@project_ids)
|
||||
;
|
||||
`
|
||||
|
||||
sessionPublicIdList = `
|
||||
select public_id, project_id, user_id from session
|
||||
where
|
||||
project_id = any(@project_ids)
|
||||
;
|
||||
`
|
||||
|
||||
sessionList = `
|
||||
|
||||
Reference in new issue
Block a user