Skip to content

stop empty-string space key leaking orphaned policies - #376

Merged
geofffranks merged 1 commit into
developfrom
feature/TNZGOV-102
Oct 19, 2026
Merged

geofffranks merged 1 commit into
developfrom
feature/TNZGOV-102

Conversation

@winkingturtle-vmw

Copy link
Copy Markdown
Contributor

Summary

filter() looked up subjectSpaces[appSpaces[id]]. An app deleted from Cloud Controller is absent from appSpaces, so the lookup yielded "". GetSubjectSpaces added "" to subjectSpaces for org-scoped roles (relationships.space.data null), so policies with a deleted endpoint passed filter() for any non-admin user holding an org role.

  • filter(): use comma-ok lookups and skip any policy whose source or destination app is missing from appSpaces or maps to an empty space.
  • GetSubjectSpaces: skip roles with an empty space GUID and log at debug level.
  • Add regression tests for both paths, plus the SubjectSpacesWithNullSpace fixture.

Release note: Non-admin users with org-level roles no longer see policies whose source or destination app has been deleted from Cloud Controller.

JIRA: https://vmw-jira.broadcom.net/browse/TNZGOV-102

Backward Compatibility

Breaking Change? No

filter() looked up subjectSpaces[appSpaces[id]]. An app deleted from
Cloud Controller is absent from appSpaces, so the lookup yielded "".
GetSubjectSpaces added "" to subjectSpaces for org-scoped roles
(relationships.space.data null), so policies with a deleted endpoint
passed filter() for any non-admin user holding an org role.

- filter(): use comma-ok lookups and skip any policy whose source or
  destination app is missing from appSpaces or maps to an empty space.
- GetSubjectSpaces: skip roles with an empty space GUID and log at
  debug level.
- Add regression tests for both paths, plus the SubjectSpacesWithNullSpace
  fixture.

Release note: Non-admin users with org-level roles no longer see policies
whose source or destination app has been deleted from Cloud Controller.

ai-assisted=yes
TNZGOV-102

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Application Runtime Platform Working Group Oct 19, 2026
@geofffranks
geofffranks merged commit 5239603 into develop Oct 19, 2026
9 checks passed
@geofffranks
geofffranks deleted the feature/TNZGOV-102 branch October 19, 2026 15:24
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Application Runtime Platform Working Group Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants