Conversation
added 2 commits
October 30, 2025 18:58
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds folder management capabilities to the Python SDK by implementing three new API methods: create_folder, list_folders, and get_folder_by_id.
Key Changes:
- Added new
V2Foldersresource class following the existing SDK patterns (similar toV3RawSecretsandKMSresources) - Implemented proper UTC datetime handling for the
lastSecretModifiedfilter parameter - Created comprehensive response models (
CreateFolderResponse,ListFoldersResponse,SingleFolderResponse) with proper type definitions - Integrated the folders resource into the main SDK client
Implementation Quality:
- Code follows established patterns from other SDK resources
- Response models properly handle nested objects (e.g.,
EnvironmentwithinSingleFolderResponseItem) - UTC datetime conversion ensures correct timezone handling for API requests
- All methods properly use the request handler with appropriate models
Confidence Score: 4/5
- This PR is safe to merge with minor style improvements recommended
- The implementation follows existing SDK patterns consistently and adds well-structured folder management functionality. Two minor style improvements were suggested: removing redundant query parameters and following Python naming conventions. No logical errors or security issues were found.
- infisical_sdk/resources/folders.py has minor style suggestions but no critical issues
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| infisical_sdk/resources/folders.py | 4/5 | New folders resource with create, list, and get methods. Minor style improvements suggested for parameter handling. |
| infisical_sdk/api_types.py | 5/5 | Added folder response models with proper type definitions and nested object handling. |
Sequence Diagram
sequenceDiagram
participant Client as InfisicalSDKClient
participant Folders as V2Folders
participant Requests as InfisicalRequests
participant API as Infisical API
Note over Client,API: Create Folder Flow
Client->>Folders: create_folder(name, env_slug, project_id, path)
Folders->>Folders: Build request body with projectId, environment, name, path, description
Folders->>Requests: post("/api/v2/folders", request_body)
Requests->>API: POST /api/v2/folders
API-->>Requests: CreateFolderResponse
Requests-->>Folders: APIResponse[CreateFolderResponse]
Folders-->>Client: CreateFolderResponseItem
Note over Client,API: List Folders Flow
Client->>Folders: list_folders(project_id, env_slug, path, lastSecretModified, recursive)
Folders->>Folders: Build params with projectId, environment, path, recursive
Folders->>Folders: Convert lastSecretModified to UTC Z format if provided
Folders->>Requests: get("/api/v2/folders", params)
Requests->>API: GET /api/v2/folders?projectId=...&environment=...
API-->>Requests: ListFoldersResponse
Requests-->>Folders: APIResponse[ListFoldersResponse]
Folders-->>Client: ListFoldersResponse
Note over Client,API: Get Folder by ID Flow
Client->>Folders: get_folder_by_id(id)
Folders->>Requests: get("/api/v2/folders/{id}", params)
Requests->>API: GET /api/v2/folders/{id}
API-->>Requests: SingleFolderResponse
Requests-->>Folders: APIResponse[SingleFolderResponse]
Folders-->>Client: SingleFolderResponseItem
4 files reviewed, 2 comments
victorvhs017
commented
Oct 30, 2025
Comment on lines
+52
to
+53
| # Convert to UTC and format as RFC 3339 with 'Z' suffix | ||
| # The API expects UTC times in 'Z' format (e.g., 2023-11-07T05:31:56Z) |
Contributor
Author
There was a problem hiding this comment.
carlosmonastyrski
approved these changes
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added 3 new methods to interact with the folders API:
create_folderlist_foldersget_folder_by_idhttps://infisical.com/docs/api-reference/endpoints/folders/list