Overview
Thehoop 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:- 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. - 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.
- Authenticate the CLI as an admin user (
hoop login).
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 aHas Admin Credentials: yes/no indicator.
-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:Policy-only update
Omit--credentials-file and the stored credentials are kept as-is:
token_ttl_seconds without touching the SA key.
Flags
hoop admin federation delete
Removes the federation row from the connection. Subsequent sessions revert to standard credential handling — i.e. whateverenvvar: / filesystem: secrets the connection has are used as-is.
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.
How it composes the request
- Policy.
--fileoverrides the persisted policy; without it the saved config is loaded. Server-only fields (id,connection_id,has_admin_credentials, timestamps) are stripped before sending. - 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. - Connection envelope. The CLI fetches
agent_id,command,subtype, andenvvar:-typed secrets fromGET /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 aBareExecprobe 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 defaultSELECT 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
./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
- IAM Federation for GCP — the cloud-side
gcloudsetup that must precedefederation set. - Connect to BigQuery — creating the BigQuery connection that federation attaches to.
hoopCLI overview — the wider command set.