Skip to content

bugfix: revert to aggrisive ssn masking#1832

Open
framitdavid wants to merge 2 commits into
mainfrom
bugfix/revert-to-aggrisive-masking
Open

bugfix: revert to aggrisive ssn masking#1832
framitdavid wants to merge 2 commits into
mainfrom
bugfix/revert-to-aggrisive-masking

Conversation

@framitdavid

@framitdavid framitdavid commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Det kan være at vi maskerte vell mye SSN-numbers. Usikker på om vi skal rulle tilbake med å ikke maskere for din egen profil?

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

ProfileController.GetUser() now returns the profile details directly, and the verified profile test fixture expects the full SSN value.

Changes

Profile response change

Layer / File(s) Summary
Return raw profile
src/Altinn.App.Api/Controllers/ProfileController.cs, test/Altinn.App.Api.Tests/Controllers/ProfileControllerTests.User.verified.txt
GetUser() now returns details.Profile directly instead of masking it, and the verified response fixture now expects the unmasked SSN.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Altinn/app-lib-dotnet#1822: Removes PartySsnMasking.MaskUserProfile(...) from ProfileController.GetUser() and updates the profile test expectation.

Suggested labels

bugfix

Suggested reviewers

  • danielskovli
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is misleading: the change removes SSN masking in ProfileController, but the title says it reverts to aggressive masking. Rename it to describe the actual change, e.g. "Remove SSN masking from ProfileController".
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/revert-to-aggrisive-masking

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Altinn.App.Api/Controllers/ProfileController.cs`:
- Around line 40-41: Restore the SSN masking in ProfileController before
returning the profile: the GetProfile flow currently returns details.Profile
directly after LoadDetails, which skips the masking applied by
PartySsnMasking.MaskUserProfile(...). Update the controller action to mask the
loaded UserProfile again before the Ok(...) response so Party.SSN and nested
party identities are not serialized in raw form.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e382d923-0b37-4c0a-bbf5-f4193d58e5d0

📥 Commits

Reviewing files that changed from the base of the PR and between 821597a and 76ad19f.

📒 Files selected for processing (2)
  • src/Altinn.App.Api/Controllers/ProfileController.cs
  • test/Altinn.App.Api.Tests/Controllers/ProfileControllerTests.User.verified.txt

Comment thread src/Altinn.App.Api/Controllers/ProfileController.cs
@sonarqubecloud

Copy link
Copy Markdown

@ivarne ivarne added the bugfix Label Pull requests with bugfix. Used when generation releasenotes label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Label Pull requests with bugfix. Used when generation releasenotes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants