-
Notifications
You must be signed in to change notification settings - Fork 191
ease ofac check in go-sdk similar to ts-sdk #1174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe OFAC verification logic in sdk/sdk-go/verifier.go was refactored to compute a cumulative OFAC result and derive isOfacValid based on configuration and prior config errors. The prior per-check issue appends for OFAC were removed. genericDiscloseOutput is computed once and reused across config and OFAC validation. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Verifier
participant Config as VerificationConfig
participant Circuit
participant Issues as IssueCollector
Caller->>Verifier: Verify(...)
Verifier->>Circuit: compute genericDiscloseOutput
Verifier->>Issues: collect config validation issues
Verifier->>Verifier: configErr = hasIssues(Issues)
Verifier->>Circuit: iterate OFAC checks
Note over Verifier,Circuit: Accumulate results into cumulativeOfac
Verifier->>Verifier: isOfacValid = (!configErr) AND Config.Ofac AND cumulativeOfac
alt isOfacValid
Verifier->>Caller: return success (no OFAC issues)
else OFAC invalid
Verifier->>Issues: append OFAC issue once (based on cumulative result)
Verifier->>Caller: return with issues
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)sdk/sdk-go/verifier.go (1)
🔇 Additional comments (1)
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. Comment |
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on October 17
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| isOfacValid := false | ||
| if configErr == nil && verificationConfig.Ofac { | ||
| isOfacValid = cumulativeOfac | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: OFAC Validation Default Behavior Changed
The isOfacValid variable now defaults to false when OFAC checks are not required by the configuration or if a config error exists. This changes the previous behavior where it defaulted to true, causing IsOfacValid to incorrectly report false even when OFAC validation isn't applicable.
Nesopie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Note
Updates Go verifier to mark OFAC valid if any check passes and stops flagging OFAC issues when OFAC is disabled in config.
sdk/sdk-go/verifier.go):cumulativeOfac(true if anyOfaccheck is true) and setIsOfacValidfrom it whenverificationConfig.Ofacis enabled.InvalidOfacissues whenOfacis disabled.Written by Cursor Bugbot for commit 4a01df3. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
Bug Fixes
Refactor