Skip to content

GET events/api/v1/app/party with invalid SSN returns 500 - #1088

Open
eskebab wants to merge 1 commit into
mainfrom
bug-751-invalid-ssn
Open

GET events/api/v1/app/party with invalid SSN returns 500#1088
eskebab wants to merge 1 commit into
mainfrom
bug-751-invalid-ssn

Conversation

@eskebab

@eskebab eskebab commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Added format ssn/nin validation similar to what has been applied in the Notifications API:
https://github.com/Altinn/altinn-notifications/blob/c661a72206cf4fd62874770fed4f758c7146be9a/components/api/src/Altinn.Notifications/Validators/Rules/RecipientRules.cs#L183

Including tests

Description

See issue for description

Related Issue(s)

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)

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation for person identifiers when retrieving party events.
    • Requests with non-numeric values or identifiers that are not exactly 11 digits now return a clear HTTP 400 validation error.

@eskebab eskebab self-assigned this Aug 20, 2026
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6aae51ce-7314-4c1f-864b-66af016724e3

📥 Commits

Reviewing files that changed from the base of the PR and between d7232ac and da63435.

📒 Files selected for processing (2)
  • src/Events/Controllers/AppController.cs
  • test/Altinn.Platform.Events.Tests/TestingControllers/AppControllerTests.cs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The party event endpoint now rejects non-empty person values unless they contain exactly 11 numeric digits. Integration tests verify HTTP 400 responses for short and alphanumeric values.

Changes

Person header validation

Layer / File(s) Summary
Validate and test person headers
src/Events/Controllers/AppController.cs, test/Altinn.Platform.Events.Tests/TestingControllers/AppControllerTests.cs
ValidateQueryParams rejects invalid person values. Integration tests verify validation errors for 10-digit and alphanumeric Person headers.

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

Merge Risk: ⚪ Minimal · up to da634

This localized validation change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Suggested reviewers: hggutvik, martivj

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the affected endpoint and the invalid SSN error addressed by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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 bug-751-invalid-ssn

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.

@eskebab eskebab changed the title Add format validation for person nin header GET events/api/v1/app/party with invalid SSN returns 500 Aug 20, 2026
@eskebab
eskebab requested a review from hggutvik August 20, 2026 10:08
@sonarqubecloud

Copy link
Copy Markdown

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