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

api: Improve handling of privkey decryption errors #189

Merged
merged 2 commits into from
Apr 3, 2019

Conversation

kevinbader
Copy link
Contributor

Closes #174.

Test:

  1. Start blockchain
  2. Start API with ORGANIZATION=A and ORGANIZATION_VAULT_SECRET=a
  3. Run provisioning
  4. Restart API with ORGANIZATION=B and ORGANIZATION_VAULT_SECRET=b
  5. Run frontend
  6. Log in with mstein and test

On the UI you should see "Incorrect password" and the logs should show this:

msg: "authentication failed: failed to decrypt the user's private key with the given organization secret (does the user mstein belong to organization ACMECorp2?): decryption failed"
error: {
  ...
}

@kevinbader kevinbader requested a review from Stezido April 3, 2019 11:40
Stezido
Stezido previously approved these changes Apr 3, 2019
Copy link
Contributor

@Stezido Stezido left a comment

Choose a reason for hiding this comment

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

Test works as expected

@Stezido
Copy link
Contributor

Stezido commented Apr 3, 2019

@kevinbader the messages sent to the frontend are a bit long to show them in the error snackbars. So we need a mapping on frontend side. If the frontend has only messages as information about the error occurred, how can it decide between for example 400 Bad Request:

  • invalid user,
  • invalid password,
  • user exists in other organization

This issue is already described in #131

@Stezido Stezido dismissed their stale review April 3, 2019 14:13

code is not returned due to wrong response schema

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