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

xorm acl mysql example / doc #327

Open
ezkrg opened this issue Nov 14, 2021 · 4 comments
Open

xorm acl mysql example / doc #327

ezkrg opened this issue Nov 14, 2021 · 4 comments

Comments

@ezkrg
Copy link

ezkrg commented Nov 14, 2021

hello, i've tried many ways to add xorm_acl_entry in mysql but no luck, some of them:

yaml:

insert into xorm_acl_entry values ('match: {account: "test"}\nactions: ["push", "pull"]', 10);
insert into xorm_acl_entry values ('- match: {account: "test"}\n  actions: ["push", "pull"]', 10);

yaml inline:

insert into xorm_acl_entry values ('{match: {account: test}, actions: [push, pull]}', 10);
insert into xorm_acl_entry values ('[{match: {account: test}, actions: [push, pull]}]', 10);

json:

insert into xorm_acl_entry values ('{"match": {"account": "test"}, "actions": ["push", "pull"]}', 10);
insert into xorm_acl_entry values ('[{"match": {"account": "test"}, "actions": ["push", "pull"]}]', 10);

log:

Config from /config/auth_config.yml (0 users, 0 ACL static entries)
Created ACL Authorizer with 0 entries
Got new ACL from XORM: []
Installed new ACL from XORM (0 entries)

Please show an example. Thanks!

@kimsk132
Copy link

Having the same problem with Postgres

@kimsk132
Copy link

I believe this is a bug. When I run the logic that reads ACL from database:
err = engine.OrderBy("seq").Find(&newACL)
I got the following error:
unsupported non or composited primary key cascade
My guess is you need some kind of logic to convert the text read from the database into a proper struct.

@saurtiwa3
Copy link

We have the same issue. None of the above entries are identified.
I1021 14:44:16.078731 1 main.go:246] docker_auth build
I1021 14:44:16.084082 1 main.go:61] Config from /config/auth_config.yml (2 users, 0 ACL static entries)
I1021 14:44:16.097002 1 main.go:110] Cert file: /certs/token_public_certificate.pem
I1021 14:44:16.097033 1 main.go:111] Key file : /certs/token_private.key
I1021 14:44:16.099771 1 main.go:173] Serving on :5001

@benbooth493
Copy link

Did anyone figure this out?

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

4 participants