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

Strip credentials in case of 400 on /v3/auth/tokens #335

Closed
drzraf opened this issue Jul 28, 2021 · 1 comment
Closed

Strip credentials in case of 400 on /v3/auth/tokens #335

drzraf opened this issue Jul 28, 2021 · 1 comment

Comments

@drzraf
Copy link

drzraf commented Jul 28, 2021

Screenshot from 2021-07-28 15-28-38

Seriously, such an exception (the one on /v3/auth/tokens should be caught to avoid displaying credentials).
In -production, they would be logged which is not much better. Such a failure should be cleaned before being thrown.

Stack


  at vendor/php-opencloud/openstack/src/Common/Error/Builder.php:128
  at OpenStack\Common\Error\Builder->httpError()
     (vendor/php-opencloud/openstack/src/Common/Transport/Middleware.php:27)
  at OpenStack\Common\Transport\Middleware::OpenStack\Common\Transport\{closure}()
     (vendor/guzzlehttp/promises/src/FulfilledPromise.php:41)
  at GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}()
     (vendor/guzzlehttp/promises/src/TaskQueue.php:48)
  at GuzzleHttp\Promise\TaskQueue->run()
     (vendor/guzzlehttp/promises/src/Promise.php:248)
  at GuzzleHttp\Promise\Promise->invokeWaitFn()
     (vendor/guzzlehttp/promises/src/Promise.php:224)
  at GuzzleHttp\Promise\Promise->waitIfPending()
     (vendor/guzzlehttp/promises/src/Promise.php:62)
  at GuzzleHttp\Promise\Promise->wait()
     (vendor/guzzlehttp/guzzle/src/Client.php:187)
  at GuzzleHttp\Client->request()
     (vendor/php-opencloud/openstack/src/Common/Api/OperatorTrait.php:119)
  at OpenStack\Common\Resource\OperatorResource->sendRequest()
     (vendor/php-opencloud/openstack/src/Common/Api/OperatorTrait.php:127)
  at OpenStack\Common\Resource\OperatorResource->execute()
     (vendor/php-opencloud/openstack/src/Identity/v3/Models/Token.php:117)
  at OpenStack\Identity\v3\Models\Token->create()
     (vendor/php-opencloud/openstack/src/Identity/v3/Service.php:74)
  at OpenStack\Identity\v3\Service->generateToken()
@drzraf drzraf changed the title Strip OS credentials in case of 400 on /v3/auth/tokens Strip credentials in case of 400 on /v3/auth/tokens Jul 28, 2021
@jeroenlammerts
Copy link

jeroenlammerts commented Mar 15, 2023

#259 disabling the http_errors is not working, looks like there is a custom middelware which throws the error above with credentials.

public function httpError(RequestInterface $request, ResponseInterface $response): BadResponseError

@k0ka k0ka mentioned this issue Feb 5, 2024
@k0ka k0ka closed this as completed in d823be3 Feb 5, 2024
giogurto-grande added a commit to VS-CDeX/openstack that referenced this issue Jun 19, 2024
* GitHub workflows (php-opencloud#369)

Add integration workflows for services:
- BlockStorage
- Compute
- Images
- Networking

* always recheck all tests on push to master (php-opencloud#370)

* Restore read the docs (php-opencloud#371)

* add readthedocs.yaml
* remove button
* move to python 3

* Fix documentation (php-opencloud#372)

* fix php-opencloud#351

* fix documentation requirements, remove unused links in docs

* add badges, remove old contacts from README.md

* Fix documentation (php-opencloud#373)

* clarify versioning 
* change documentation copyright

* Fix sort_key and sort_dir parameters for BlockStorage/v2/listSnapshots and Images/v2/listImages

* fix list formating in documentation (php-opencloud#375)

remove custom theme

* added phpdocs for better type hinting (php-opencloud#376)

* one integration workflow (php-opencloud#377)

* one integration workflow to rule them all

* update README.md with new badge

* create BlockStorage v3 as copy of v2 (php-opencloud#378)

* Chores (php-opencloud#379)

* format via php-cs-fixer
* add unit tests with the lowest possible dependencies
* add unit tests with php 8.2 and 8.3
* add integration tests for  2023.1 antelope and yoga
* allow skipping integration, unit or both tests in pull requests

---------

Co-authored-by: k0ka <k0ka@users.noreply.github.com>

* Application credentials (php-opencloud#380)

* add endpoints to create/get/remove application credentials
* add token creation using application credentials
* cancel running workflows on new commit

---------

Co-authored-by: smarcet <smarcet@gmail.com>
Co-authored-by: k0ka <k0ka@users.noreply.github.com>

* fix doc for application credentials (php-opencloud#381)

* Handler stack factory (php-opencloud#382)

* Changed guzzle final HandlerStack extension to factory class HandlerStackFactory

---------

Co-authored-by: k0ka <k0ka@users.noreply.github.com>
Co-authored-by: jarragon-slash2 <jarragon-slash2@users.noreply.github.com>

* Fix testing class namespaces (php-opencloud#383)

Co-authored-by: peter279k <peter279k@gmail.com>

* Refactor tests (php-opencloud#384)

use `include_once $this->sampleFile(` instead of `$path = $this->sampleFile(..); include_once $path`

* Move integration tests to phpunit (php-opencloud#387)

* moved integration tests to phpunit 
* updated integration tests description in CONTRIBUTING.md
* added `name` parameter to `patchUser` so the sample file works properly
* added `Retrievable` interface to `VolumeType`
* added `HasWaiterTrait` to `Compute::Image`
* added `Token::validate()` function to check if Identity token is valid

---------

Co-authored-by: k0ka <k0ka@users.noreply.github.com>

* License: add full text, remove rackspace (php-opencloud#388)

* added bigger rescue timeouts (php-opencloud#390)

* return HandlerStack for BC (php-opencloud#391)

* return HandlerStack for Backward Compatibility - php-opencloud#382

* Merge network services (php-opencloud#392)

* Merge all network service extensions into main one using traits
* Add unit test error_reporting
* Increase volume attachment test timeout

* Clarify docs (php-opencloud#389)

* Rewrite most of documentation. 
* Make creating the `$openstack` object more clear.
* Rename and rearrange main operations as CRUDL (Create, Read, Update, Delete, List)

* Resume suspend server (php-opencloud#394)

* Implement resuming and suspending of servers

---------

Co-authored-by: Martin Zurowietz <martin@zurowietz.de>

* fix resume/suspend doc (php-opencloud#395)

* refactor unit tests: use `mockRequest` for all requests  (php-opencloud#397)

* Fix Swift container requests with "tokens" in its name (php-opencloud#396)

* add errorVerbosity (php-opencloud#400)

fixes php-opencloud#335
fixes php-opencloud#398

* add docs for volume attachement (php-opencloud#401)

fixes php-opencloud#399

* fix doc links (php-opencloud#402)

* enchance error builder: output body only for json, limit body to 5 Kb (php-opencloud#405)

fixes php-opencloud#403
supersedes php-opencloud#404

* make swift metadata header case insensitive  (php-opencloud#407)

* compare headers case insensitively
* drop support of unmaintained releases in CI (until they are returned in github action).

* return unmaintaned openstack versions into ci (php-opencloud#408)

* override TARGET_BRANCH

* Apply php-cs-fixer changes

---------

Co-authored-by: Konstantin Babushkin <koka@idwrx.com>
Co-authored-by: k0ka <k0ka@users.noreply.github.com>
Co-authored-by: smarcet <smarcet@gmail.com>
Co-authored-by: jarragon-slash2 <jarragon-slash2@users.noreply.github.com>
Co-authored-by: peter279k <peter279k@gmail.com>
Co-authored-by: Martin Zurowietz <martin@zurowietz.de>
Co-authored-by: Kamil Kozłowski <kamil.kozlowski@cdex.cloud>
Co-authored-by: giogurto-grande <giogurto-grande@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants