Hello,
I use the repository for a project in my company and I want to help a bit to contribute to the amazing work you guys doing.
I figured out that guard only support (implicitly) and operator which accept x numbers of rules and the implementation is very specific to this operator.
If we take graphql-shield (a huge guard module for graphql api in typescript) as a example they implement some others operators :
I would like to rework the actual implementation to make a recursive parsing on operators and so be able to parse things like :
#[graphql(guard(
and(
or(
RoleGuard(role = "Role::Admin"),
RoleGuard(role = "Role::Guest")
),
UserGuard(username = r#""test""#)
)
))]
You can find explanations about each operators here.
It's my first work on this project and on macros in general so I started look deep into generate_guards() and I understand how the function work. I start working on a first version of the implementation and I will submit a PR in draft soon.
Great, look forward to it! Post guard I think you can delete it, it's not too useful. Attributes parsing for procedural macros is recommended use darling crate, which is very handy. 馃槂
I don't know darling, I started doing the parsing the same functions that you used. Maybe I can make a v2 with darling after I practice with macros
I don't think implement the not operator seems relevant because we can't return the error defined in the check function of the user.
What do you think about it @sunli829 ?
I don't think implement the
notoperator seems relevant because we can't return the error defined in thecheckfunction of the user.What do you think about it @sunli829 ?
you're right. 馃榿
Implemented with https://github.com/async-graphql/async-graphql/pull/296
Most helpful comment
I don't know
darling, I started doing the parsing the same functions that you used. Maybe I can make a v2 withdarlingafter I practice with macros