Skip to content

postgres: broker personal PostgresAccess through nais API #525

Closed as not planned

Description

@jhrv

Goal

Expose an authorized, API-brokered request for time-limited personal Postgres access.

Parent contract: nais/pgrator#145. The API owns authentication, authorization,
audit correlation and creation/replacement/deletion of PostgresAccess; pgrator
owns its reconciliation. The caller must never create or select a Tunnel,
DatabaseRole, target address, port, Kubernetes Secret, or Kubernetes credential.

Acceptance criteria

  • Define the API request/result contract using logical Postgres, selected ready
    PostgresInstance, access level, and the CLI WireGuard public key.
  • Authenticate the user and authorize team, environment, logical Postgres,
    physical instance and requested access level before creating PostgresAccess.
  • Create, observe, replace and delete PostgresAccess through the API's
    Kubernetes broker identity; callers receive no Kubernetes credentials.
  • Return connection material only after PostgresAccess is Ready, without
    exposing implementation target details or arbitrary Secrets.
  • Correlate audit events across API request, PostgresAccess, durable database
    identity and Tunnel lifecycle.
  • Cover unauthorized and caller-supplied-target negative cases.

Dependencies

PostgresAccess implementation in nais/pgrator#144 must merge before an end-to-end
flow can be enabled. Tunnel transport qualification remains a production gate,
not a blocker for this API contract work.

Activity

  1. reopened this on Sep 17, 2026
  2. jhrv commented on Sep 17, 2026

    @jhrv
    ContributorAuthor

    Work restarted on a clean pgaccess branch from origin/main. The first delivery is the API-brokered, no-port-forward creation contract; replacement and Ready/credential response semantics are being traced against existing API patterns before implementation.

  3. jhrv commented on Oct 6, 2026

    @jhrv
    ContributorAuthor

    Lukker den opprinnelige Tunnel/WireGuard-kontrakten som erstattet, ikke som levert etter disse akseptansekriteriene. Personlig tilgang leveres nå via RelayAccess/HTTP3 og er kvalifisert ende til ende i nav-dev (#526, #535, #537–#539, nais/pgrator#155 og nais/cli#785–#789). Gjenstående produksjonskvalifisering, endpoint-tillitsgrense og normal Postgres-apply følges som egne kort i Nais Postgres – v1-tavla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions