-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
lua: add connection():ssl() API #3761
Conversation
This patch adds connection():secure() API to check whether the current connection is using SSL or not. Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
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.
Nice. Small question.
Connection object API | ||
--------------------- | ||
|
||
secure() |
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.
Thing for the future where I'm guessing people are going to ask for SSL/TLS connection properties in Lua, should we instead return an SSL/TLS object? This object could have no methods right now but the presence of the object or nil could indicate secure? Just thinking for the future. Thoughts?
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.
Seems like a good idea. Will update it.
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.
Updated.
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
If not nil then it is secure and vice versa. Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
@dio Thank you so much for adding this and the protocol API, useful stuff. |
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.
Nice, small doc question.
|
||
Returns the current request's underlying :repo:`connection <include/envoy/network/connection.h>`. | ||
|
||
Returns a :ref:`metadata object <config_http_filters_lua_connection_wrapper>`. |
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.
"metadata object" ? Is this a copy/paste error?
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.
@mattklein123 oops. Sorry about that. Fixed in 22680ac.
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
@dio looks like coverage is below the limit. You might need to look at adding some: https://s3.amazonaws.com/lyft-envoy/coverage/report-master/coverage.html. Unfortunately looks like we have slipped again. |
OK, will take a look. |
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
@mattklein123 I guess it looks OK now. |
Description:
This patch adds
connection():ssl()
toStreamHandleWrapper
. ThisAPI returns the indication if the underlying connection using SSL or not.
Risk Level: Low
Testing:
Unit and integration tests
Docs Changes:
connection():ssl()
API.Release Notes:
connection()
wrapper andssl()
API.Related PR: #3760 (merged)
Fixes #3704
Signed-off-by: Dhi Aurrahman dio@rockybars.com