Repository navigation
Conversation
- Rescue RecordInvalid in ApiUserApproveVerification so invalid user data returns a 400 with the validation messages instead of a 500. - Name the API user that already holds the identity when the subject is taken at the registrar (one verified person per registrar stays enforced). - Log every approval failure with user, registrar, identity code, subject and reason. - Return verification_failed, reason and the user's identity in the REPP response, so the REPP log record carries them. - Admin REPP log: filter for failed identity verifications and mark those rows with the user, identity and error message.
This branch has not been deployed
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.
Problem
A registrar could not manually approve the identity verification of their machine-to-machine API user, and neither the registrar nor the logs showed why:
ActiveRecord::RecordInvalid. That returned a 500, and the REPP log storedresponse: null.The portal side, a missing
approve_verification_payloadthat made every approval fail, is fixed in internetee/registrar_center2#287.Changes
ApiUserApproveVerificationRecordInvalidand returns "Saving API user data failed: ". The transaction rolls back, so the user stays pending.failure_reasonandfailure_message.Rails.logger.warn: API user id, username, registrar, identity code, subject, reason and message.POST /repp/v1/api_users/approve_verification/:id: on failure returns 400 withdata: { verification_failed, reason, api_user: { id, username, identity_code, subject } }, so the REPP log record carries the details.subject_taken_by_userandupdate_failed(en and et).Tests
ApiLog::ReppLogmodel tests.🤖 Generated with Claude Code