-
Notifications
You must be signed in to change notification settings - Fork 25
Add API Keys support #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add API Keys support #508
Conversation
Greptile OverviewGreptile SummaryImplements complete API key management functionality for the WorkOS Python SDK, adding creation and listing methods to the Organizations module and a deletion method to the ApiKeys module. All new methods follow established SDK patterns with both synchronous and asynchronous implementations, proper type definitions, and comprehensive test coverage including auto-pagination tests. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant Organizations
participant ApiKeys
participant HTTPClient
participant WorkOSAPI
Note over Client,WorkOSAPI: Create API Key Flow
Client->>Organizations: create_api_key(org_id, name, permissions)
Organizations->>HTTPClient: POST /organizations/{org_id}/api_keys
HTTPClient->>WorkOSAPI: HTTP Request
WorkOSAPI-->>HTTPClient: ApiKeyWithValue (includes full value)
HTTPClient-->>Organizations: Response
Organizations-->>Client: ApiKeyWithValue
Note over Client,WorkOSAPI: List API Keys Flow
Client->>Organizations: list_api_keys(org_id, limit, before, after, order)
Organizations->>HTTPClient: GET /organizations/{org_id}/api_keys
HTTPClient->>WorkOSAPI: HTTP Request with pagination params
WorkOSAPI-->>HTTPClient: List response with ApiKey objects
HTTPClient-->>Organizations: Response
Organizations-->>Client: WorkOSListResource (supports auto-pagination)
Note over Client,WorkOSAPI: Delete API Key Flow
Client->>ApiKeys: delete_api_key(api_key_id)
ApiKeys->>HTTPClient: DELETE /api_keys/{api_key_id}
HTTPClient->>WorkOSAPI: HTTP Request
WorkOSAPI-->>HTTPClient: 204 No Content
HTTPClient-->>ApiKeys: Response
ApiKeys-->>Client: None
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
8e25de7 to
50e2606
Compare
# Conflicts: # src/workos/types/api_keys/list_filters.py
Description
Adds full API key management support to the SDK:
Organizations module:
API Keys module:
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.