From e91333ae1966e0c11922be084c246df15271fd54 Mon Sep 17 00:00:00 2001 From: Chalin-Shi <18875906195@163.com> Date: Wed, 22 Aug 2018 10:17:50 +0800 Subject: [PATCH] :wrench: add eslint config and archive the model conf and csv --- .eslintrc.json | 3 +++ examples/authz_model.conf | 14 ++++++++++++++ examples/authz_policy.csv | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 .eslintrc.json create mode 100644 examples/authz_model.conf create mode 100644 examples/authz_policy.csv diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..7d03cee --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "standard" +} \ No newline at end of file diff --git a/examples/authz_model.conf b/examples/authz_model.conf new file mode 100644 index 0000000..fd2f08d --- /dev/null +++ b/examples/authz_model.conf @@ -0,0 +1,14 @@ +[request_definition] +r = sub, obj, act + +[policy_definition] +p = sub, obj, act + +[role_definition] +g = _, _ + +[policy_effect] +e = some(where (p.eft == allow)) + +[matchers] +m = g(r.sub, p.sub) && keyMatch(r.obj, p.obj) && (r.act == p.act || p.act == "*") diff --git a/examples/authz_policy.csv b/examples/authz_policy.csv new file mode 100644 index 0000000..9203e11 --- /dev/null +++ b/examples/authz_policy.csv @@ -0,0 +1,7 @@ +p, alice, /dataset1/*, GET +p, alice, /dataset1/resource1, POST +p, bob, /dataset2/resource1, * +p, bob, /dataset2/resource2, GET +p, bob, /dataset2/folder1/*, POST +p, dataset1_admin, /dataset1/*, * +g, cathy, dataset1_admin