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 empty success from /identity GET #1491

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Conversation

lcodes
Copy link
Contributor

@lcodes lcodes commented Jul 10, 2024

Description of Changes

#1371

Swap out the previous 404 for a default response.

API and ABI breaking changes

Changes the behavior in case of an empty email match, going from a client error to an empty success for its response.

Expected complexity level and risk

0

Testing

λ curl localhost:3000/[email protected]
{"identities":[]}

λ curl -I localhost:3000/identity
HTTP/1.1 400 Bad Request

@@ -77,7 +77,7 @@ pub async fn get_identity<S: ControlStateDelegate>(
(!identities.is_empty()).then_some(GetIdentityResponse { identities })
}
};
let identity_response = lookup.ok_or(StatusCode::NOT_FOUND)?;
let identity_response = lookup.unwrap_or_default();
Copy link
Collaborator

@bfops bfops Jul 10, 2024

Choose a reason for hiding this comment

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

nit: it seems like we should still return an error (maybe 400 / Bad Request) if no email is provided at all?

@lcodes lcodes force-pushed the jeremie/identity-empty-success branch from cddc396 to 4d3cfa9 Compare July 11, 2024 18:24
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

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

Nice, this simplified version is even clearer. LGTM!

@bfops bfops added the release-any To be landed in any release window label Jul 15, 2024
@lcodes lcodes enabled auto-merge July 16, 2024 17:28
@lcodes lcodes added this pull request to the merge queue Jul 16, 2024
Merged via the queue into master with commit cadf986 Jul 16, 2024
8 checks passed
@lcodes lcodes deleted the jeremie/identity-empty-success branch July 16, 2024 17:58
@bfops bfops added the api-break A PR that makes an API breaking change label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break A PR that makes an API breaking change release-any To be landed in any release window
Projects
None yet
3 participants