Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ class Configuration
*/
protected $tempFolderPath;

/**
* Path to a certificate file, for mTLS
*
* @var string
*/
protected $certFile;

/**
* Path to a key file, for mTLS
*
* @var string
*/
protected $keyFile;

/**
* Constructor
*/
Expand Down Expand Up @@ -388,6 +402,49 @@ class Configuration
return $this->tempFolderPath;
}

/**
* Sets the certificate file path, for mTLS
*
* @return $this
*/
public function setCertFile($certFile)
{
$this->certFile = $certFile;
return $this;
}

/**
* Gets the certificate file path, for mTLS
*
* @return string Certificate file path
*/
public function getCertFile()
{
return $this->certFile;
}

/**
* Sets the certificate key path, for mTLS
*
* @return $this
*/
public function setKeyFile($keyFile)
{
$this->keyFile = $keyFile;
return $this;
}

/**
* Gets the certificate key path, for mTLS
*
* @return string Certificate key path
*/
public function getKeyFile()
{
return $this->keyFile;
}


/**
* Gets the default configuration instance
*
Expand Down
8 changes: 8 additions & 0 deletions modules/openapi-generator/src/main/resources/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,14 @@ use {{invokerPackage}}\ObjectSerializer;
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ class Configuration:
:param retries: Number of retries for API requests.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.

{{#hasAuthMethods}}
:Example:
Expand Down Expand Up @@ -293,6 +295,8 @@ conf = {{{packageName}}}.Configuration(
ssl_ca_cert: Optional[str]=None,
retries: Optional[int] = None,
ca_cert_data: Optional[Union[str, bytes]] = None,
cert_file: Optional[str]=None,
key_file: Optional[str]=None,
*,
debug: Optional[bool] = None,
) -> None:
Expand Down Expand Up @@ -381,10 +385,10 @@ conf = {{{packageName}}}.Configuration(
"""Set this to verify the peer using PEM (str) or DER (bytes)
certificate data.
"""
self.cert_file = None
self.cert_file = cert_file
"""client certificate file
"""
self.key_file = None
self.key_file = key_file
"""client key file
"""
self.assert_hostname = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class Configuration:
:param retries: Number of retries for API requests.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.

:Example:

Expand Down Expand Up @@ -203,6 +205,8 @@ def __init__(
ssl_ca_cert: Optional[str]=None,
retries: Optional[int] = None,
ca_cert_data: Optional[Union[str, bytes]] = None,
cert_file: Optional[str]=None,
key_file: Optional[str]=None,
*,
debug: Optional[bool] = None,
) -> None:
Expand Down Expand Up @@ -284,10 +288,10 @@ def __init__(
"""Set this to verify the peer using PEM (str) or DER (bytes)
certificate data.
"""
self.cert_file = None
self.cert_file = cert_file
"""client certificate file
"""
self.key_file = None
self.key_file = key_file
"""client key file
"""
self.assert_hostname = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class Configuration:
:param retries: Number of retries for API requests.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.

:Example:

Expand Down Expand Up @@ -203,6 +205,8 @@ def __init__(
ssl_ca_cert: Optional[str]=None,
retries: Optional[int] = None,
ca_cert_data: Optional[Union[str, bytes]] = None,
cert_file: Optional[str]=None,
key_file: Optional[str]=None,
*,
debug: Optional[bool] = None,
) -> None:
Expand Down Expand Up @@ -284,10 +288,10 @@ def __init__(
"""Set this to verify the peer using PEM (str) or DER (bytes)
certificate data.
"""
self.cert_file = None
self.cert_file = cert_file
"""client certificate file
"""
self.key_file = None
self.key_file = key_file
"""client key file
"""
self.assert_hostname = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7578,6 +7578,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3450,6 +3450,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2024,6 +2024,14 @@ protected function createHttpClientOption()
}
}

if ($this->config->getCertFile()) {
$options[RequestOptions::CERT] = $this->config->getCertFile();
}

if ($this->config->getKeyFile()) {
$options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
}

return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ class Configuration
*/
protected $tempFolderPath;

/**
* Path to a certificate file, for mTLS
*
* @var string
*/
protected $certFile;

/**
* Path to a key file, for mTLS
*
* @var string
*/
protected $keyFile;

/**
* Constructor
*/
Expand Down Expand Up @@ -396,6 +410,49 @@ public function getTempFolderPath()
return $this->tempFolderPath;
}

/**
* Sets the certificate file path, for mTLS
*
* @return $this
*/
public function setCertFile($certFile)
{
$this->certFile = $certFile;
return $this;
}

/**
* Gets the certificate file path, for mTLS
*
* @return string Certificate file path
*/
public function getCertFile()
{
return $this->certFile;
}

/**
* Sets the certificate key path, for mTLS
*
* @return $this
*/
public function setKeyFile($keyFile)
{
$this->keyFile = $keyFile;
return $this;
}

/**
* Gets the certificate key path, for mTLS
*
* @return string Certificate key path
*/
public function getKeyFile()
{
return $this->keyFile;
}


/**
* Gets the default configuration instance
*
Expand Down
Loading
Loading