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
8275534: com.sun.net.httpserver.BasicAuthenticator should check whether "realm" is a quoted string #6117
Conversation
|
/csr needed |
@FrauBoes has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
Webrevs
|
src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java
Show resolved
Hide resolved
@@ -65,16 +72,23 @@ public BasicAuthenticator (String realm) { | |||
* @apiNote {@code UTF-8} is the recommended charset because its usage is | |||
* communicated to the client, and therefore more likely to be used also | |||
* by the client. | |||
* <p>Where a backslash ("\") is used as quoting mechanism within the realm | |||
* string, it must be escaped by two preceding backslashes, for example | |||
* {@code "foo\\\"bar\\\""} will be embedded as {@code "foo\"bar\""}. |
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.
Same point as above
src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java
Outdated
Show resolved
Hide resolved
src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java
Outdated
Show resolved
Hide resolved
* change method name to isQuotedStringContent * update api note and throws declaration
@FrauBoes This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 106 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
/integrate |
Going to push as commit ee49963.
Your commit was automatically rebased without conflicts. |
This change ensures that the realm string passed to the BasicAuthenticator constructor is a quoted-string, as per RFC7230 [1]. A Utils class is added to jdk.httpserver/sun.net.httpserver that holds the new isQuotedString() method and the pre-existing isValidName() method (previously in ServerImpl.)
Two tests are included:
Testing: tier 1-3.
[1] https://datatracker.ietf.org/doc/html/rfc7230
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6117/head:pull/6117
$ git checkout pull/6117
Update a local copy of the PR:
$ git checkout pull/6117
$ git pull https://git.openjdk.java.net/jdk pull/6117/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6117
View PR using the GUI difftool:
$ git pr show -t 6117
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6117.diff