Commit Graph
15 Commits
Author SHA1 Message Date
Ejiro Asiuwhu cac86efd17 fix: add None guard before model_validate in get_item methods
Both sync and async get_item() were missing the None check that other
getters (get_user, get_team) already have. An empty response body would
surface as a pydantic ValidationError instead of a meaningful NotFoundError.
2026-03-26 09:44:19 +01:00
Ejiro Asiuwhu d0550079f7 fix: address PR review findings from bot analysis
- Fix incorrect docstring method names in get_item (set_quantity ->
  increase_quantity, decrease_quantity, try_decrease_quantity)
- Add asyncio.Lock to AsyncJWKSFetcher._fetch_jwks to deduplicate
  concurrent JWKS fetches on cold/expired cache
- Add threading.Lock to SyncJWKSFetcher._fetch_jwks for same reason
- Add threading.Lock to _get_or_create_memory_store to prevent
  race condition in token store registry
- Fix README clone URL to point to upstream repo
- Fix E2E test SyncJWKSFetcher constructor to use correct signature
  (jwks_url + http_client instead of project_id + base_url)
2026-03-26 09:01:06 +01:00
Ejiro Asiuwhu 6c0c58d2eb feat: add get_partial_user method to StackServerApp and AsyncStackServerApp
- Decode JWT access token claims locally without network request
- Return TokenPartialUser with user ID, display name, email, and flags
- Return None when no token store or no access token available
- Support token_store override parameter for per-call flexibility
- Method is synchronous on both classes since it performs no I/O
2026-03-25 07:53:35 +01:00
Ejiro Asiuwhu 09595481dd fix: add publishable_client_key parameter and fix token store defaults
- Add publishable_client_key param to BaseAPIClient, StackServerApp, AsyncStackServerApp
- Include x-stack-publishable-client-key header when key is provided
- Change ExplicitTokenStore defaults from empty string to None
- Remove empty string fallback in resolve_token_store dict branch
2026-03-25 07:51:38 +01:00
Ejiro Asiuwhu f3780f2c60 docs: add comprehensive Google-style docstrings to all public SDK methods
- Add Args, Returns, and Raises sections to all public methods on
  StackServerApp and AsyncStackServerApp (~46 methods each)
- Expand class-level docstrings with full constructor and usage examples
- Document return-None-on-404 behavior, ValueError raises, and error types
2026-03-25 02:04:58 +01:00
Ejiro Asiuwhu 23c9f850b9 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
2026-03-25 01:52:46 +01:00
Ejiro Asiuwhu c5ab83984f feat: add payment methods and email sending to StackServerApp
- Add _resolve_customer_path helper for polymorphic customer identification
- Add list_products, get_item, grant_product, cancel_subscription to both sync and async facades
- Add send_email and get_email_delivery_stats to both sync and async facades
- Export ServerItem, AsyncServerItem, EmailDeliveryInfo from package root
2026-03-25 01:49:12 +01:00
Ejiro Asiuwhu eae4842ab1 feat: add oauth provider methods and connected accounts to both facades
- create_oauth_provider links OAuth provider to a user
- list_oauth_providers and get_oauth_provider for provider lookup
- list_connected_accounts as alias for list_oauth_providers
- Sync and async versions on both facade classes with tests
2026-03-25 01:37:25 +01:00
Ejiro Asiuwhu 7e41fc8f95 feat: add api key management methods to both facades
- User API key create/list/revoke on StackServerApp and AsyncStackServerApp
- Team API key create/list/revoke on both facades
- check_api_key validates any key and returns user_id/team_id
- Tests for all sync and async API key methods
2026-03-25 01:35:44 +01:00
Ejiro Asiuwhu adeb156d1a feat: add contact channel verification methods to StackServerApp
- list_contact_channels, create_contact_channel for user channels
- send_verification_code with optional callback URL
- verify_contact_channel to validate codes
- Both sync and async facades
2026-03-25 01:31:32 +01:00
Ejiro Asiuwhu e26f3a228e feat: add permission management methods to StackServerApp
- grant_permission, revoke_permission for team and project scope
- list_permissions with optional direct filter
- has_permission boolean check, get_permission single lookup
- Both sync and async facades
2026-03-25 01:29:12 +01:00
Ejiro Asiuwhu cd64ecb703 feat: add team membership, invitations, and member profiles
- Add add_team_member and remove_team_member via /team-memberships
- Add send_team_invitation, list_team_invitations, revoke_team_invitation
- Add list_team_member_profiles and get_team_member_profile
- Add user_id field to TeamMemberProfile for profile filtering
- Both sync and async facades have identical method surfaces
2026-03-25 01:24:57 +01:00
Ejiro Asiuwhu 3bf752f120 feat: add team CRUD and API key lookup to StackServerApp
- Add get_team, list_teams, create_team, update_team, delete_team
- Add get_team_by_api_key with two-step lookup via /api-keys/check
- Import ServerTeam, TeamInvitation, TeamMemberProfile models
- Both sync and async facades have identical method surfaces
- Uses _UNSET sentinel pattern for update_team (same as update_user)
2026-03-25 01:22:59 +01:00
Ejiro Asiuwhu 7f4e3eb428 feat: add session management methods to StackServerApp and AsyncStackServerApp
- list_sessions(user_id) returns list of ActiveSession for a user
- get_session(session_id, user_id) filters from list_sessions, returns ActiveSession or None
- revoke_session(session_id, user_id) deletes session via DELETE endpoint
- Both sync and async facades implement all three methods
2026-03-25 01:11:22 +01:00
Ejiro Asiuwhu fd3a816700 feat: add StackServerApp and AsyncStackServerApp with user CRUD
- StackServerApp (sync) and AsyncStackServerApp (async) facade classes
- get_user returns ServerUser or None on 404
- list_users with cursor/limit/order_by/desc/query/include_restricted/include_anonymous
- create_user sends only non-None fields
- update_user uses _UNSET sentinel to distinguish not-provided from explicit None
- delete_user returns None
- get_user_by_api_key performs two-step lookup via /api-keys/check then /users/{id}
- Both classes support context managers and compose API client + optional token store
2026-03-25 01:07:02 +01:00