Skip to content

Commit

Permalink
add bearer auth for profile endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko Heller committed Jul 5, 2024
1 parent 38867f2 commit c1c85ac
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ composer.phar
.openapi-generator
.openapi-generator-ignore
git_push.sh
.openapi-generator
.openapi-generator-ignore
git_push.sh
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "verdigado/gruene-api-client",
"version": "0.4.0",
"version": "0.5.0",
"description": "PHP client library for gruene api",
"keywords": [
"openapitools",
Expand Down
2 changes: 1 addition & 1 deletion docs/Api/DivisionsApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verdigado\GrueneApiClient\DivisionsApi

All URIs are relative to http://127.0.0.1:5000, except if the operation defines another base path.
All URIs are relative to http://0.0.0.0:5000, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/Api/HealthApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verdigado\GrueneApiClient\HealthApi

All URIs are relative to http://127.0.0.1:5000, except if the operation defines another base path.
All URIs are relative to http://0.0.0.0:5000, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/Api/NbApiApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verdigado\GrueneApiClient\NbApiApi

All URIs are relative to http://127.0.0.1:5000, except if the operation defines another base path.
All URIs are relative to http://0.0.0.0:5000, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/Api/OffboardingApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verdigado\GrueneApiClient\OffboardingApi

All URIs are relative to http://127.0.0.1:5000, except if the operation defines another base path.
All URIs are relative to http://0.0.0.0:5000, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
Expand Down
42 changes: 33 additions & 9 deletions docs/Api/ProfilesApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verdigado\GrueneApiClient\ProfilesApi

All URIs are relative to http://127.0.0.1:5000, except if the operation defines another base path.
All URIs are relative to http://0.0.0.0:5000, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
Expand Down Expand Up @@ -35,6 +35,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -64,7 +67,7 @@ try {

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -95,6 +98,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -123,7 +129,7 @@ void (empty response body)

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -154,6 +160,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -182,7 +191,7 @@ void (empty response body)

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -282,6 +291,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -313,7 +325,7 @@ try {

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -344,6 +356,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand All @@ -370,7 +385,7 @@ This endpoint does not need any parameter.

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -401,6 +416,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -430,7 +448,7 @@ try {

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -463,6 +481,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -493,7 +514,7 @@ void (empty response body)

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down Expand Up @@ -524,6 +545,9 @@ $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->se
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure Bearer (JWT) authorization: bearer
$config = Verdigado\GrueneApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
Expand Down Expand Up @@ -555,7 +579,7 @@ try {

### Authorization

[api_key](../../README.md#api_key)
[api_key](../../README.md#api_key), [bearer](../../README.md#bearer)

### HTTP request headers

Expand Down
2 changes: 1 addition & 1 deletion docs/Api/UsersApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verdigado\GrueneApiClient\UsersApi

All URIs are relative to http://127.0.0.1:5000, except if the operation defines another base path.
All URIs are relative to http://0.0.0.0:5000, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
Expand Down
8 changes: 4 additions & 4 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ class Configuration
*
* @var string
*/
protected $host = 'http://127.0.0.1:5000';
protected $host = 'http://0.0.0.0:5000';

/**
* User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
*
* @var string
*/
protected $userAgent = 'OpenAPI-Generator/0.4.0/PHP';
protected $userAgent = 'OpenAPI-Generator/0.5.0/PHP';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -433,7 +433,7 @@ public static function toDebugReport()
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' The version of the OpenAPI document: 0.1.0' . PHP_EOL;
$report .= ' SDK Package Version: 0.4.0' . PHP_EOL;
$report .= ' SDK Package Version: 0.5.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down Expand Up @@ -473,7 +473,7 @@ public function getHostSettings()
{
return [
[
"url" => "http://127.0.0.1:5000",
"url" => "http://0.0.0.0:5000",
"description" => "localhost",
],
[
Expand Down
32 changes: 32 additions & 0 deletions lib/apis/ProfilesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ public function createProfileRequest($create_profile, string $contentType = self
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -646,6 +650,10 @@ public function deleteProfileRequest($profile_id, string $contentType = self::co
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -880,6 +888,10 @@ public function deleteProfileImageRequest($profile_id, string $contentType = sel
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -1516,6 +1528,10 @@ public function findProfilesRequest($tags = null, $search = null, string $conten
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -1784,6 +1800,10 @@ public function getOwnProfileRequest(string $contentType = self::contentTypes['g
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -2072,6 +2092,10 @@ public function getProfileRequest($profile_id, string $contentType = self::conte
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -2325,6 +2349,10 @@ public function updateProfileRequest($profile_id, $update_profile, string $conte
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -2629,6 +2657,10 @@ public function updateProfileImageRequest($profile_id, $profile_image, string $c
if ($apiKey !== null) {
$headers['x-api-key'] = $apiKey;
}
// this endpoint requires Bearer (JWT) authentication (access token)
if (!empty($this->config->getAccessToken())) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down

0 comments on commit c1c85ac

Please sign in to comment.