Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Authorization #67

Merged
merged 6 commits into from
Nov 24, 2021
Merged

Authorization #67

merged 6 commits into from
Nov 24, 2021

Conversation

sergiodxa
Copy link
Owner

@sergiodxa sergiodxa commented Nov 24, 2021

Closes #62

@sergiodxa sergiodxa added the enhancement New feature or request label Nov 24, 2021
@sergiodxa sergiodxa self-assigned this Nov 24, 2021
@fergusmeiklejohn
Copy link

It's looks straightforward to use. Rules would be db calls we'd write to validate if the user has the correct permissions?

@sergiodxa
Copy link
Owner Author

@fergusmeiklejohn yeah you can easily call a DB from a Rule, the idea is that you can create multiple rules for different things, some rules are going to be global (applied to Authenticator when created) while others are maybe related to specific routes (e.g. a route to ensure you are the author of a comment before you delete it)

@fergusmeiklejohn
Copy link

most rules will be predictable, isAdmin, isCreator.., but as long we can make a rule be anything that returns a boolean or something then that'll fit any use case

@sergiodxa
Copy link
Owner Author

most rules will be predictable, isAdmin, isCreator.., but as long we can make a rule be anything that returns a boolean or something then that'll fit any use case

Exactly, that's the idea of the rules, some are most likely to be the same (e.g. role based) but then you can start having more custom needs, that's when rules come handy, for example, an internal app of a company may want to limit the access to only an IP range (their offices or VPN) or only in business hours and days.

@sergiodxa sergiodxa merged commit fb30595 into main Nov 24, 2021
@sergiodxa sergiodxa deleted the authz branch November 24, 2021 05:47
@goldo
Copy link

goldo commented Mar 16, 2022

@sergiodxa are there any docs about this ? I couldnt find it (even tho the tests look good / are helping)

@sergiodxa
Copy link
Owner Author

@goldo I never documented it because I wanted to use it more before doing so, the API has been stable since this PR but I never really ended up using it that much to feel confident about it

@goldo
Copy link

goldo commented Mar 16, 2022

@sergiodxa Ok I see thanks! do you know anyone who might have did it ? (or use something else)

@sergiodxa
Copy link
Owner Author

@sergiodxa Ok I see thanks! do you know anyone who might have did it ? (or use something else)

I don't really know, but you can see here a list of open source repos using Remix Auth, maybe someone there used it https://github.com/sergiodxa/remix-auth/network/dependents?package_id=UGFja2FnZS0yNTE1NTk4MDI5

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authorization
3 participants