Skip to main content

Overview

The hoop admin federation command group lets you wire short-lived, per-user cloud credentials onto an existing Hoop connection. Each subcommand targets a single connection identified by name or UUID and requires the Admin role.
Federation activates per connection: once you set a federation config on a connection, sessions on that connection resolve per-user credentials at open time. Connections without a federation config are unaffected.

Prerequisites

These commands operate on an existing connection. Before running any of them:
  1. Create the underlying connection — typically a BigQuery connection. See Connect to BigQuery for the connection setup itself. You can verify it’s reachable with hoop connect <name> before adding federation.
  2. Have the admin credentials file ready — for GCP, this is the JSON key for the admin service account. See IAM Federation for GCP for how to create and grant it.
  3. Authenticate the CLI as an admin user (hoop login).
Federation is layered onto a working connection — it never replaces the connection itself.

The federation policy file

set and (optionally) test take a YAML file describing the policy. The credentials live in a separate file passed via --credentials-file so the policy stays safe to commit to git.

hoop admin federation get

Prints the persisted policy for a connection. Credentials are never echoed back — only a Has Admin Credentials: yes/no indicator.
Add -o json to get the raw API response for scripting.

hoop admin federation set

Upserts the federation configuration for a connection. Re-runs preserve the stored credentials unless you pass --credentials-file again, which lets you safely tweak the policy without re-supplying the SA key every time.

First-time setup

Supply both the policy and the credentials:
After Hoop accepts the credentials, delete the local file — Hoop encrypts and stores it server-side; the on-disk copy is no longer needed.

Policy-only update

Omit --credentials-file and the stored credentials are kept as-is:
This is the everyday path — most edits change the identity template, fallback policy, or token_ttl_seconds without touching the SA key.

Flags

Pair --file federation.yaml with version control so policy changes flow through the same review process as code. Keep the credentials file out of git (.gitignore, secret manager, 1Password, etc.).

hoop admin federation delete

Removes the federation row from the connection. Subsequent sessions revert to standard credential handling — i.e. whatever envvar: / filesystem: secrets the connection has are used as-is.
This is destructive but reversible: re-run set to restore federation. The connection itself is untouched.

hoop admin federation test

Dry-runs federation end-to-end without persisting state. Resolves a candidate policy against a synthetic user and dispatches a one-shot probe (default: SELECT 1) to the agent the connection is bound to. Useful for:
  • Smoke-testing GCP grants before pasting the admin key into Hoop.
  • Validating a draft policy before promoting it with set.
  • CI gates that verify federation still resolves after IAM changes.
A green run prints:
The command exits 0 on success, 1 on any failure — wire it straight into a CI step.
A green test result proves Hoop can mint the token and the agent can reach the data plane. To confirm the query is attributed to the right user in GCP (the actual point of federation), follow up with Finding sessions in GCP audit logs. Remember that BigQuery Data Access logs are off by default — if you only see GenerateAccessToken entries, that’s why.

How it composes the request

  1. Policy. --file overrides the persisted policy; without it the saved config is loaded. Server-only fields (id, connection_id, has_admin_credentials, timestamps) are stripped before sending.
  2. Credentials. Always read fresh from --credentials-file. The gateway never echoes the stored ciphertext back, even for testing — so the credentials file is always required, even when reusing a persisted policy.
  3. Connection envelope. The CLI fetches agent_id, command, subtype, and envvar:-typed secrets from GET /connections/{name} and forwards them to the test endpoint. filesystem:-typed secrets are skipped (a stderr warning lists which ones) because the test endpoint runs a BareExec probe that doesn’t materialize per-session temp files. A real federated session strips these anyway when superseded, so the dry-run faithfully reflects production.

Flags

Choosing the probe

For BigQuery, the default SELECT 1 is enough to confirm both token issuance and BigQuery API reachability. For other targets, pass --test-script with a real read-only query against the target dataset to catch IAM mistakes that only surface on actual data access (e.g. missing roles/bigquery.dataViewer).

End-to-end example — wire BigQuery federation in 4 commands

After step 2 you can safely delete ./hoop-admin-sa.json from disk.

Exit codes

The test verb is the one most likely to be embedded in pipelines; its exit code reliably reflects probe success.

See also