-
Notifications
You must be signed in to change notification settings - Fork 14
Conjure User-Agents supports arbitrary comment data #186
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
Conversation
Generate changelog in
|
Invalidated by push of 30cd2b2
Released 2.13.0 |
* Note that this library provides a much stricter set of allowed | ||
* characters within comments than the linked RFCs to reduce complexity. | ||
* | ||
* Allowed characters: "a-zA-Z0-9.-:_/ " |
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.
@PhoebeSzmucer Where does this get enforced, and what happens if a comment is provided that contains a character outside of this set?
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's enforced on the conjure-java side palantir/conjure-java-runtime-api#1286
I felt like we don't want to validate here again, because it wouldn't be much safer. But I still wanted to mention this requirement, since the BE validates this.
Do you have another idea? I'm happy to open a FLUP PR to do something else.
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 worry a bit that the "comments" terminology implies that it allows arbitrary text, including potentially user-entered text, which could lead applications to completely fail to load under particular conditions (e.g. when the text contains a comma). If we added %
to this list, we could consider explicitly URL-encoding each comment?
In practice, we should never be including user-entered content in user agents due to log safety, so I think this is fine for our planned use-cases. Just feels like a bit more of a footgun than we typically leave around.
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 looks like we'd also need to add !~*'( )
to this list to fully support URL-encoding.
Let's keep this as it is for now given it matches the BE behavior and works for how we intend to use it.
Analogous to palantir/conjure-java-runtime-api#1286