Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c5f775e
feat(identity-resolution): persons-seed resolver — email grouping + p…
mozhaev-dev Jul 16, 2026
1adbd33
feat(identity-resolution): persons-seed store — resolver reads + tran…
mozhaev-dev Jul 16, 2026
4d98010
feat(identity-resolution): persons-seed orchestration transforms — bu…
mozhaev-dev Jul 16, 2026
8d324ee
fix(identity-resolution): seed email normalization case-folds without…
mozhaev-dev Jul 16, 2026
4111b3e
feat(identity-resolution): persons-seed orchestrator + reader/store t…
mozhaev-dev Jul 16, 2026
ac97f71
feat(identity-resolution): ClickHouse identity_inputs reader (#1754)
mozhaev-dev Jul 16, 2026
c780159
feat(identity-resolution): operations job-tracking store (#1754)
mozhaev-dev Jul 16, 2026
84ce337
feat(identity-resolution): persons-seed API + background worker (#1754)
mozhaev-dev Jul 16, 2026
65e7d5b
feat(identity-resolution): org_chart rebuild in seed apply (#1754)
mozhaev-dev Jul 16, 2026
851a8e8
feat(identity-resolution): finish live-verified persons-seed write pa…
mozhaev-dev Jul 16, 2026
d71e29a
fix(identity-resolution): address CodeRabbit review on persons-seed (…
mozhaev-dev Jul 20, 2026
b9e95b4
feat(identity-resolution): admin-gate persons-seed + record caller as…
mozhaev-dev Jul 20, 2026
11b76c6
fix(identity-resolution): align persons-seed HTTP contract with .NET …
mozhaev-dev Jul 20, 2026
26e7645
fix(identity-resolution): gate all seed routes + harden ClickHouse re…
mozhaev-dev Jul 20, 2026
9357f8a
Merge remote-tracking branch 'upstream/main' into feat/identity-resol…
mozhaev-dev Jul 22, 2026
45771f6
fix(identity-resolution): caller from gateway-JWT + drop deprecated p…
mozhaev-dev Jul 22, 2026
85cfd83
fix(identity-resolution): drop always-null next_cursor from persons-s…
mozhaev-dev Jul 22, 2026
7a15ee2
docs(identity-resolution): document why raw SQL / self-managed pool (…
mozhaev-dev Jul 22, 2026
26f1817
docs(identity-resolution): move the org_chart NULL-parent note out of…
mozhaev-dev Jul 22, 2026
8f4f7d4
docs(identity-resolution): drop inline comment from the org_chart reb…
mozhaev-dev Jul 22, 2026
88b5027
docs(identity-resolution): use full constructorfabric/gears-rust#4239…
mozhaev-dev Jul 22, 2026
8aaf325
Merge branch 'main' into feat/identity-resolution-write-seed
mitasovr Jul 23, 2026
9e37a84
Merge remote-tracking branch 'upstream/main' into feat/identity-resol…
mozhaev-dev Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/backend/services/identity-resolution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ sea-orm = { workspace = true }
# UUIDs: person_id / tenant / source ids (binary(16) in the DB).
uuid = { workspace = true }

# ClickHouse: read the raw `identity_inputs` stream (persons-seed input source).
# `insight-clickhouse` wraps the client; the direct `clickhouse` dep is for the
# `Row` derive on the query row struct.
insight-clickhouse = { workspace = true }
clickhouse = { workspace = true }

# HTTP surface: tenant SecurityContext, RFC-9457 canonical errors, OpenAPI schemas.
toolkit-security = { workspace = true }
toolkit-canonical-errors = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ gears:
expand_subordinates: true
# Hard cap on org-tree recursion depth (cycle-safe).
max_depth: 16
# ClickHouse (persons-seed input: identity.identity_inputs). URL/creds are
# injected per-deployment via env overrides
# APP__gears__identity-resolution__config__clickhouse_*. Empty here so no
# endpoint/credential is committed.
clickhouse_url: ""
clickhouse_database: "identity"
clickhouse_user: ""
clickhouse_password: ""
3 changes: 3 additions & 0 deletions src/backend/services/identity-resolution/src/api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ pub struct ProfileError;

#[resource_error("gts.cf.insight.identity_resolution.person.v1~")]
pub struct PersonError;

#[resource_error("gts.cf.insight.identity_resolution.persons_seed.v1~")]
pub struct PersonsSeedError;
53 changes: 51 additions & 2 deletions src/backend/services/identity-resolution/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub(crate) mod canonical_json;
pub mod error;
mod handlers;
pub mod seed;

use std::sync::Arc;

Expand All @@ -11,6 +12,7 @@ use axum::Router;
use axum::http::StatusCode;
use axum::middleware::from_fn;
use sea_orm::DatabaseConnection;
use tokio::sync::mpsc;
use toolkit::api::{OpenApiRegistry, OperationBuilder};

use crate::auth;
Expand All @@ -22,8 +24,10 @@ use crate::domain::profile;
pub struct AppState {
/// MariaDB connection pool (SeaORM) — reads `persons` / `account_person_map`.
pub db: DatabaseConnection,
/// Gear config (e.g. `org_chart_source_type` for parent/supervisor lookup).
/// Gear config (`org_chart_source_type`, `clickhouse_*`, …).
pub config: GearConfig,
/// Sender to the persons-seed worker's job queue (POST enqueues here).
pub seed_tx: mpsc::Sender<seed::PersonsSeedJob>,
}

/// Mount the identity-resolution routes onto the host's router.
Expand Down Expand Up @@ -63,7 +67,7 @@ fn build_operations(router: Router, openapi: &dyn OpenApiRegistry) -> Router {

// Deprecated: successor is POST /v1/profiles. Kept for existing callers
// (authenticator, analytics) until they migrate; emits RFC 8594 headers.
OperationBuilder::get("/v1/persons/{email}")
let router = OperationBuilder::get("/v1/persons/{email}")
Comment thread
cyberantonz marked this conversation as resolved.
Resolved
.operation_id("identity_resolution.persons.get")
.summary("Resolve a person by email (deprecated; use POST /v1/profiles)")
.authenticated()
Expand All @@ -75,5 +79,50 @@ fn build_operations(router: Router, openapi: &dyn OpenApiRegistry) -> Router {
)
.standard_errors(openapi)
.handler(handlers::get_person_by_email)
.register(router, openapi);

// Persons-seed (async job): enqueue + poll. Admin-gated in .NET; not enforced
// here (auth-disabled host).
let router = OperationBuilder::post("/v1/persons-seed")
.operation_id("identity_resolution.persons_seed.create")
.summary("Enqueue a persons-seed run (async)")
.authenticated()
.no_license_required()
.json_request::<seed::PersonsSeedRequest>(openapi, "Seed options")
.json_response_with_schema::<seed::PersonsSeedOperationResponse>(
openapi,
StatusCode::ACCEPTED,
"Queued operation",
)
.standard_errors(openapi)
.handler(seed::create_persons_seed)
.register(router, openapi);

let router = OperationBuilder::get("/v1/persons-seed/{id}")
.operation_id("identity_resolution.persons_seed.get")
.summary("Get a persons-seed operation")
.authenticated()
.no_license_required()
.json_response_with_schema::<seed::PersonsSeedOperationResponse>(
openapi,
StatusCode::OK,
"Operation status",
)
.standard_errors(openapi)
.handler(seed::get_persons_seed)
.register(router, openapi);

OperationBuilder::get("/v1/persons-seed")
.operation_id("identity_resolution.persons_seed.list")
.summary("List persons-seed operations")
.authenticated()
.no_license_required()
.json_response_with_schema::<seed::PersonsSeedListResponse>(
openapi,
StatusCode::OK,
"Operations",
)
.standard_errors(openapi)
.handler(seed::list_persons_seed)
.register(router, openapi)
}
Loading
Loading