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

Fixed bug in SSL Seldon Client and added functionality in GRPC #946

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

axsaucedo
Copy link
Contributor

What is being added:

  • Fixed bug in REST path for SSL (channel_creds corrected to call_creds)
  • Fixed bug in GRPC where paths for Root and chain certs were flipped
  • Added docstrings to the channel+call seldon classes
  • Added functionality to be able to provide only the root (website) cert
  • Added functionality to check that key+chain file provided together to avoid null ptr

root_certificates=open(channel_credentials.root_certificates_file, 'rb').read())
# This piece also allows for blank SSL Channel credentials in case this is required
else:
grpc_channel_credentials = grpc.ssl_channel_credentials()
Copy link
Contributor

@adriangonz adriangonz Oct 16, 2019

Choose a reason for hiding this comment

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

Would it make sense to build the dict of arguments as args = {"root_certificates: ..., "private_key": ..., ...} and then just pass it down as grpc.ssl_channel_credentials(**args) instead of the three if-else cases? This is mostly a personal preference though, so please ignore it if you don't agree.

On the other hand, and this is something that was already present on the codebase, does an inline call to open().read() also close the file after it's finished?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main reason was due to the open statement that is embedded (And yeah it was already in that format). I do agree, I think we'll have to review the whole GRPC / REST SSL at some point soon so not sure how much worth it would be to have it here.

In regards ot the second question, open files get closed and garbage collected when they lose the last reference pointer, so in this case they would be getting closed either immediately or when the function returns.

@ukclivecox
Copy link
Contributor

/approve

@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cliveseldon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants