Skip to content

Resolves Issue #1856 and #1857: Return authority validation errors for invalid registry org roles#1859

Merged
jdaigneau5 merged 2 commits into
devfrom
af-1856
Jun 12, 2026
Merged

Resolves Issue #1856 and #1857: Return authority validation errors for invalid registry org roles#1859
jdaigneau5 merged 2 commits into
devfrom
af-1856

Conversation

@afoote-mitre

@afoote-mitre afoote-mitre commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Closes Issue #1856 and #1857

Summary

This MR fixes registry organization validation so invalid authority values return structured errors instead of producing an uninformative Parameters were invalid response. It also prevents mixed authority arrays from reaching the joint-approval review-object flow with invalid BaseOrg data.

Important Changes

src/repositories/baseOrgRepository.js

  • Adds explicit validation for every authority array item before discriminator-specific validation mutates the authority value.
  • Returns structured errors with instancePath, message, and allowed values.
  • Prevents invalid authority arrays such as ['cna'] or ['CNA', {}, null, 1234, true] from reaching updateOrgFull() and review-object creation.

test/integration-tests/registry-org/registryOrgCRUDTest.js

  • Adds regression coverage for PUT /api/registry/org/:shortname with lowercase authority: ['cna'].
  • Verifies the response includes /authority/0 and an allowed-values validation message.

Testing

Steps to manually test updated functionality, if possible

  • 1) Run bash -i -c "npm run test:integration".

@afoote-mitre afoote-mitre self-assigned this Jun 12, 2026
@afoote-mitre afoote-mitre changed the title Resolves Issue #1856: Return authority validation errors Resolves Issue #1856 and #1857: Return authority validation errors Jun 12, 2026
@afoote-mitre afoote-mitre changed the title Resolves Issue #1856 and #1857: Return authority validation errors Resolves Issue #1856 and #1857: Return authority validation errors for invalid registry org roles Jun 12, 2026
@jdaigneau5 jdaigneau5 merged commit aa51806 into dev Jun 12, 2026
9 checks passed
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.

2 participants