Refactor USS setfacl input creation with controlled factory methods#481
Merged
frankgiordano merged 4 commits intomainfrom May 1, 2026
Merged
Refactor USS setfacl input creation with controlled factory methods#481frankgiordano merged 4 commits intomainfrom
frankgiordano merged 4 commits intomainfrom
Conversation
Collaborator
Author
|
@Ashish-Kumar-Dash fyi see this PR request. Thanks for identifying the issue. The rework is a bit more involved and provides a full solution to the issue. |
Contributor
That was fast! Nice work for the quick resolution, would've defo taken me a while to come up with the approach |
Collaborator
Author
|
@Ashish-Kumar-Dash It is a similar pattern already existing in the project in another place and hence the speed. See https://github.com/zowe/zowe-client-java-sdk/blob/main/src/main/java/zowe/client/sdk/core/ZosConnectionFactory.java |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored USS
setfaclinput creation to use a controlled factory pattern instead of exposing direct builder usage.This change introduces
SetAclInputFactoryas the public creation path forUssSetAclInputData, ensuring only validsetfaclkeyword combinations are created.Changes
SetAclInputFactoryfor creatingUssSetAclInputDatainstances.setfacloperations:createSetInput(...)createModifyInput(...)createDeleteInput(...)createDeleteTypeInput(...)createModifyDeleteInput(...)UssSetAclmethods to useSetAclInputFactoryinstead of directly usingUssSetAclInputData.Builder.UssSetAclInputData.Builderto package-private so external users cannot create invalid ACL input combinations directly.abort = falselinks = LinkType.FOLLOWlinksto prevent null values.set,modify,delete,delete-type, andmodify/deleteinputs.UssSetAclrequest body generation.Reason for Change
The previous builder pattern allowed callers to create invalid
setfaclinput combinations, such as combiningsetwithmodify, ordelete-typewith other ACL operation keywords.The z/OSMF
setfaclAPI only allows certain combinations:modifyanddeletemay be used together.setcannot be combined withmodify,delete, ordelete-type.delete-typecannot be combined withset,modify, ordelete.The new factory methods make those valid combinations explicit and prevent misuse by keeping the builder internal to the package.
Testing
Added unit tests to verify:
setfacloperation.UssSetAclcorrectly delegates input creation through the factory.