-
Notifications
You must be signed in to change notification settings - Fork 72
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
udpa: clarify URI fragment encoding of directives. #30
Conversation
After spending some time looking at RFC3986 and chatting with Louis, it seems we can support multiple directives in the fragment, but we need to be very precise on how they are percent encoded. This patch proposes that we move from having multiple fragments (which are not allowed in RFC compliant URIs) to a single fragment with comma-separated percent encoded directives. Comma was selected as it is an available character in RFC3986 sub-delims, intuitively indicates separation, and is less likely to appear in URIs (forcing percent encoding) than other alternatives, e.g. '&' which would appear in most URIs with context parameters. Percent encoded directives in URIs should remain fairly readable, for example udpa://foo#entry=something,alt=udpa://bar/baz&x=y requires no percent encoding. Signed-off-by: Harvey Tuch <htuch@google.com>
@markdroth @louiscryan for review |
Signed-off-by: Harvey Tuch <htuch@google.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.
I can live with this if it's the consensus, but I'd still prefer to use a repeated UdpaResourceLocator
instead of having an alt
directive. To me, the fact that we need so much machinery around encoding this in a URI is a pretty strong indicator that while we can make this work, that doesn't mean we should.
udpa/core/v1/resource_locator.proto
Outdated
// | ||
// When encoding to URIs, directives take form: | ||
// | ||
// <directive name>=<string representation of directive value>. |
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.
Suggest removing the trailing .
here, just to make it clear that that's not expected to be present in the format.
@markdroth if we did move |
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
After spending some time looking at RFC3986 and chatting with Louis, it
seems we can support multiple directives in the fragment, but we need to
be very precise on how they are percent encoded.
This patch proposes that we move from having multiple fragments (which
are not allowed in RFC compliant URIs) to a single fragment with
comma-separated percent encoded directives. Comma was selected as it is
an available character in RFC3986 sub-delims, intuitively indicates
separation, and is less likely to appear in URIs (forcing percent
encoding) than other alternatives, e.g. '&' which would appear in most
URIs with context parameters.
Percent encoded directives in URIs should remain fairly readable, for
example udpa://foo#entry=something,alt=udpa://bar/baz&x=y requires no
percent encoding.
Signed-off-by: Harvey Tuch htuch@google.com