-
Notifications
You must be signed in to change notification settings - Fork 583
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
The authorization header was not dropped by redirect strategy as expected. #5984
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
|
||
/** | ||
* @author Adam J. Weigold | ||
* @author Corneil du Plessis | ||
*/ | ||
@RestController | ||
public class S3SignedRedirectRequestController { | ||
|
@@ -68,7 +69,7 @@ public ResponseEntity<Map<String, String>> getBlobRedirect(@RequestHeader("Autho | |
|
||
@RequestMapping("/test/docker/registry/v2/blobs/test/data") | ||
public ResponseEntity<Resource> getSignedBlob(@RequestHeader Map<String, String> headers) { | ||
if (headers.containsKey("authorization")) { | ||
if (!headers.containsKey("authorization")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious why it worked in 2.11.x when the test said it should not contain There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The question is then how does the authorization header not get dropped? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comparing org.apache.hc.client5.http.protocol.RedirectStrategy There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The initial change I made was invalid and reversed. |
||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST); | ||
} | ||
return buildFromString("{\"config\": {\"Labels\": {\"foo\": \"bar\"} } }"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
|
||
/** | ||
* @author Adam J. Weigold | ||
* @author Corneil du Plessis | ||
*/ | ||
@RestController | ||
public class S3SignedRedirectRequestController { | ||
|
@@ -68,7 +69,7 @@ public ResponseEntity<Map<String, String>> getBlobRedirect(@RequestHeader("Autho | |
|
||
@RequestMapping("/test/docker/registry/v2/blobs/test/data") | ||
public ResponseEntity<Resource> getSignedBlob(@RequestHeader Map<String, String> headers) { | ||
if (headers.containsKey("authorization")) { | ||
if (!headers.containsKey("authorization")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be removed as it is expected that the auth header has been removed. Same as the other S3 test controller thing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST); | ||
} | ||
return buildFromString("{\"config\": {\"Labels\": {\"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.
[UNRELATED-TO-YOUR-CHANGES] These 2 controllers are terribly named and there is no comment telling us that these are test controllers used to mimic what S3 signed redirects look like.
Because it is a test, we do not need to instrument it w/ log statements to debug. In that case, we can just walk through it in a debugger. Do you mind removing these debugging log statements?
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.
Done