php-opencloud / openstack

PHP SDK for OpenStack clouds
Apache License 2.0
221 stars 148 forks source link

Fix container requests with "tokens" in its name #396

Closed k0ka closed 8 months ago

k0ka commented 8 months ago

The AuthHandler didn't use authorization for POST requests which have tokens in uri. This was created to avoid infinite recursion when obtaining a token would require obtaining a token - https://github.com/php-opencloud/openstack/blob/9f817df9407a7f59579f001c00daba0a8f00de59/src/Common/Auth/AuthHandler.php#L65.

However this emerges another problem: if swift container name has tokens in it, the request uri would contain this term. So any POST request would be sent without token.

This PR removes that check and uses a separate key skipAuth in the Api classes to mark api requests which must skip token generation.