Normalize endpoint path in oauth client
oauthlib uses the request URI as input for generating an oauth
signature and matching it against the incoming oauth_signature request
attribute. tempest also uses the URI to generate this signature, which
means the URIs must match exactly.
If the keystone catalog contains an endpoint with a trailing slash, such
as https://keystone.example.org/v3/, then the URI that tempest uses for
the signature generation will be
https://keystone.example.org/v3//OS-OAUTH1/request_token. The incoming
request URI that oauthlib sees will not have the duplicate slash and so
the resulting signature will differ, and the auth request will be
rejected due to mismatching HMAC-SHA1 signatures.
This patch corrects the issue for deployments that use a trailing slash
in their keystone catalogs (which is valid) by normalizing the path
before generating the signature.
Change-Id: Ie827b1af7b23c6d6eaf2c2894cc2629d0e252108
1 file changed