Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: try to parse Keystone token in order appropriate to configuration. #7822

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rgw/rgw_keystone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ int KeystoneToken::parse(CephContext *cct, bufferlist& bl)
try {
const auto version = KeystoneService::get_api_version();

if (version == KeystoneApiVersion::VER_3) {
if (version == KeystoneApiVersion::VER_2) {
if (!JSONDecoder::decode_json("access", *this, &parser)) {
/* Token structure doesn't follow Identity API v2, so the token
* must be in v3. Otherwise we can assume it's wrongly formatted. */
JSONDecoder::decode_json("token", *this, &parser, true);
}
} else if (version == KeystoneApiVersion::VER_2) {
} else if (version == KeystoneApiVersion::VER_3) {
if (!JSONDecoder::decode_json("token", *this, &parser)) {
/* If the token cannot be parsed according to V2, try V3. */
/* If the token cannot be parsed according to V3, try V2. */
JSONDecoder::decode_json("access", *this, &parser, true);
}
} else {
Expand Down