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

Implement Authentication/Authorization Filter #28

Open
jeffries opened this issue May 13, 2017 · 1 comment
Open

Implement Authentication/Authorization Filter #28

jeffries opened this issue May 13, 2017 · 1 comment
Assignees

Comments

@jeffries
Copy link
Member

The management API currently implements no authentication or access control logic; this is problematic, as it will be possible to push arbitrarily many messages to subscribers from this API. As such, authentication logic is necessary before initial deployment.

There is a hook in main.go in the form of the AuthenticateRequest function that is intended for this purpose (implemented as a filter loaded into the router). This method currently passes the request to the next handler; it should instead inspect the request and either pass the request on, or break the filter chain and return an unauthorized/forbidden response. The specific logic for authorization and access control is left to the implementor.

@hsluoyz
Copy link

hsluoyz commented May 20, 2017

Hi, I'm the author of casbin. It is an authorization library that supports models like ACL, RBAC, ABAC.

Related to RBAC, casbin has several advantages:

  1. roles can be cascaded, aka roles can have roles.
  2. support resource roles, so users have their roles and resource have their roles too. role = group here.
  3. the permission assignments (or policy in casbin's language) can be persisted in files or database.

And you can even customize your own access control model, for example, mix RBAC and ABAC together by using roles and attributes at the same time. It's very flexible.

So please consider using casbin when chatbotmgmt implements access control security. Also let me know if there's any question :)

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

3 participants