Service accounts and CI¶
A service account is a machine identity that belongs to a tenant. Use one for CI pipelines, the
command-line client, the Go SDK, Terraform, docker login
and calls to the AI endpoints.
Create¶
Service accounts → Create: a name and an expiry (at most one year). The token is shown once; store it in your secret manager. A lost or expired token is replaced with Rotate, which issues a new one and revokes the old.
What it may do¶
A new service account acts with editor rights, and never with more than the person who created it. For CI, limit it: under Access mark it restricted and grant only the permissions it needs, for the whole tenant or for some objects only.
Get an access token¶
The command-line client, the SDK, the Terraform provider and the GitHub Action below do this for you. By hand, exchange the account for a short-lived OAuth access token at the sign-in endpoint the API's configuration document names:
conf=$(curl -s https://gateway.cloud.rso.dev/.well-known/rso-configuration)
curl -s "$(echo "$conf" | jq -r .token_endpoint)" \
--data-urlencode grant_type=client_credentials \
--data-urlencode client_id="$(echo "$conf" | jq -r .client_id)" \
--data-urlencode username="$RSO_SERVICE_ACCOUNT_NAME" \
--data-urlencode password="$RSO_SERVICE_ACCOUNT_SECRET" \
--data-urlencode scope=profile | jq -r .access_token
Send it as Authorization: Bearer <token> with X-Tenant: <tenant-id>.
GitHub Actions¶
- uses: theorigamicorporation/auth@v1
with:
service_account_name: ${{ secrets.RSO_DEV_SERVICE_ACCOUNT_NAME }}
service_account_secret: ${{ secrets.RSO_DEV_SERVICE_ACCOUNT_SECRET }}
# later steps can read $RSO_DEV_ACCESS_TOKEN
Terraform¶
# A machine identity for CI. The token is only available at creation.
resource "rso_service_account" "ci" {
name = "tf-example-ci"
expires_at = "2027-06-30T00:00:00Z"
}
output "ci_token" {
value = rso_service_account.ci.token
sensitive = true
}