-
Notifications
You must be signed in to change notification settings - Fork 2
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
paymentFlow plugin support #17
base: main
Are you sure you want to change the base?
Conversation
blocked_field : "enableExternalRiskCheck" | ||
field_access_whitelisted_fns: ["isMerchantEnabledForPaymentFlow", "transformECMerchantAccountToEulerMerchantAccount"] | ||
field_rule_fixes: "Direct access of `enableExternalRiskCheck` field from `MerchantAccount` type is not allowed. Use the `isMerchantEnabledForPaymentFlow` function instead." | ||
whitelisted_line_nos : [] |
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.
We should not use whitelisting based on line_nos.
Instead, we should use module name and function name in that module
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.
line_no based whitelisted added for an edge use case. Currently, we are not using this support and only module and fn name based logic is active.
Nothing -> pure Nothing | ||
Just rule -> pure $ Just (loc1, rule) | ||
|
||
L _ (HsApp _ (L loc2 (HsAppType _ (L _ (PatHsWrap (WpCompose (WpCompose (WpCompose (WpEvApp (EvExpr _hasFld)) (WpCompose (WpTyApp _fldType) (WpTyApp tableType))) (WpTyApp (LitTy (StrTyLit fastString)))) (WpTyApp _)) (HsVar _ opr))) _)) _) -> do |
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.
Please verify that patterns are not missed when we are not taking this case in ghc-9 version.
I assume this is for getField
and till we are using record-dot-preprocessor
, the AST should be like this only for both ghc-8 and ghc-9.
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 verified in both the versions and flows are working as intended.
@@ -0,0 +1,60 @@ | |||
rules: | |||
- type_name: "MerchantAccount" |
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 a public repo, can we remove all these and put a simple non-juspay rule here.
Added plugin support to verify field access eligibility from the type.