Skip to content

Commit

Permalink
merge develop into master (#42)
Browse files Browse the repository at this point in the history
* Added support for custom approle name (#16)

* Added support for custom approle name

* Fixed spaces

* Added option to send custom request

* Added spaces around dots in AppRoleAuthenticationStrategy::authenticate

* merge (#21)

* the list method added

* the list method added

* name changed

* revert name

* Update composer.json

* fix things after merge of PRs

* Do not instantiate CacheItem directly (#23)

* psr-18 (#19)

* first version of httplug usage

* Merge branches 'develop' and 'feature/httplug' of github.com:CSharpRU/vault-php into feature/httplug

# Conflicts:
#	src/BaseClient.php

* remove php 5.6

* PSR-18 usage

* add little fixes

* adjust code style

* bump php ver up to 7.2

* fix travis ci php versions

* reformat code and enable only curl hook for tests

* #27 update inflector package (#29)

* Update cache/cache dependency (#28)

Co-authored-by: Yaroslav Lukyanov <c_sharp@mail.ru>

* fix tests

* Add more Authentication Strategies (#33)

* Add more Authentication Strategies

* Fix Copy & Paste Error in OktaAuthenticationStrategy

* Put `extends` on the same line

* Create & extend abstract for username/password authentication methods

* Simplify cache dependency (#34)

This Vault PHP client only uses the array cache adapter, so
there is no need to require the complete cache/cache package.

This change was prompted when trying to require the
contentful/contentful:6.0.3 package into a project where
csharpru/vault-php was already installed. Since the Contentful
package requires the void cache adapter, it cannot be installed
in a project with the complete cache/cache package already
installed. This is because cache/cache conflicts with all of the
individual cache/* packages.

Checked that all tests pass.

* fix codestyle, remove unused dependencies (#35)

* Removing Reflector dependency (#38)

* Merge latest changes (#36)

* Added support for custom approle name (#16)

* Added support for custom approle name

* Fixed spaces

* Added option to send custom request

* Added spaces around dots in AppRoleAuthenticationStrategy::authenticate

* merge (#21)

* the list method added

* the list method added

* name changed

* revert name

* Update composer.json

* fix things after merge of PRs

* Do not instantiate CacheItem directly (#23)

* psr-18 (#19)

* first version of httplug usage

* Merge branches 'develop' and 'feature/httplug' of github.com:CSharpRU/vault-php into feature/httplug

# Conflicts:
#	src/BaseClient.php

* remove php 5.6

* PSR-18 usage

* add little fixes

* adjust code style

* bump php ver up to 7.2

* fix travis ci php versions

* reformat code and enable only curl hook for tests

* #27 update inflector package (#29)

* Update cache/cache dependency (#28)

Co-authored-by: Yaroslav Lukyanov <c_sharp@mail.ru>

* fix tests

* Add more Authentication Strategies (#33)

* Add more Authentication Strategies

* Fix Copy & Paste Error in OktaAuthenticationStrategy

* Put `extends` on the same line

* Create & extend abstract for username/password authentication methods

* Simplify cache dependency (#34)

This Vault PHP client only uses the array cache adapter, so
there is no need to require the complete cache/cache package.

This change was prompted when trying to require the
contentful/contentful:6.0.3 package into a project where
csharpru/vault-php was already installed. Since the Contentful
package requires the void cache adapter, it cannot be installed
in a project with the complete cache/cache package already
installed. This is because cache/cache conflicts with all of the
individual cache/* packages.

Checked that all tests pass.

* fix codestyle, remove unused dependencies (#35)

Co-authored-by: Petr Besir Horáček <sirbesir@gmail.com>
Co-authored-by: Alexandr <algerman.sam@gmail.com>
Co-authored-by: Serhii Litviachenko <sergey.litvyachenko@gmail.com>
Co-authored-by: Marcus Pettersen Irgens <marcus.pettersen.irgens@gmail.com>
Co-authored-by: Christian Bönning <hexa2k9@users.noreply.github.com>
Co-authored-by: Aapo Kiiso <aapo@kii.so>

* - remove Doctrine/Inflector
* move Adapter dependency to require block

* * revert adapter

Co-authored-by: Yaroslav Lukyanov <c_sharp@mail.ru>
Co-authored-by: Petr Besir Horáček <sirbesir@gmail.com>
Co-authored-by: Alexandr <algerman.sam@gmail.com>
Co-authored-by: Serhii Litviachenko <sergey.litvyachenko@gmail.com>
Co-authored-by: Marcus Pettersen Irgens <marcus.pettersen.irgens@gmail.com>
Co-authored-by: Christian Bönning <hexa2k9@users.noreply.github.com>
Co-authored-by: Aapo Kiiso <aapo@kii.so>
Co-authored-by: dave <dave@umbrellio.biz>

* Adds support of query part in $path (#39)

Co-authored-by: Petr Besir Horáček <sirbesir@gmail.com>
Co-authored-by: Alexandr <algerman.sam@gmail.com>
Co-authored-by: Serhii Litviachenko <sergey.litvyachenko@gmail.com>
Co-authored-by: Marcus Pettersen Irgens <marcus.pettersen.irgens@gmail.com>
Co-authored-by: Christian Bönning <hexa2k9@users.noreply.github.com>
Co-authored-by: Aapo Kiiso <aapo@kii.so>
Co-authored-by: qem19 <49522198+qem19@users.noreply.github.com>
Co-authored-by: dave <dave@umbrellio.biz>
Co-authored-by: Sergey Drobov <sdrobov@users.noreply.github.com>
  • Loading branch information
10 people committed Nov 27, 2020
1 parent da12dd9 commit de812a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"ext-json": "*",
"psr/cache": "^1.0",
"psr/log": "^1.0",
"doctrine/inflector": "~1.3",
"weew/helpers-array": "^1.3",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0"
Expand Down
5 changes: 5 additions & 0 deletions src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ public function send(string $method, string $path, string $body = ''): ResponseI
$headers['X-Vault-Token'] = $this->token->getAuth()->getClientToken();
}

if (strpos($path, '?') !== false) {
[$path, $query] = explode('?', $path, 2);
$this->baseUri = $this->baseUri->withQuery($query);
}

$request = $this->requestFactory->createRequest(strtoupper($method), $this->baseUri->withPath($path));

foreach ($headers as $name => $value) {
Expand Down
11 changes: 8 additions & 3 deletions src/Helpers/ModelHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Vault\Helpers;

use Doctrine\Common\Inflector\Inflector;

/**
* Class Model
*
Expand All @@ -26,9 +24,16 @@ public static function camelize(array $data, $recursive = true): array
$value = self::camelize($value, $recursive);
}

$return[Inflector::camelize($key)] = $value;
$return[self::camelizeString($key)] = $value;
}

return $return;
}

private static function camelizeString(string $data): string
{
$camelizedString = str_replace([' ', '_', '-'], '', ucwords($data, ' _-'));

return lcfirst($camelizedString);
}
}

0 comments on commit de812a9

Please sign in to comment.