nais / nais/api

postgres: broker personal PostgresAccess through nais API

Open
#525 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3
Forks
2
Avg merge
1d 9h
Merged PRs (30d)
17

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the parent contract in nais/pgrator#145 and the PostgresAccess implementation in nais/pgrator#144; no API files or tests are named. Map the request and result contract to each acceptance criterion, including authorization, brokered lifecycle, readiness-gated connection material, audit correlation, and negative cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
backend-api-design, databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.