From 23c9f850b92198a0abe2b8a490698985078b75d4 Mon Sep 17 00:00:00 2001 From: Ejiro Asiuwhu Date: Wed, 25 Mar 2026 01:52:46 +0100 Subject: [PATCH] feat: add get_data_vault_store to facade classes and exports - StackServerApp.get_data_vault_store returns sync DataVaultStore - AsyncStackServerApp.get_data_vault_store returns AsyncDataVaultStore - Export DataVaultStore and AsyncDataVaultStore from package root --- .../python/src/stack_auth/__init__.py | 4 ++++ .../python/src/stack_auth/_app.py | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/sdks/implementations/python/src/stack_auth/__init__.py b/sdks/implementations/python/src/stack_auth/__init__.py index 53b494d4f..d10289526 100644 --- a/sdks/implementations/python/src/stack_auth/__init__.py +++ b/sdks/implementations/python/src/stack_auth/__init__.py @@ -29,9 +29,11 @@ from stack_auth.errors import ( from stack_auth.models import ( ActiveSession, ApiKey, + AsyncDataVaultStore, AsyncServerItem, BaseUser, ContactChannel, + DataVaultStore, EmailDeliveryInfo, GeoInfo, Item, @@ -82,6 +84,8 @@ __all__ = [ "sync_authenticate_request", "async_authenticate_request", # Models + "DataVaultStore", + "AsyncDataVaultStore", "BaseUser", "ServerUser", "Team", diff --git a/sdks/implementations/python/src/stack_auth/_app.py b/sdks/implementations/python/src/stack_auth/_app.py index d53823c66..5a3de94d4 100644 --- a/sdks/implementations/python/src/stack_auth/_app.py +++ b/sdks/implementations/python/src/stack_auth/_app.py @@ -17,6 +17,7 @@ from stack_auth._constants import DEFAULT_BASE_URL from stack_auth._pagination import PaginatedResult, _PaginationMeta from stack_auth._token_store import TokenStore, TokenStoreInit, resolve_token_store from stack_auth.errors import ApiKeyError, NotFoundError +from stack_auth.models.data_vault import AsyncDataVaultStore, DataVaultStore from stack_auth.models.email import EmailDeliveryInfo from stack_auth.models.payments import AsyncServerItem, Item, Product, ServerItem from stack_auth.models.api_keys import ( @@ -925,6 +926,17 @@ class StackServerApp: data = self._client.request("GET", "/emails/delivery-stats") return EmailDeliveryInfo.model_validate(data) + # -- data vault ---------------------------------------------------------- + + def get_data_vault_store(self, store_id: str) -> DataVaultStore: + """Get a data vault store by ID. + + The returned :class:`DataVaultStore` object provides ``get``, + ``set``, ``delete``, and ``list_keys`` methods for key-value + operations within the store. + """ + return DataVaultStore(store_id, _client=self._client) + # --------------------------------------------------------------------------- # AsyncStackServerApp (async) @@ -1730,3 +1742,14 @@ class AsyncStackServerApp: """Get email delivery statistics.""" data = await self._client.request("GET", "/emails/delivery-stats") return EmailDeliveryInfo.model_validate(data) + + # -- data vault ---------------------------------------------------------- + + def get_data_vault_store(self, store_id: str) -> AsyncDataVaultStore: + """Get a data vault store by ID. + + The returned :class:`AsyncDataVaultStore` object provides async + ``get``, ``set``, ``delete``, and ``list_keys`` methods for + key-value operations within the store. + """ + return AsyncDataVaultStore(store_id, _client=self._client)