summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-04-16 12:12:21 +0000
committerGerrit Code Review <review@openstack.org>2021-04-16 12:12:21 +0000
commit4fe8c7fd380b021eb86a449b32c18b09f3ea10cf (patch)
tree0ddaf0ad91c34a83df0b36f238e492652f37f272
parent64c5f95d816e3219a161a46d69ba6879ccb1ca3b (diff)
parent50b7600887d1cd95dbe71786639f2d5bafa33639 (diff)
downloadoslo-policy-4fe8c7fd380b021eb86a449b32c18b09f3ea10cf.tar.gz
Merge "Improving documentation about target resources"
-rw-r--r--doc/source/admin/policy-yaml-file.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/source/admin/policy-yaml-file.rst b/doc/source/admin/policy-yaml-file.rst
index 5757dc7..9d9b85a 100644
--- a/doc/source/admin/policy-yaml-file.rst
+++ b/doc/source/admin/policy-yaml-file.rst
@@ -239,7 +239,19 @@ Target object attributes are fields from the object description in the
database. For example in the case of the ``"compute:start"`` API, the
object is the instance to be started. The policy for starting instances
could use the ``%(project_id)s`` attribute, that is the project that
-owns the instance. The trailing ``s`` indicates this is a string.
+owns the instance. The trailing ``s`` indicates this is a string. The same
+case would be valid for API attributes like ``%(user_id)s`` and
+``%(domain_id)s``.
+
+During a debug logging phase, it's common to have the target object
+attributes retrieved in the API calls. Comparing the API call on the logs
+with the policy enforced for the corresponding API, you can check which API
+attribute has been used as the target object. For example in the policy.yaml
+for the Nova project you can find ``"compute:start"`` API, the policy will show as
+``"rule:admin_or_owner"`` which will point for
+``"admin_or_owner": "is_admin:True or project_id:%(project_id)s"`` and in this
+way you can check that the target object in the debug logging it needs to be a
+``project_id`` attribute.
``is_admin`` indicates that administrative privileges are granted via
the admin token mechanism (the ``--os-token`` option of the ``keystone``