mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
rgw: Fix for incorrect access key id reworked ldap auth code.
The reworked ldap code does not use the correct access key id in get_policy. Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
This commit is contained in:
parent
8865846f27
commit
c7dae89016
@ -1714,7 +1714,7 @@ int RGWPostObj_ObjStore_S3::get_policy()
|
||||
op_ret = rgw_get_user_info_by_access_key(store, s3_access_key, user_info);
|
||||
if (op_ret < 0) {
|
||||
S3AuthFactory aplfact(store, s->account_name);
|
||||
RGWLDAPTokenExtractor token_extr(s);
|
||||
RGWGetPolicyLDAPTokenExtractor token_extr(s3_access_key);
|
||||
RGWLDAPAuthEngine ldap(s->cct, store, token_extr, &aplfact);
|
||||
// try external authenticators
|
||||
if (store->ctx()->_conf->rgw_s3_auth_use_keystone &&
|
||||
|
@ -689,6 +689,18 @@ public:
|
||||
std::string get_token() const override;
|
||||
};
|
||||
|
||||
class RGWGetPolicyLDAPTokenExtractor : public RGWTokenBasedAuthEngine::Extractor {
|
||||
std::string access_key_id;
|
||||
public:
|
||||
RGWGetPolicyLDAPTokenExtractor(std::string access_key_id) {
|
||||
access_key_id = std::move(access_key_id);
|
||||
}
|
||||
|
||||
std::string get_token() const {
|
||||
return access_key_id;
|
||||
}
|
||||
};
|
||||
|
||||
class S3AuthFactory : public RGWRemoteAuthApplier::Factory {
|
||||
typedef RGWAuthApplier::aplptr_t aplptr_t;
|
||||
RGWRados * const store;
|
||||
|
Loading…
Reference in New Issue
Block a user