fix: address code review feedback for identity-wallet claim module
Critical fixes:
- C1: Fixed 6 tests with malformed mock audit log entries by adding required fields
(did, cid, createdAt, nullified, operation) to all AuditEntry mock objects.
Tests affected: test_sign_and_verify_claim_success,
test_sign_and_verify_claim_wrong_key_at_rotation_keys_0,
test_sign_and_verify_claim_prev_mismatch,
test_sign_and_verify_claim_unexpected_key_removal,
test_sign_and_verify_claim_unexpected_service_change,
test_sign_and_verify_claim_warnings_for_added_service
- C2: Fixed InvalidToken error handling by detecting OAuthClient's 'Not authenticated'
message (which wraps PDS 400 InvalidToken responses). Updated error mapping at
sign_plc_operation call site to check for 'not authenticated' in addition to
'invalidtoken' and 'expiredtoken'.
Important fixes:
- I1: Implemented validation in request_claim_verification() by renaming unused
parameter _did to did and adding DID check: if claim.did \!= did, return Unauthorized.
This matches the pattern in submit_claim() for defense-in-depth.
Minor fixes:
- M1: Removed 5 unused _pds_client variables from tests that use pds_client_with_plc:
- test_sign_and_verify_claim_success
- test_sign_and_verify_claim_wrong_key_at_rotation_keys_0
- test_sign_and_verify_claim_prev_mismatch
- test_sign_and_verify_claim_unexpected_key_removal
- test_sign_and_verify_claim_unexpected_service_change
- test_sign_and_verify_claim_warnings_for_added_service
All changes verified with cargo check and cargo clippy.