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

Feature: Support assertions in RCL #94

Open
metasansana opened this issue Mar 11, 2023 · 0 comments
Open

Feature: Support assertions in RCL #94

metasansana opened this issue Mar 11, 2023 · 0 comments

Comments

@metasansana
Copy link
Contributor

These could be preconditions that must be satisfied for a route to be executed properly. Failure would result in some error machinery being triggered.

Example:

GET /posts !allowed

Where "allowed" will be some middleware that simply preforms a check:

 const allowed = (req: Request) => req.session.has('allowed') ? pure(true) : pure(false)

Failing the assertion should hook into an on.assertion event that by default sends a 409 or 403 response.

@metasansana metasansana changed the title Feature: Support assertions in RTL Feature: Support assertions in RCL Mar 12, 2023
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

No branches or pull requests

1 participant