fix(lang): parse #[access_control] arguments as expressions #4980
@valentynkit is attempting to deploy a commit to the OtterSec Team on Vercel.
A member of the Team first needs to authorize it.
/// Executes the given access control methods before running the decorated
Please move the 'multiple methods' part to after the current examples, and add an example of that usage there.
Also, as a drive by, mention that methods must return Result<()>
Thanks for adding dedicated tests here. Can you add a couple more to test general usage, such as accessing function arguments?
Thanks for the PR; I have a few nitpicks but generally good.
Thanks, addressed this in followup commit.
Thanks for review, addressed the comments. Please let me know if there anything else you would prefer differently.
Thanks; will merge shortly
@valentynkit Could you please fix the Prettier formatting issue?
The prettier warning was because the PR was stale, should be fixed after rebasing from master.
Approved these changes.
Approved these changes.
jamie-osec
valentynkit
Fixes #4973.
#[access_control]split its stringified arguments on closing parens, so a check with a nested call failed to compile and string literals lost their whitespace. Arguments are now parsed as comma-separated expressions, same as the v2 parser.The new tests in lang/tests/access_control.rs fail against the old parser.