Phase 3: refactor — typed Decision, RBAC extraction, dead code removal#110
Merged
Conversation
- Add model.Decision type with DecisionAllow/Block/Warn constants - Replace all raw string comparisons on Decision fields with typed constants (pkg/releasegate, pkg/statestore, pkg/report, cmd/evaluate, cmd/art14, cmd/aggregate, pkg/accept, main.go) - Remove deprecated exitcodes.Tampered alias - Move cmd/gen-sbom/ to tools/gen-sbom/ - Extract duplicated RBAC profile logic into config.ApplyProfile - Replace inline RBAC blocks in main.go and evaluate_helpers.go with shared helper Signed-off-by: hadnu <andre_ataide@proton.me>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Changes
Decision typing:
model.Decisiontype withDecisionAllow,DecisionBlock,DecisionWarnconstants"allow"/"block"/"warn"string comparisons on gating decision fields with typed constants acrosspkg/releasegate,pkg/statestore,pkg/report,cmd/evaluate,cmd/art14,cmd/aggregate,pkg/accept, andmain.goDead code removal:
exitcodes.Tamperedalias (useIntegrityFailureinstead)cmd/gen-sbom/totools/gen-sbom/(standalone utility, not part of the wardex binary)RBAC extraction:
main.goandevaluate_helpers.gointo sharedconfig.ApplyProfileVerification
go build ./...: cleango vet ./...: cleango test ./...: 35 packages, 0 failures