casbin-lua / lua-resty-casbin

Casbin authorization plugin for OpenResty
https://github.com/casbin/lua-casbin
Apache License 2.0
5 stars 2 forks source link

Add lua-resty-casbin to the OpenResty awesome list #5

Open hsluoyz opened 3 years ago

hsluoyz commented 3 years ago

We should make a PR to: https://github.com/bungle/awesome-resty#authentication-and-authorization to add this repo.

hsluoyz commented 3 years ago

@rushitote

hsluoyz commented 3 years ago

@rushitote BTW, is there a package manager for OpenResty for us to release this repo to? Or they also use LuaRocks?

rushitote commented 3 years ago

@hsluoyz There is a package manager which is OpenResty Package Manager (OPM) but as we have dependencies on some LuaRocks modules, we can't publish this directly.

hsluoyz commented 3 years ago

@rushitote then how to do it (publish to OPM) ? Is there a way? Because we want to integrate Casbin solution into the OpenResty ecosystem.

rushitote commented 3 years ago

@hsluoyz I think we can publish it but the user still needs to install the dependencies with LuaRocks. For example, I see that pgmoon is a popular package and it is on the OPM too. But it is still installed with LuaRocks since it has a dependency on lpeg from its rockspec. I will still research more on this.

rushitote commented 3 years ago

Also made a PR here.

rushitote commented 3 years ago

@hsluoyz So, there seems to be an error in the scopes of the GH_TOKEN. Here is the description from the workflow:

ERROR: personal access token lacking the user:email scope: repo, workflow
hsluoyz commented 3 years ago

@rushitote I have updated the token value. Plz try again.

rushitote commented 3 years ago

@hsluoyz After re-running the job, it is giving this error:

ERROR: /home/runner/.opmrc: bad "github_token" value: ***
rushitote commented 3 years ago

I think this may happen if the token does not have read:org or user:email scope.

rushitote commented 3 years ago

@hsluoyz Can we give this another try by creating a new token with both the read:org and user:email scopes? We can push a commit to start a new run then.

hsluoyz commented 3 years ago

@rushitote generated from: https://github.com/settings/tokens and deployed to https://github.com/organizations/casbin-lua/settings/secrets/actions/GH_TOKEN

image

image

rushitote commented 3 years ago

@hsluoyz Thanks, I am trying it again now.

rushitote commented 3 years ago

It is still failing even though the configuration seems correct, same error as before:

ERROR: /home/runner/.opmrc: bad "github_token" value: ***
rushitote commented 3 years ago

@hsluoyz I think the error originated because the token is too permissive, source. I think they need a token with exactly two scopes - user:email and read:org.

hsluoyz commented 3 years ago

@rushitote done:

image

image

rushitote commented 3 years ago

This is still failing, I will try to upload my fork using a local setup and check if it works.

rushitote commented 3 years ago

So, it seems it may be an issue with OPM instead as some another user has this issue too and it gave the same error locally too.

hsluoyz commented 3 years ago

@rushitote any update?

rushitote commented 3 years ago

@hsluoyz I tried to upload it today and it still fails and gives the same error.