-
Notifications
You must be signed in to change notification settings - Fork 54
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
add an option to register a service as https and call https services #202
base: master
Are you sure you want to change the base?
add an option to register a service as https and call https services #202
Conversation
Hi, I had to change the eslintrc to make it work from command line, tell me if it is breaking on your side. |
Documentation HTTPSIf you build your microservice not behing a firewall but using different hosting service you will like to run it in HTTPS for security reason. This is doable in Hydra as simply as setting the service protocol to https.
Your service will be registered in redis as secured and will be called using HTTPS. Nothing additional to do in your call to the service. If you are not using a revers-proxy handeling the SSL encryption you will need to use hydra-express for instance that is starting a server in HTTPS if you specify https in protocol see hydra-express documentation for more information. |
@krysalead thanks for this PR. In reviewing it there seems to be a lot of formatting changes. I do agree that those format changes should be done - but I'd rather do that in another PR. Can you branch and only apply your core changes in a new PR? |
Hi, I am really struggling to make it properly, there is inconsistency everywhere, spaces sometimes added, sometimes not. Isn't simpler to do the review with comparison without white space activated? |
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.
Question and minor feedback
.eslintrc
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"plugins": ["mocha"], | |||
"extends": ["eslint:recommended", "google"], | |||
"extends": ["eslint:recommended", "./node_modules/eslint-config-google/index.js"], |
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.
Why is this necessary?
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.
It was not loading google eslint config in my environement, I manage to make it work like that but I can revert it.
index.js
Outdated
@@ -1264,6 +1266,7 @@ class Hydra extends EventEmitter { | |||
host: instance.ip, | |||
port: instance.port, | |||
path: parsedRoute.apiRoute, | |||
protocol: (instance.protocol || 'http') + ':', |
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.
or: protocol: ${(instance.protocol || 'http')}:
,
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.
If you prefer, I am still not use to litterals on small piece of string.
@krysalead No worries about the spaces - I can cleanup after if necessary. See my questions and comment. Thanks again. |
maybe consider using the modern ?? syntax instead of || like see https://dev.to/hereisnaman/logical-or-vs-nullish-coalescing-operator-in-javascript-3851 for details |
Hi,
Sorry for the formatting it seems that some space were missing in front of the comments and I don't know how to remove this indentation from Visual Studio Code.
Changes are not that big, only a new config key
serviceProtocol which could be http or https (default is http)
The other change is that if the service was registered as https it will be called with https.