app.routers.candidates

CI push intake: PUT and POST /api/v1/candidates.

Authenticated with a per-registration push token (Authorization: Bearer <token>), never with OIDC: see app.auth.push. All checks, error codes and the run log live in app.services.intake; this router only reads the body (with a size cap, before parsing, so authentication can come first) and maps the outcome to a status code:

  • PUT: 201 when the candidate was created, else 200 (replaced or unchanged); idempotent for identical content.

  • POST: 201, or 409 candidate_exists.

  • A repeated delivery_id: 200 with deduplicated: true.

The request body schema is CandidateSubmission, published in OpenAPI through openapi_extra.

async app.routers.candidates.put_candidate(request, response, credentials=Depends(dependency=<fastapi.security.http.HTTPBearer object>, use_cache=True, scope=None), provider=Depends(dependency=<function get_store_provider>, use_cache=True, scope=None), runtime=Depends(dependency=<function get_catalog_runtime>, use_cache=True, scope=None))

Create or replace the candidate for (source, project, ADR, ref).

Parameters:
  • request (Request) – The request.

  • response (Response) – The response.

  • credentials (HTTPAuthorizationCredentials | None) – Push-token bearer credentials.

  • provider (CatalogStoreProvider) – Storage provider (overridden by tests).

  • runtime (CatalogRuntime | None) – Startup configuration state.

Return type:

CandidateResultOut

Returns:

Record id, server digest, issues and catalog path.

async app.routers.candidates.post_candidate(request, response, credentials=Depends(dependency=<fastapi.security.http.HTTPBearer object>, use_cache=True, scope=None), provider=Depends(dependency=<function get_store_provider>, use_cache=True, scope=None), runtime=Depends(dependency=<function get_catalog_runtime>, use_cache=True, scope=None))

Create a candidate; 409 candidate_exists if it already exists.

Parameters:
  • request (Request) – The request.

  • response (Response) – The response.

  • credentials (HTTPAuthorizationCredentials | None) – Push-token bearer credentials.

  • provider (CatalogStoreProvider) – Storage provider (overridden by tests).

  • runtime (CatalogRuntime | None) – Startup configuration state.

Return type:

CandidateResultOut

Returns:

Record id, server digest, issues and catalog path.