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

Taskprov: fix authorization bug in aggregate init call #2023

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Sep 29, 2023

Calls to /aggregate subsequent to taskprov task provisioning would fail for the same task, because /aggregate was not using the right authorization tokens (that is, it was attempting to use non-existent authorization tokens and failing).

The first commit is just a refactoring PR to make the test implementation cleaner. The second commit is the operative one.

@inahga inahga requested a review from a team as a code owner September 29, 2023 18:16
@tgeoghegan
Copy link
Contributor

I think you'll need to rebase now that #2019 has landed, and maybe some more as I will be landing changes to aggregator/src/aggregator.rs.

@inahga
Copy link
Contributor Author

inahga commented Sep 29, 2023

No problem, I can hang onto this until the PR churn is done.

@inahga inahga force-pushed the inahga/fix-taskprov-bug branch 2 times, most recently from c423295 to d6c1f6f Compare October 2, 2023 14:46
@inahga
Copy link
Contributor Author

inahga commented Oct 2, 2023

Rebase complete, should be ready for review.

);
let aggregate_resp: AggregationJobResp = decode_response_body(&mut test_conn).await;

assert_eq!(aggregate_resp.prepare_resps().len(), 1, "{}", name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
assert_eq!(aggregate_resp.prepare_resps().len(), 1, "{}", name);
assert_eq!(aggregate_resp.prepare_resps().len(), 1, "{name}");

and in a few other places

}
}

fn generate_helper_report_share(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this looks a lot like what aggregator::aggregate_init_tests::PrepareInitGenerator does. It goes and constructs a PrepareInit, but on the way there it does generate a VDAF transcript and generate a report share. I wonder if you could add a PrepareInitGenerator::next_report_share_with_metadata and use that here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about the latest commit? It's not really a simplification IMO, but I like that it expands on PrepareInitGenerator to make other kinds of tests easier to write.

Aggregate init calls subsequent to a call that provisioned a task would fail, since we were using
the wrong (non-existent) task-specific auth tokens for authorization.
@inahga inahga enabled auto-merge (squash) October 5, 2023 22:11
@inahga inahga merged commit 85b1f78 into main Oct 5, 2023
8 checks passed
@inahga inahga deleted the inahga/fix-taskprov-bug branch October 5, 2023 23:23
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.

2 participants