generated from spiral-packages/package-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Enhance Temporal Connection Configuration with SSL Support and Flexibility #83
Open
butschster
wants to merge
10
commits into
3.x
Choose a base branch
from
feature/ssl-conection-support
base: 3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2d262ad
Enhanced Temporal connection configuration for flexibility and SSL su…
butschster 5af4962
fix
butschster 2f65f78
fix psalm issues
butschster 2a9d04b
Added TemporalCloudConnection class and deprecated 'address' config key
butschster 5796ee4
fix
butschster e395aae
fix
butschster 8f0044d
Update src/Connection/Connection.php
butschster a8f3e30
Update src/Connection/SslConnection.php
butschster 5b84286
Update src/Connection/TemporalCloudConnection.php
butschster b6f7891
Update src/Connection/Connection.php
butschster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\TemporalBridge\Connection; | ||
|
||
class Connection | ||
{ | ||
public function __construct( | ||
public readonly string $address, | ||
butschster marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\TemporalBridge\Connection; | ||
|
||
class SslConnection extends Connection | ||
{ | ||
/** | ||
* @param non-empty-string $address | ||
* @param string $crt Full path to the certificate file (Default: null) | ||
* @param string|null $clientKey Full path to the client key file (Default: null) | ||
* @param string|null $clientPem Full path to the client pem file (Default: null) | ||
butschster marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @param string|null $overrideServerName | ||
*/ | ||
public function __construct( | ||
string $address, | ||
public readonly ?string $crt = null, | ||
public readonly ?string $clientKey = null, | ||
public readonly ?string $clientPem = null, | ||
public readonly ?string $overrideServerName = null, | ||
) { | ||
parent::__construct($address); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\TemporalBridge\Connection; | ||
|
||
/** | ||
* This connection is used to connect to Temporal Cloud. | ||
* | ||
* @see https://docs.temporal.io/cloud/get-started | ||
*/ | ||
final class TemporalCloudConnection extends SslConnection | ||
{ | ||
/** | ||
* @param non-empty-string $address | ||
* @param non-empty-string $clientKey Full path to the client key file. Required. | ||
* @param non-empty-string $clientPem Full path to the client pem file. Required. | ||
butschster marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
public function __construct( | ||
string $address, | ||
string $clientKey, | ||
string $clientPem, | ||
) { | ||
parent::__construct( | ||
address: $address, | ||
clientKey: $clientKey, | ||
clientPem: $clientPem, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Spiral\TemporalBridge\Connection\Connection; | ||
use Spiral\TemporalBridge\Connection\SslConnection; | ||
use Spiral\TemporalBridge\Connection\TemporalCloudConnection; | ||
|
||
return [ | ||
'connection' => env('TEMPORAL_CONNECTION', 'default'), | ||
'connections' => [ | ||
'default' => new Connection( | ||
address: 'localhost:7233', | ||
), | ||
'ssl' => new SslConnection( | ||
address: 'ssl:7233', | ||
crt: '/path/to/crt', | ||
clientKey: '/path/to/clientKey', | ||
clientPem: '/path/to/clientPem', | ||
overrideServerName: 'overrideServerName', | ||
), | ||
'temporal_cloud' => new TemporalCloudConnection( | ||
address: 'ssl:7233', | ||
clientKey: '/path/to/clientKey', | ||
clientPem: '/path/to/clientPem', | ||
), | ||
], | ||
]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.