Skip to content

Corrected the consentedAttributes#2122

Merged
anushasunkada merged 1 commit into
mosip:develop-gofrom
anushasunkada:reviewfix
Jul 1, 2026
Merged

Corrected the consentedAttributes#2122
anushasunkada merged 1 commit into
mosip:develop-gofrom
anushasunkada:reviewfix

Conversation

@anushasunkada

@anushasunkada anushasunkada commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Consent information in KYC exchange requests now supports a list of consented attributes instead of a simple yes/no value, improving detail in consent handling.
  • Bug Fixes

    • Conflict errors now return a more specific response code when a client record is changed concurrently, while keeping the same user-facing message.

Signed-off-by: anushasunkada <anushasunkada@gmail.com>
@anushasunkada anushasunkada merged commit 742b4fa into mosip:develop-go Jul 1, 2026
6 of 8 checks passed
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 05febfa7-1f0b-42eb-b6db-7f2a3ab25e45

📥 Commits

Reviewing files that changed from the base of the PR and between d736f9c and 1f8e6a6.

📒 Files selected for processing (3)
  • esignet-service/internal/clientmgmt/handler.go
  • esignet-service/internal/engine/mosip/model.go
  • esignet-service/internal/engine/mosip/mosip_authn.go

Walkthrough

This PR makes two independent changes: it updates the error code returned for concurrent client modification conflicts from invalid_input to patch_conflict, and it changes the ConsentObtained field in MOSIP KYC exchange requests from a boolean to a string slice, populated with computed consented attributes.

Changes

Client Conflict Error Code

Layer / File(s) Summary
Error code mapping update
esignet-service/internal/clientmgmt/handler.go
ErrClientConflict now maps to spec error code patch_conflict instead of invalid_input, message text unchanged.

KYC Exchange Consent Representation

Layer / File(s) Summary
Consent field type and population
esignet-service/internal/engine/mosip/model.go, esignet-service/internal/engine/mosip/mosip_authn.go
ConsentObtained field type changed from bool to []string, and GetAttributes now assigns the computed consentedAttributes list instead of a constant true.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GetAttributes
  participant IdaKycExchangeRequest
  participant KYCExchangeEndpoint

  GetAttributes->>GetAttributes: compute consentedAttributes from sub, name, requested attributes
  GetAttributes->>IdaKycExchangeRequest: set ConsentObtained = consentedAttributes
  IdaKycExchangeRequest->>KYCExchangeEndpoint: send request with ConsentObtained list
Loading

Poem

A hop, a fix, a tiny tweak,
Conflict codes now clearly speak.
Consent's no longer just "yes/no" —
A list of claims, now free to grow.
🐇 Thump-thump, ship it, off we go!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@anushasunkada anushasunkada deleted the reviewfix branch July 1, 2026 16:31
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.

1 participant