Skip to content
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

Return HTTP 400 on unrecognized task ID #908

Merged
merged 1 commit into from
Jan 12, 2023
Merged

Conversation

tgeoghegan
Copy link
Contributor

@tgeoghegan tgeoghegan commented Jan 12, 2023

DAP-02's section on /hpke_config included a requirement that requests
for HPKE configs where the task ID is unrecognized should yield HTTP 404
Not Found. Our implementation returned 404 from all endpoints if the
request referenced an unrecognized task ID, which was not in compliance
with DAP-02, since the errors section says that HTTP 400 Bad Request
should be used "unless otherwise specified" (it was only otherwise
specified for /hpke_config).

DAP-03 improves this by removing the HTTP 404 Not Found requirement from
/hpke_config, so now we can uniformly return HTTP 400 Bad Request for
all unrecognizedTask errors, and in fact all errors since no protocol
text ever specifies otherwise.

This situation still isn't optimal, because the protocol shouldn't force
us to use Bad Request everywhere, but we will have to wait for future
DAP revisions to fix that.

Closes #705

@tgeoghegan tgeoghegan requested a review from a team as a code owner January 12, 2023 18:48
@tgeoghegan tgeoghegan force-pushed the timg/unrecognized-task-400 branch 2 times, most recently from 2b6f06c to 5903102 Compare January 12, 2023 18:58
DAP-02's section on `/hpke_config` included a requirement that requests
for HPKE configs where the task ID is unrecognized should yield HTTP 404
Not Found. Our implementation returned 404 from *all* endpoints if the
request referenced an unrecognized task ID, which was not in compliance
with DAP-02, since the errors section says that HTTP 400 Bad Request
should be used "unless otherwise specified" (it was only otherwise
specified for `/hpke_config`).

DAP-03 improves this by removing the HTTP 404 Not Found requirement from
`/hpke_config`, so now we can uniformly return HTTP 400 Bad Request for
all `unrecognizedTask` errors, and in fact all errors since no protocol
text ever specifies otherwise.

This situation still isn't optimal, because the protocol shouldn't force
us to use Bad Request everywhere, but we will have to wait for future
DAP revisions to fix that.

Closes #705
@tgeoghegan tgeoghegan force-pushed the timg/unrecognized-task-400 branch from 5903102 to 4f10dce Compare January 12, 2023 18:59
@tgeoghegan tgeoghegan merged commit f1c4e87 into main Jan 12, 2023
@tgeoghegan tgeoghegan deleted the timg/unrecognized-task-400 branch January 12, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DAP-03: unrecognizedTask should use 400 Bad Request
2 participants