summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_common.cc
diff options
context:
space:
mode:
authorPritha Srivastava <prsrivas@redhat.com>2021-07-19 12:27:52 +0200
committerPritha Srivastava <prsrivas@redhat.com>2021-09-23 07:08:26 +0200
commita79fa82939ad83b1a8365f100e7426eb8e144e2e (patch)
tree676303d5b5e6f5114bf6a6e304e09f22e8082f27 /src/rgw/rgw_common.cc
parentrgw/sts: code for returning an error when an IAM policy (diff)
downloadceph-a79fa82939ad83b1a8365f100e7426eb8e144e2e.tar.xz
ceph-a79fa82939ad83b1a8365f100e7426eb8e144e2e.zip
rgw/sts: code to check IAM policy and return an
appropriate error incase Resource specified in the IAM policy is incorrect and is discarded. The IAM policy can be a resource policy or an identity policy. This is for policies that have already been set. Fixes: https://tracker.ceph.com/issues/51219 Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
Diffstat (limited to 'src/rgw/rgw_common.cc')
-rw-r--r--src/rgw/rgw_common.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc
index d846aeac99a..20b126c53d7 100644
--- a/src/rgw/rgw_common.cc
+++ b/src/rgw/rgw_common.cc
@@ -1053,12 +1053,12 @@ Effect eval_or_pass(const boost::optional<Policy>& policy,
const rgw::IAM::Environment& env,
boost::optional<const rgw::auth::Identity&> id,
const uint64_t op,
- const ARN& arn,
+ const ARN& resource,
boost::optional<rgw::IAM::PolicyPrincipal&> princ_type=boost::none) {
if (!policy)
return Effect::Pass;
else
- return policy->eval(env, id, op, arn, princ_type);
+ return policy->eval(env, id, op, resource, princ_type);
}
}
@@ -1067,10 +1067,10 @@ Effect eval_identity_or_session_policies(const vector<Policy>& policies,
const rgw::IAM::Environment& env,
boost::optional<const rgw::auth::Identity&> id,
const uint64_t op,
- const ARN& arn) {
+ const ARN& resource) {
auto policy_res = Effect::Pass, prev_res = Effect::Pass;
for (auto& policy : policies) {
- if (policy_res = eval_or_pass(policy, env, id, op, arn); policy_res == Effect::Deny)
+ if (policy_res = eval_or_pass(policy, env, id, op, resource); policy_res == Effect::Deny)
return policy_res;
else if (policy_res == Effect::Allow)
prev_res = Effect::Allow;