Skip to content

Commit

Permalink
ref(projconfig): Unsupport v4 in the endpoint (#2500)
Browse files Browse the repository at this point in the history
Both project and global configs use v3 when requesting from upstream. As
a result, v4 is no longer used and can be safely removed.
  • Loading branch information
iker-barriocanal authored Sep 12, 2023
1 parent 23122bd commit ae7373e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions relay-server/src/endpoints/project_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ const ENDPOINT_V2: u16 = 2;
/// returned, or a further poll ensues.
const ENDPOINT_V3: u16 = 3;

/// V4 version of this endpoint.
///
/// Can be used for fetching global configs.
const ENDPOINT_V4: u16 = 4;

/// Helper to deserialize the `version` query parameter.
#[derive(Clone, Copy, Debug, Deserialize)]
struct VersionQuery {
Expand Down Expand Up @@ -76,9 +71,8 @@ impl ProjectStateWrapper {
/// made by an external relay who's public key is not configured as authorised on the project.
///
/// Version 3 also adds a list of projects whose response is pending. A [`ProjectKey`] should never
/// be in both collections. This list is always empty before V3.
///
/// Version 4 adds a global config [`GlobalConfig`] if `global` is enabled.
/// be in both collections. This list is always empty before V3. If `global` is
/// enabled, version 3 also responds with [`GlobalConfig`].
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct GetProjectStatesResponseWrapper {
Expand Down Expand Up @@ -176,7 +170,7 @@ async fn inner(

/// Returns `true` if the `?version` query parameter is compatible with this implementation.
fn is_compatible(Query(query): Query<VersionQuery>) -> bool {
query.version >= ENDPOINT_V2 && query.version <= ENDPOINT_V4
query.version >= ENDPOINT_V2 && query.version <= ENDPOINT_V3
}

/// Endpoint handler for the project configs endpoint.
Expand Down

0 comments on commit ae7373e

Please sign in to comment.