py_abac.storage.file package¶
Submodules¶
py_abac.storage.file.storage module¶
File storage implementation
-
class
py_abac.storage.file.storage.
FileStorage
(storage_dir: str)[source]¶ Bases:
py_abac.storage.base.Storage
Stores and retrieves policies from files on disk.
Important
This storage does not yet perform ACID transactions. It uses the python shelve package for storage which does not support transaction based access to stored objects. Thus so not use it in distributed applications. There is a separate project under development to address this issue.
- Parameters
storage_dir – path to directory where storage files are to be saved.
-
get_all
(limit: int, offset: int) → Generator[py_abac.policy.policy.Policy, None, None][source]¶ Retrieve all the policies within a window.
-
get_for_target
(subject_id: str, resource_id: str, action_id: str) → Generator[py_abac.policy.policy.Policy, None, None][source]¶ Get all policies for given target IDs.
-
POLICY_FILE
= 'policies'¶
Module contents¶
Exposed classes and methods