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

Tristan instacart/add basic ssl support #73

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

tristan-instacart
Copy link

This Pull Request references issue #70

It is a simple implementation for allowing SSL support by allowing the consumer of the library to pass channel credentials. A very simple use case is added to the README for reference.

It maintains the default behavior of the SDK for backwards compatibility.

@tristan-instacart tristan-instacart marked this pull request as draft May 13, 2021 22:19
@tristan-instacart
Copy link
Author

Investigating test failure

@tristan-instacart tristan-instacart marked this pull request as ready for review May 13, 2021 22:21
@tristan-instacart
Copy link
Author

Sorry for the test error, copy paste issue from a monkeypatch version I based the PR on, fixed now.

@@ -379,7 +379,7 @@ def cancel_polling_request
def client
@client ||= Temporal::Api::WorkflowService::V1::WorkflowService::Stub.new(
url,
:this_channel_is_insecure,
Temporal.configuration.grpc_ssl_config,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind passing this as the argument (similar to host/port) to the client to avoid this extra dependency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still pull from config but do so here yeah?

client_class.new(host, port, identity)

lib/temporal/configuration.rb Outdated Show resolved Hide resolved
@tristan-instacart
Copy link
Author

And now we have learned the valuable lesson of running the rspec locally :)

@tristan-instacart
Copy link
Author

Refactored, then tested against an env in AWS behind an SSL enabled ALB to ensure it is connecting via SSL successfully.

@antstorm
Copy link
Contributor

@tristan-instacart can you please rebase it against the master? There are a few conflict, but otherwise looking good to go 👍

@tristan-instacart tristan-instacart force-pushed the tristan-instacart/add-basic-ssl-support branch from 46f00c5 to f984a3b Compare May 20, 2021 17:57
@tristan-instacart
Copy link
Author

Thank you for the feedback @antstorm
Rebased to resolve conflicts. Nothing too dicey in the process.

client_class.new(host, port, identity, Temporal.configuration.grpc_ssl_config)
else
client_class.new(host, port, identity)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test case for this?


def client
@client ||= Temporal::Api::WorkflowService::V1::WorkflowService::Stub.new(
url,
:this_channel_is_insecure,
channel_creds,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this?

@@ -55,6 +55,7 @@ Temporal.configure do |config|
config.port = 7233
config.namespace = 'ruby-samples'
config.task_queue = 'hello-world'
config.channel_creds = :this_channel_is_insecure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Ruby folks are ok with full names, let's probably call this just credentials unless you think it might conflict with some other config we'd want to add in the future


def grpc_ssl_config
if @channel_creds.nil?
:this_channel_is_insecure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also would be great to have a spec for this and also put the value in a constant

cvanderschuere added a commit to indie-technologies/temporal-ruby that referenced this pull request Feb 14, 2022
cvanderschuere added a commit to indie-technologies/temporal-ruby that referenced this pull request Feb 16, 2022
This change enables the use of mTLS for client<>server communication. https://docs.temporal.io/docs/server/security/#encryption-in-transit-with-mtls

An update of coinbase#73 to close coinbase#70
@cvanderschuere cvanderschuere mentioned this pull request Feb 16, 2022
aryak-stripe pushed a commit to aryak-stripe/temporal-ruby that referenced this pull request Mar 14, 2022
…_WOFLO-310

Expose scheduled_time and current_attempt_scheduled_time on activity metadata
@jlemesh jlemesh mentioned this pull request Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants