aries_cloudagent.storage package¶
Subpackages¶
- aries_cloudagent.storage.vc_holder package
- Submodules
- aries_cloudagent.storage.vc_holder.askar module
- aries_cloudagent.storage.vc_holder.base module
- aries_cloudagent.storage.vc_holder.in_memory module
- aries_cloudagent.storage.vc_holder.indy module
- aries_cloudagent.storage.vc_holder.vc_record module
- aries_cloudagent.storage.vc_holder.xform module
Submodules¶
aries_cloudagent.storage.askar module¶
aries_cloudagent.storage.base module¶
Abstract base classes for non-secrets storage.
-
class
aries_cloudagent.storage.base.BaseStorage[source]¶ Bases:
abc.ABCAbstract stored records interface.
-
add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Add a new record to the store.
Parameters: record – StorageRecord to be stored
-
delete_all_records(type_filter: str, tag_query: Mapping = None)[source]¶ Remove all records matching a particular type filter and tag query.
-
delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Delete an existing record.
Parameters: record – StorageRecord to delete
-
find_all_records(type_filter: str, tag_query: Mapping = None, options: Mapping = None)[source]¶ Retrieve all records matching a particular type filter and tag query.
-
find_record(type_filter: str, tag_query: Mapping = None, options: Mapping = None) → aries_cloudagent.storage.record.StorageRecord[source]¶ Find a record using a unique tag filter.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- options – Dictionary of backend-specific options
-
get_record(record_type: str, record_id: str, options: Mapping = None) → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a record from the store by type and ID.
Parameters: - record_type – The record type
- record_id – The record id
- options – A dictionary of backend-specific options
Returns: A StorageRecord instance
-
-
class
aries_cloudagent.storage.base.BaseStorageSearch[source]¶ Bases:
abc.ABCAbstract stored records search interface.
-
search_records(type_filter: str, tag_query: Mapping = None, page_size: int = None, options: Mapping = None) → aries_cloudagent.storage.base.BaseStorageSearchSession[source]¶ Create a new record query.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
- options – Dictionary of backend-specific options
Returns: An instance of BaseStorageSearchSession
-
-
class
aries_cloudagent.storage.base.BaseStorageSearchSession[source]¶ Bases:
abc.ABCAbstract stored records search session interface.
-
fetch(max_count: int = None) → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch the next list of results from the store.
Parameters: max_count – Max number of records to return. If not provided, defaults to the backend’s preferred page size Returns: A list of StorageRecord instances
-
aries_cloudagent.storage.error module¶
Storage-related exceptions.
-
exception
aries_cloudagent.storage.error.StorageDuplicateError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.storage.error.StorageErrorDuplicate record found in storage.
-
exception
aries_cloudagent.storage.error.StorageError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseErrorBase class for Storage errors.
-
exception
aries_cloudagent.storage.error.StorageNotFoundError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.storage.error.StorageErrorRecord not found in storage.
-
exception
aries_cloudagent.storage.error.StorageSearchError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.storage.error.StorageErrorGeneral exception during record search.
aries_cloudagent.storage.in_memory module¶
Basic in-memory storage implementation (non-wallet).
-
class
aries_cloudagent.storage.in_memory.InMemoryStorage(profile: aries_cloudagent.core.in_memory.profile.InMemoryProfile)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorage,aries_cloudagent.storage.base.BaseStorageSearchBasic in-memory storage class.
-
add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Add a new record to the store.
Parameters: record – StorageRecord to be stored
Raises: StorageError– If no record is providedStorageError– If the record has no ID
-
delete_all_records(type_filter: str, tag_query: Mapping = None)[source]¶ Remove all records matching a particular type filter and tag query.
-
delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Delete a record.
Parameters: record – StorageRecord to delete Raises: StorageNotFoundError– If record not found
-
find_all_records(type_filter: str, tag_query: Mapping = None, options: Mapping = None)[source]¶ Retrieve all records matching a particular type filter and tag query.
-
get_record(record_type: str, record_id: str, options: Mapping = None) → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a record from the store by type and ID.
Parameters: - record_type – The record type
- record_id – The record id
- options – A dictionary of backend-specific options
Returns: A StorageRecord instance
Raises: StorageNotFoundError– If the record is not found
-
search_records(type_filter: str, tag_query: Mapping = None, page_size: int = None, options: Mapping = None) → aries_cloudagent.storage.in_memory.InMemoryStorageSearch[source]¶ Search stored records.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
- options – Dictionary of backend-specific options
Returns: An instance of InMemoryStorageSearch
-
-
class
aries_cloudagent.storage.in_memory.InMemoryStorageSearch(profile: aries_cloudagent.core.in_memory.profile.InMemoryProfile, type_filter: str, tag_query: Mapping, page_size: int = None, options: Mapping = None)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorageSearchSessionRepresent an active stored records search.
-
fetch(max_count: int = None) → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch the next list of results from the store.
Parameters: max_count – Max number of records to return. If not provided, defaults to the backend’s preferred page size Returns: A list of StorageRecord instances Raises: StorageSearchError– If the search query has not been opened
-
aries_cloudagent.storage.indy module¶
Indy implementation of BaseStorage interface.
-
class
aries_cloudagent.storage.indy.IndySdkStorage(wallet: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorage,aries_cloudagent.storage.base.BaseStorageSearchIndy Non-Secrets interface.
-
add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Add a new record to the store.
Parameters: record – StorageRecord to be stored
-
delete_all_records(type_filter: str, tag_query: Mapping = None)[source]¶ Remove all records matching a particular type filter and tag query.
-
delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Delete a record.
Parameters: record – StorageRecord to delete
Raises: StorageNotFoundError– If record not foundStorageError– If a libindy error occurs
-
find_all_records(type_filter: str, tag_query: Mapping = None, options: Mapping = None)[source]¶ Retrieve all records matching a particular type filter and tag query.
-
get_record(record_type: str, record_id: str, options: Mapping = None) → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a record from the store by type and ID.
Parameters: - record_type – The record type
- record_id – The record id
- options – A dictionary of backend-specific options
Returns: A StorageRecord instance
Raises: StorageError– If the record is not providedStorageError– If the record ID not providedStorageNotFoundError– If the record is not foundStorageError– If record not found
-
search_records(type_filter: str, tag_query: Mapping = None, page_size: int = None, options: Mapping = None) → aries_cloudagent.storage.indy.IndySdkStorageSearch[source]¶ Search stored records.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
- options – Dictionary of backend-specific options
Returns: An instance of IndySdkStorageSearch
-
update_record(record: aries_cloudagent.storage.record.StorageRecord, value: str, tags: Mapping)[source]¶ Update an existing stored record’s value and tags.
Parameters: - record – StorageRecord to update
- value – The new value
- tags – The new tags
Raises: StorageNotFoundError– If record not foundStorageError– If a libindy error occurs
-
wallet¶ Accessor for IndyOpenWallet instance.
-
-
class
aries_cloudagent.storage.indy.IndySdkStorageSearch(store: aries_cloudagent.storage.indy.IndySdkStorage, type_filter: str, tag_query: Mapping, page_size: int = None, options: Mapping = None)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorageSearchSessionRepresent an active stored records search.
-
fetch(max_count: int = None) → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch the next list of results from the store.
Parameters: max_count – Max number of records to return. If not provided, defaults to the backend’s preferred page size Returns: A list of StorageRecord instances Raises: StorageSearchError– If the search query has not been opened
-
aries_cloudagent.storage.record module¶
Record instance stored and searchable by BaseStorage implementation.
-
class
aries_cloudagent.storage.record.StorageRecord[source]¶ Bases:
aries_cloudagent.storage.record.StorageRecordStorage record class.