ldout(cct, 20) << "token_id=" << token_id << dendl;
/* Check cache first. */
- if (RGWKeystoneTokenCache::get_instance().find(token_id, t)) {
+ if (token_cache.find(token_id, t)) {
ldout(cct, 20) << "cached token.project.id=" << t.get_project_id()
<< dendl;
auto apl = apl_factory->create_apl_remote(cct, get_acl_strategy(t),
ldout(cct, 0) << "validated token: " << t.get_project_name()
<< ":" << t.get_user_name()
<< " expires: " << t.get_expires() << dendl;
- RGWKeystoneTokenCache::get_instance().add(token_id, t);
+ token_cache.add(token_id, t);
auto apl = apl_factory->create_apl_remote(cct, get_acl_strategy(t),
get_creds_info(t, roles.admin));
return std::make_pair(std::move(apl), nullptr);
const rgw::auth::TokenExtractor* const extractor;
const rgw::auth::RemoteApplier::Factory* const apl_factory;
rgw::keystone::Config& config;
+ rgw::keystone::TokenCache& token_cache;
/* Helper methods. */
bool is_applicable(const std::string& token) const noexcept;
TokenEngine(CephContext* const cct,
const rgw::auth::TokenExtractor* const extractor,
const rgw::auth::RemoteApplier::Factory* const apl_factory,
- rgw::keystone::Config& config)
+ rgw::keystone::Config& config,
+ rgw::keystone::TokenCache& token_cache)
: cct(cct),
extractor(extractor),
apl_factory(apl_factory),
- config(config) {
+ config(config),
+ token_cache(token_cache) {
}
const char* get_name() const noexcept override {