Drop a disused endpoint for fetching the caller's own signed pre-key

This commit is contained in:
Jon Chambers
2023-06-16 17:49:26 -04:00
committed by Jon Chambers
parent 8d995e456e
commit c78c109577
2 changed files with 0 additions and 43 deletions

View File

@@ -261,20 +261,6 @@ public class KeysController {
});
}
@Timed
@GET
@Path("/signed")
@Produces(MediaType.APPLICATION_JSON)
public Optional<ECSignedPreKey> getSignedKey(@Auth final AuthenticatedAccount auth,
@QueryParam("identity") final Optional<String> identityType) {
Device device = auth.getAuthenticatedDevice();
ECSignedPreKey signedPreKey = usePhoneNumberIdentity(identityType) ?
device.getPhoneNumberIdentitySignedPreKey() : device.getSignedPreKey();
return Optional.ofNullable(signedPreKey);
}
private static boolean usePhoneNumberIdentity(final Optional<String> identityType) {
return "pni".equals(identityType.map(String::toLowerCase).orElse("aci"));
}