Skip to content
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

feat: support global direct call validation #164

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

adamegyed
Copy link
Contributor

Motivation

While we added support for direct-call validation in #90, this was only supported for individually added selectors, because the checking type defaulted to non-global. It would be useful to have "full" support for all validation types in this path.

Solution

Check for both global and selector-based validation applicability in the direct call path.

Do this by refactoring the checking functions to take an enum with types of GLOBAL, SELECTOR, and EITHER.

Refactor the direct call tests to randomize the validation type initialization, to test both cases.

@adamegyed adamegyed requested a review from a team August 27, 2024 15:44
@Zer0dot
Copy link
Contributor

Zer0dot commented Aug 27, 2024

Nice way to go about this!

Wdyt of the security implications? I think it's fine, because a nefarious module could always just request whatever function to direct-call. So, overall, I think this is a nice streamlining change!

@adamegyed
Copy link
Contributor Author

Wdyt of the security implications? I think it's fine, because a nefarious module could always just request whatever function to direct-call. So, overall, I think this is a nice streamlining change!

Yeah, similar reasoning on my end. The status of a validation as global vs not is part of the domain it gets set up with, so if you don't want to give it global access, you just don't set that as a parameter when you install it. But in some cases, it would be nice to grant it that permission.

@adamegyed adamegyed force-pushed the adam/direct-call-validation-type branch from 76f4270 to a2dfa2f Compare August 28, 2024 18:45
@adamegyed adamegyed merged commit 4ea3c43 into develop Aug 28, 2024
3 checks passed
@adamegyed adamegyed deleted the adam/direct-call-validation-type branch August 29, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants