Skip to content

Commit

Permalink
Rename AggregatorTaskParameters::TaskprovHelper
Browse files Browse the repository at this point in the history
For consistency with other renderings of "Taskprov". See previous
discussion in [1].

[1]: #2017 (comment)
  • Loading branch information
tgeoghegan committed Sep 29, 2023
1 parent 4c849a0 commit 122c615
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ impl<C: Clock> Aggregator<C> {
*peer_aggregator.tolerable_clock_skew(),
// Taskprov task has no per-task HPKE keys
[],
task::AggregatorTaskParameters::TaskProvHelper,
task::AggregatorTaskParameters::TaskprovHelper,
)
.map_err(|err| Error::InvalidTask(*task_id, OptOutReason::TaskParameters(err)))?;
self.datastore
Expand Down
2 changes: 1 addition & 1 deletion aggregator_core/src/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ impl<C: Clock> Transaction<'_, C> {
aggregator_auth_token,
collector_hpke_config,
},
(AggregatorRole::Helper, None, None, None) => AggregatorTaskParameters::TaskProvHelper,
(AggregatorRole::Helper, None, None, None) => AggregatorTaskParameters::TaskprovHelper,
values => {
return Err(Error::DbState(format!(
"found task row with unexpected combination of values {values:?}",
Expand Down
14 changes: 7 additions & 7 deletions aggregator_core/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl Task {
self.time_precision,
self.tolerable_clock_skew,
self.hpke_keys.values().cloned().collect::<Vec<_>>(),
AggregatorTaskParameters::TaskProvHelper,
AggregatorTaskParameters::TaskprovHelper,
)
}

Expand Down Expand Up @@ -611,7 +611,7 @@ impl From<AggregatorTask> for Task {
None,
Some(collector_hpke_config.clone()),
),
AggregatorTaskParameters::TaskProvHelper => (
AggregatorTaskParameters::TaskprovHelper => (
Role::Helper,
aggregator_task.peer_aggregator_endpoint.clone(),
fake_aggregator_url,
Expand Down Expand Up @@ -801,7 +801,7 @@ impl AggregatorTask {

if !matches!(
aggregator_parameters,
AggregatorTaskParameters::TaskProvHelper
AggregatorTaskParameters::TaskprovHelper
) && hpke_keys.is_empty()
{
return Err(Error::InvalidParameter("hpke_keys"));
Expand All @@ -814,7 +814,7 @@ impl AggregatorTask {
{
if matches!(
aggregator_parameters,
AggregatorTaskParameters::TaskProvHelper
AggregatorTaskParameters::TaskprovHelper
) {
return Err(Error::InvalidParameter(
"batch_time_window_size is not supported for taskprov",
Expand Down Expand Up @@ -1057,15 +1057,15 @@ pub enum AggregatorTaskParameters {
},
/// Task parameters held exclusively by a DAP helper provisioned via taskprov. Currently there
/// are no such parameters.
TaskProvHelper,
TaskprovHelper,
}

impl AggregatorTaskParameters {
/// Returns the [`Role`] that this aggregator plays.
pub fn role(&self) -> &Role {
match self {
Self::Leader { .. } => &Role::Leader,
Self::Helper { .. } | Self::TaskProvHelper => &Role::Helper,
Self::Helper { .. } | Self::TaskprovHelper => &Role::Helper,
}
}

Expand Down Expand Up @@ -1723,7 +1723,7 @@ pub mod test_util {
self.common_parameters.clone(),
self.leader_aggregator_endpoint.clone(),
[],
AggregatorTaskParameters::TaskProvHelper,
AggregatorTaskParameters::TaskprovHelper,
)
}

Expand Down

0 comments on commit 122c615

Please sign in to comment.