You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method should validate that the ACL values are either 'public-read' or 'private' before making the request.
Apply this diff to add input validation:
async def update_acl(
self, updates: List[dict[str, str]]
) -> UpdateACLResponse:
"""Update ACL settings for one or more files asynchronously.
Args:
updates: List of update objects containing either:
- fileKey and acl
- customId and acl
where acl can be 'public-read' or 'private'
Returns:
UpdateACLResponse: Response containing update results
"""
+ valid_acls = {'public-read', 'private'}+ for update in updates:+ if 'acl' not in update or update['acl'] not in valid_acls:+ raise ValueError("ACL must be either 'public-read' or 'private'")
result = await self._request(
"POST", "/v6/updateACL", {"updates": updates}
)
return UpdateACLResponse(**result)
📝 Committable suggestion
‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
async def update_acl(
self, updates: List[dict[str, str]]
) -> UpdateACLResponse:
"""Update ACL settings for one or more files asynchronously.
Args:
updates: List of update objects containing either:
- fileKey and acl
- customId and acl
where acl can be 'public-read' or 'private'
Returns:
UpdateACLResponse: Response containing update results
"""
valid_acls = {'public-read', 'private'}
for update in updates:
if 'acl' not in update or update['acl'] not in valid_acls:
raise ValueError("ACL must be either 'public-read' or 'private'")
result = await self._request(
"POST", "/v6/updateACL", {"updates": updates}
)
return UpdateACLResponse(**result)
Add input validation for ACL values.
The method should validate that the ACL values are either 'public-read' or 'private' before making the request.
Apply this diff to add input validation:
📝 Committable suggestion
Originally posted by @coderabbitai[bot] in #13 (comment)
The text was updated successfully, but these errors were encountered: