Skip to content

Add an incomplete implementation of quic_hostname_utils_impl.#6146

Merged
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
wu-bin:quic_platform_hostname_utils
Mar 6, 2019
Merged

Add an incomplete implementation of quic_hostname_utils_impl.#6146
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
wu-bin:quic_platform_hostname_utils

Conversation

@wu-bin
Copy link
Copy Markdown
Contributor

@wu-bin wu-bin commented Mar 1, 2019

Description:

Add quic_hostname_utils_impl to QUICHE implementation. The implementation is incomplete because Envoy does not have GoogleUrl yet.

Risk Level: minimal: code not used yet
Testing:

bazel test test/extensions/quic_listeners/quiche/platform:quic_platform_test --test_output=all --define quiche=enabled --experimental_remap_main_repo

Docs Changes: none
Release Notes: none
[Optional Fixes #Issue]
[Optional Deprecated:]

It is incomplete because GoogleUrl is not avaiable in Envoy yet.

Signed-off-by: Bin Wu <wub@google.com>
Signed-off-by: Bin Wu <wub@google.com>
@wu-bin
Copy link
Copy Markdown
Contributor Author

wu-bin commented Mar 1, 2019

/assign @mpwarres

mpwarres
mpwarres previously approved these changes Mar 4, 2019
Copy link
Copy Markdown
Contributor

@mpwarres mpwarres left a comment

Choose a reason for hiding this comment

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

LGTM

/assign @alyssawilk

host.erase(host_end, host.length() - host_end);
}

return host;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have an ETA on GoogleUrl?

StringUtil::toLower + rfind / substr should do both for you
For SNI validity I wonder if doing a quick strcat http://sni/ and tossing it in http::Utility::Url would work for a validity check.

If we're getting GoogleUrl soon I buy it may not be worth the work.

wu-bin added 2 commits March 6, 2019 14:22
…tname_utils

Signed-off-by: Bin Wu <wub@google.com>
…validity check to

QuicHostnameUtils::IsValidSNI.

Signed-off-by: Bin Wu <wub@google.com>
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

Cool - just one more nit and you're good to go

// Convert hostname to lowercase and remove the trailing '.'.
// WARNING: mutates |hostname| in place and returns |hostname|.
// NOTE(wub): This only removes trailing dots for now.
// NOTE(wub): This only does lowercasing and removes trailing dots for now.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

// Convert hostname to lowercase and remove the trailing '.'.
// NOTE(wub): This only does lowercasing and removes trailing dots for now.

can we remove the note?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rewrote the comment to reflect the current state. PTAL.


// static
bool QuicHostnameUtilsImpl::IsValidSNI(QuicStringPiece sni) {
// TODO(wub): Implement it on top of GoogleUrl, once it is available.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fine for now, but note for the SNI check if GoogleUrl takes a while we might be able to that string conversoin to IP fails, and strcat http://hostname using the existing Envoy Utl Utility passes and get full coverage without GoogleUrl

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack. Will definitely do a pass of TODO fixes after all platform impls are populated.

wu-bin added 2 commits March 6, 2019 15:38
…tname_utils

Signed-off-by: Bin Wu <wub@google.com>
@mattklein123 mattklein123 merged commit 62b38d5 into envoyproxy:master Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants