-
Notifications
You must be signed in to change notification settings - Fork 974
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
Implement username* validation and decoding in DigestScheme #511
Implement username* validation and decoding in DigestScheme #511
Conversation
|
||
// Extract username and username* | ||
String username = credentials.getUserName(); | ||
final String usernameStar = paramMap.get("username*"); |
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.
@arturobernalg This looks wrong. The server is not supposed to be sending us username*
in the auth challenge, or at any rate, we should not be using it. We should only be using the username provided by CredentialsProvider
.
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.
HI @ok2c
you're right. Please do another pass.
TY
fa714a1
to
3fcc9f6
Compare
if (u != -1 && l != -1) { | ||
bb.put((byte) ((u << 4) + l)); | ||
} else { | ||
throw new IllegalArgumentException("Invalid percent encoding in " + s); |
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.
@arturobernalg Can we throw a better exception here, like CodingException
of some sort, which could be caught at a higher level and translated in a proper protocol exception?
* should not be used as part of the public API. | ||
*/ | ||
@Internal | ||
class RFC5987Codec { |
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.
@arturobernalg There is a similar implementation in the HttpRFC7578Multipart
class. Could you please get rid of it in this or a follow-up change-set?
Introduces validation and decoding logic for the 'username*' field in the DigestScheme class. The changes ensure compliance with RFC 7616 and RFC 5987 by handling cases where the 'username' contains characters not allowed in an ABNF quoted-string.
4cc80db
to
9dab859
Compare
@ok2c please take another look. |
Introduces validation and decoding logic for the 'username*' field in the DigestScheme class. The changes ensure compliance with RFC 7616 and RFC 5987 by handling cases where the 'username' contains characters not allowed in an ABNF quoted-string.
Introduces validation and decoding logic for the 'username*' field in the DigestScheme class. The changes ensure compliance with RFC 7616 and RFC 5987 by handling cases where the 'username' contains characters not allowed in an ABNF quoted-string.