Skip to content

Commit 35de31f

Browse files
authored
refactor(client)!: rename face verifier client to flamingo verifier client (#105)
* refactor(client)!: rename to FlamingoVerifierClient * chore: clean up legacy verifier names
1 parent 3377de5 commit 35de31f

9 files changed

Lines changed: 33 additions & 33 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Embedding Verifier
1+
# Flamingo
22

33
TODO: This Readme contains a lot of AI slob and needs to be fully reworked once we move out of prototyping phase.
44

5-
Rust workspaces for the embedding verifier host and secure enclave.
5+
Rust workspaces for the Flamingo Verifier host and secure enclave.
66

77
## Structure
88

@@ -79,7 +79,7 @@ Nix builds the OCI image and converts its root filesystem directly with aws-nitr
7979
```bash
8080
# Reproducible OCI image -> deterministic EIF + PCRs.
8181
# Needs Linux x86_64; Nitro hardware is only needed to run.
82-
scripts/build-enclaves.sh --workload verifier # -> target/eif/flamingo-verifier-enclave.eif, flamingo-verifier-pcr.json
82+
scripts/build-enclaves.sh --workload verifier # -> target/eif/verifier-enclave.eif, verifier-pcr.json
8383
scripts/build-enclaves.sh --workload di # -> target/eif/di-enclave.eif, di-pcr.json
8484

8585
# Build or inspect only the reproducible OCI boundary.

scripts/Dockerfile.carrier

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2023
1212
RUN dnf install -y aws-nitro-enclaves-cli aws-nitro-enclaves-cli-devel jq && \
1313
dnf clean all
1414

15-
ARG EIF_FILE=deepface-enclave.eif
15+
ARG EIF_FILE=verifier-enclave.eif
1616
COPY ${EIF_FILE} /home/enclave.eif
1717

1818
# ENCLAVE_CID is unset by default (auto-assigned CID). Set it to pin the

verifier/client/src/client.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! HTTP client for the embedding verifier host.
1+
//! HTTP client for the Flamingo Verifier host.
22
33
use base64::{Engine as _, engine::general_purpose::STANDARD};
44

@@ -38,19 +38,18 @@ impl VerifiedAssignment {
3838
}
3939
}
4040

41-
// TODO: Rename FaceVerifierClient to FlamingoVerifierClient.
42-
/// Calls the face verifier host and verifies the attestation documents it relays.
41+
/// Calls the Flamingo Verifier host and verifies the attestation documents it relays.
4342
///
4443
/// Nothing is returned until the enclave that produced it has been verified, so callers
4544
/// cannot accidentally use an unattested key.
4645
#[derive(Debug)]
47-
pub struct FaceVerifierClient {
46+
pub struct FlamingoVerifierClient {
4847
config: Config,
4948
http: reqwest::Client,
5049
verifier: Verifier,
5150
}
5251

53-
impl FaceVerifierClient {
52+
impl FlamingoVerifierClient {
5453
/// Builds a client from `config`.
5554
///
5655
/// # Errors
@@ -296,7 +295,7 @@ mod tests {
296295
use pontifex::{ChannelConsumer, ChannelDomain, ChannelEnclave};
297296
use serde_json::{Value, json};
298297

299-
use super::{FaceVerifierClient, MatchRequestBody};
298+
use super::{FlamingoVerifierClient, MatchRequestBody};
300299
use crate::{Config, Error, PcrMeasurement};
301300

302301
fn config(base_url: &str) -> Config {
@@ -355,7 +354,7 @@ mod tests {
355354
}
356355

357356
async fn request_match_with_consumer(
358-
client: &FaceVerifierClient,
357+
client: &FlamingoVerifierClient,
359358
consumer: &ChannelConsumer,
360359
inputs: &MatchInputs,
361360
) -> Result<MatchResult, Error> {
@@ -465,7 +464,7 @@ mod tests {
465464
async fn a_sealed_rejection_round_trips() {
466465
let answer = MatchResult::Failed(FailureReason::MatchBelowThreshold);
467466
let (base_url, responder, seen) = serve_enclave(answer.clone(), false).await;
468-
let client = FaceVerifierClient::new(config(&base_url)).expect("client should build");
467+
let client = FlamingoVerifierClient::new(config(&base_url)).expect("client should build");
469468

470469
let result = request_match_with_consumer(&client, &consumer_for(&responder), &inputs())
471470
.await
@@ -491,7 +490,7 @@ mod tests {
491490
async fn a_reply_from_another_exchange_cannot_be_opened() {
492491
let (base_url, responder, _) =
493492
serve_enclave(MatchResult::Failed(FailureReason::MalformedInputs), true).await;
494-
let client = FaceVerifierClient::new(config(&base_url)).expect("client should build");
493+
let client = FlamingoVerifierClient::new(config(&base_url)).expect("client should build");
495494

496495
let error = request_match_with_consumer(&client, &consumer_for(&responder), &inputs())
497496
.await
@@ -503,7 +502,7 @@ mod tests {
503502
#[tokio::test]
504503
async fn a_stale_assignment_asks_for_a_reassignment() {
505504
let base_url = serve_error(StatusCode::CONFLICT, "reassign_required", true).await;
506-
let client = FaceVerifierClient::new(config(&base_url)).expect("client should build");
505+
let client = FlamingoVerifierClient::new(config(&base_url)).expect("client should build");
507506
let responder = ChannelEnclave::generate(ChannelDomain::new(MATCH_CHANNEL_DOMAIN))
508507
.expect("channel key");
509508

@@ -520,7 +519,7 @@ mod tests {
520519
#[tokio::test]
521520
async fn other_envelopes_keep_their_code_and_retry_flag() {
522521
let base_url = serve_error(StatusCode::PAYLOAD_TOO_LARGE, "request_too_large", false).await;
523-
let client = FaceVerifierClient::new(config(&base_url)).expect("client should build");
522+
let client = FlamingoVerifierClient::new(config(&base_url)).expect("client should build");
524523
let responder = ChannelEnclave::generate(ChannelDomain::new(MATCH_CHANNEL_DOMAIN))
525524
.expect("channel key");
526525

@@ -549,7 +548,7 @@ mod tests {
549548
post(|| async { (StatusCode::BAD_GATEWAY, "not json") }),
550549
);
551550
let base_url = serve(router).await;
552-
let client = FaceVerifierClient::new(config(&base_url)).expect("client should build");
551+
let client = FlamingoVerifierClient::new(config(&base_url)).expect("client should build");
553552
let responder = ChannelEnclave::generate(ChannelDomain::new(MATCH_CHANNEL_DOMAIN))
554553
.expect("channel key");
555554

@@ -568,7 +567,8 @@ mod tests {
568567
signing_key_attestation: attestation,
569568
});
570569
let (base_url, responder, _) = serve_enclave(answer, false).await;
571-
let client = FaceVerifierClient::new(config(&base_url)).expect("client should build");
570+
let client =
571+
FlamingoVerifierClient::new(config(&base_url)).expect("client should build");
572572

573573
let error = request_match_with_consumer(&client, &consumer_for(&responder), &inputs())
574574
.await

verifier/client/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const fn default_request_timeout_millis() -> u64 {
2525
60_000
2626
}
2727

28-
/// Configuration to interact with an embedding verifier host.
28+
/// Configuration to interact with a Flamingo Verifier host.
2929
#[derive(Clone, Debug, Serialize, Deserialize)]
3030
#[serde(deny_unknown_fields)]
3131
pub struct Config {
@@ -276,7 +276,7 @@ mod tests {
276276
}))
277277
.unwrap();
278278
assert!(matches!(
279-
crate::FaceVerifierClient::new(config),
279+
crate::FlamingoVerifierClient::new(config),
280280
Err(Error::InvalidConfig { .. })
281281
));
282282
}

verifier/client/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
//! Client for the embedding verifier's enclave-assignment flow.
1+
//! Client for the Flamingo Verifier's enclave-assignment flow.
22
//!
33
//! Fetches an assignment, verifies the AWS Nitro attestation document it carries, and yields
44
//! a [`ChannelConsumer`] bound to the separately supplied public key. The signed document
55
//! commits to that key; Pontifex checks the commitment, measurements, signature and freshness.
66
//!
77
//! ```no_run
8-
//! use flamingo_verifier_client::{Config, FaceVerifierClient, PcrMeasurement};
8+
//! use flamingo_verifier_client::{Config, FlamingoVerifierClient, PcrMeasurement};
99
//! use flamingo_verifier_sealed_types::MatchInputs;
1010
//!
1111
//! # async fn example(inputs: &MatchInputs, pcr0: [u8; 48]) -> Result<(), Box<dyn std::error::Error>> {
1212
//! let config = Config::new(
1313
//! "https://verifier.example.com",
1414
//! vec![vec![PcrMeasurement::new(0, pcr0)]],
1515
//! )?;
16-
//! let client = FaceVerifierClient::new(config)?;
16+
//! let client = FlamingoVerifierClient::new(config)?;
1717
//! let assignment = client.request_assignment().await?;
1818
//! let result = client.request_match(&assignment, inputs).await?;
1919
//! # Ok(())
@@ -32,7 +32,7 @@ mod client;
3232
mod config;
3333
mod error;
3434

35-
pub use client::{FaceVerifierClient, VerifiedAssignment};
35+
pub use client::{FlamingoVerifierClient, VerifiedAssignment};
3636
pub use config::Config;
3737
pub use error::Error;
3838
pub use pontifex::{ChannelConsumer, PcrMeasurement};

verifier/client/tests/assignment.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use axum::http::StatusCode;
77
use axum::routing::post;
88
use flamingo_verifier_client as client;
99
use flamingo_verifier_client::PcrMeasurement;
10-
use flamingo_verifier_client::{Config, FaceVerifierClient};
10+
use flamingo_verifier_client::{Config, FlamingoVerifierClient};
1111
use hex_literal::hex;
1212

1313
fn config(base_url: &str) -> Config {
@@ -58,7 +58,7 @@ async fn rejects_an_assignment_whose_attestation_does_not_verify() {
5858
// A syntactically fine response carrying a document signed by nobody.
5959
let base_url = serve_assignment("hEBAQEA=", "a2V5").await;
6060

61-
let error = FaceVerifierClient::new(config(&base_url))
61+
let error = FlamingoVerifierClient::new(config(&base_url))
6262
.expect("client should build")
6363
.request_assignment()
6464
.await
@@ -74,7 +74,7 @@ async fn rejects_an_assignment_whose_attestation_does_not_verify() {
7474
async fn rejects_malformed_base64_in_either_assignment_field() {
7575
for (document, key) in [("!", "a2V5"), ("hEBAQEA=", "!")] {
7676
let base_url = serve_assignment(document, key).await;
77-
let error = FaceVerifierClient::new(config(&base_url))
77+
let error = FlamingoVerifierClient::new(config(&base_url))
7878
.unwrap()
7979
.request_assignment()
8080
.await
@@ -91,7 +91,7 @@ async fn surfaces_a_host_error_status_rather_than_retrying() {
9191
))
9292
.await;
9393

94-
let error = FaceVerifierClient::new(config(&base_url))
94+
let error = FlamingoVerifierClient::new(config(&base_url))
9595
.expect("client should build")
9696
.request_assignment()
9797
.await

verifier/client/tests/stickiness.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use axum::extract::State;
1212
use axum::http::{HeaderMap, header};
1313
use axum::routing::post;
1414
use flamingo_verifier_client::PcrMeasurement;
15-
use flamingo_verifier_client::{Config, FaceVerifierClient};
15+
use flamingo_verifier_client::{Config, FlamingoVerifierClient};
1616
use hex_literal::hex;
1717

1818
/// What a target group's `lb_cookie` stickiness looks like on the wire.
@@ -71,8 +71,8 @@ async fn carries_the_affinity_cookie_from_the_assignment_to_the_next_call() {
7171
.expect("stub should run");
7272
});
7373

74-
let client =
75-
FaceVerifierClient::new(config(&format!("http://{address}"))).expect("client should build");
74+
let client = FlamingoVerifierClient::new(config(&format!("http://{address}")))
75+
.expect("client should build");
7676

7777
for _ in 0..2 {
7878
client

verifier/e2e/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{env, fs, path::PathBuf};
22

33
use anyhow::{Context, Result, anyhow, bail, ensure};
4-
use flamingo_verifier_client::{Config, FaceVerifierClient, VerifiedAssignment};
4+
use flamingo_verifier_client::{Config, FlamingoVerifierClient, VerifiedAssignment};
55
use flamingo_verifier_enclave_types::MatchRequest;
66
use flamingo_verifier_protocol::match_token::{self, EdDSAPublicKey};
77
use flamingo_verifier_sealed_types::{MatchInputs, MatchResult};
@@ -23,7 +23,7 @@ async fn main() -> Result<()> {
2323
let config = load_config()?;
2424
let verifier = config.verifier()?;
2525

26-
let client = FaceVerifierClient::new(config).context("failed to build the client")?;
26+
let client = FlamingoVerifierClient::new(config).context("failed to build the client")?;
2727
let assignment = client
2828
.request_assignment()
2929
.await

verifier/host/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! HTTP host for the embedding verifier — the untrusted side of the enclave boundary.
1+
//! HTTP host for the Flamingo Verifier — the untrusted side of the enclave boundary.
22
33
#![deny(
44
clippy::all,

0 commit comments

Comments
 (0)