Skip to content
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

SM-998: Throw errors on Failed Project or Secret Deletion #304

Closed
wants to merge 21 commits into from

Conversation

coltonhurst
Copy link
Member

@coltonhurst coltonhurst commented Oct 23, 2023

Type of change

- [ ] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [x] Other

Objective

Throw errors when a project or a secret can't be deleted via the API.

Note: The SDK allows passing multiple project or secret id's for deletion. In the case that some fail and some are successful, the same Response contract is followed, but the success is false, data is None, and the error message contains the failed id's. The id's not returned in that list were deleted successfully.

Example: ResponseForProjectsDeleteResponse(success=False, data=None, error_message='Received error messages from the API: [(a932e83f-6a7f-4f5f-abd5-b09e013fa78d, "access denied")]')

Code changes

  • crates/bitwarden/src/error.rs: Add a new Error type for ApiError
  • crates/bitwarden/src/secrets_manager/projects/delete.rs: Throw errors if there are API errors from Project deletion
  • crates/bitwarden/src/secrets_manager/secrets/delete.rs: Throw errors if there are API errors from Secret deletion

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)

@coltonhurst coltonhurst self-assigned this Oct 23, 2023
@bitwarden-bot
Copy link

bitwarden-bot commented Oct 23, 2023

Logo
Checkmarx One – Scan Summary & Detailseb9cd313-bbd3-4634-9466-0130e3b494d0

No New Or Fixed Issues Found

@Hinton Hinton requested a review from dani-garcia October 31, 2023 13:20
@coltonhurst coltonhurst closed this Aug 7, 2024
@coltonhurst coltonhurst deleted the sm/sm-998 branch August 26, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants