Skip to content

Revisiting reset_all and reset_all_tagged #369

Description

@cfzimmerman

dpd-api currently marks both these with "TODO-security: This endpoint should probably not exist."

dendrite/dpd-api/src/lib.rs

Lines 1544 to 1573 in 2475028

/// Clear all settings associated with a specific tag.
///
/// This removes:
///
/// - All ARP or NDP table entries.
/// - All routes
/// - All links on all switch ports
// Note: This endpoint does not clear multicast groups.
// TODO-security: This endpoint should probably not exist.
#[endpoint {
method = DELETE,
path = "/all-settings/{tag}",
}]
async fn reset_all_tagged(
rqctx: RequestContext<Self::Context>,
path: Path<latest::misc::TagPath>,
) -> Result<HttpResponseUpdatedNoContent, HttpError>;
/// Clear all settings.
///
/// This removes all data entirely.
// Note: Unlike `reset_all_tagged`, this endpoint does clear multicast groups.
// TODO-security: This endpoint should probably not exist.
#[endpoint {
method = DELETE,
path = "/all-settings"
}]
async fn reset_all(
rqctx: RequestContext<Self::Context>,
) -> Result<HttpResponseUpdatedNoContent, HttpError>;

I'm making adjacent changes to resource tagging, and I'd like to know whether to version-migrate the tagged endpoints or sunset them both. If the former, I'd like to replace the TODO comments. If the latter, I'll open a PR for removal.

tfportd is the only user I've found so far. Not clear to me how to migrate this if we decide to delete the endpoints. Open to suggestions.

// If the reset fails, we'll just log the error and continue, as we will
// try to clean-up the any stale settings during the normal reconciliation
// process. If those fail, we log an error and try again on a subsequent
// iterations.
if let Err(e) = client.reset_all_tagged(CLIENT_NAME).await {
error!(log, "Error while flushing old state: {e:?}");
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions