Skip to content

remove soft delete for credential#75

Open
nully0x wants to merge 2 commits intomainfrom
remove-soft-delete-for-cred
Open

remove soft delete for credential#75
nully0x wants to merge 2 commits intomainfrom
remove-soft-delete-for-cred

Conversation

@nully0x
Copy link
Collaborator

@nully0x nully0x commented Oct 14, 2025

Remove Soft Delete from Credentials Table

Changes

  • Removed is_deleted and deleted_at columns from credentials table
  • Changed delete_credential() from soft delete (UPDATE) to hard delete (DELETE)
  • Updated all credential queries to remove is_deleted = 0 filtering
  • Updated Credential model to remove soft delete fields

Next Steps

  • Remove or modify unique constraint to support multiple credentials per user
  • Add is_current field to track which credential is actively being viewed
  • Implement credential switching logic

Security Improvement

✅ Credentials are now permanently deleted from database, ensuring sensitive data (macaroons, certs) cannot be recovered

@nully0x nully0x requested a review from Camillarhi October 14, 2025 09:22
@Camillarhi
Copy link
Collaborator

Aside from the comment above, it LGTM

@nully0x
Copy link
Collaborator Author

nully0x commented Nov 18, 2025

@Camillarhi any action on this?

@nully0x
Copy link
Collaborator Author

nully0x commented Nov 26, 2025

@Camillarhi can you confirm this is clear?

@Camillarhi
Copy link
Collaborator

@Camillarhi can you confirm this is clear?

Yes, this is clear, just need to resolve the conflicts

Comment on lines +102 to +109
// pub async fn get_credential_required(&self, id: &str) -> ServiceResult<Credential> {
// let repo = CredentialRepository::new(self.pool);
// let credential = repo
// .get_credential_by_id(id)
// .await?
// .ok_or_else(|| ServiceError::not_found("Credential", id))?;
// Ok(credential)
// }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the rational behind commenting out these like of code rather than deleting them ?

Copy link
Collaborator Author

@nully0x nully0x Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is in progress and some edit can still be made and yeah it will be removed.

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.

3 participants