flox_sat_.
Without one, a pipeline has to sign in as a person. Its access is that person’s
access, it stops working when they leave the organization, and revoking its
credential also cuts off that person’s own CLI sessions.
Service accounts require Flox CLI 1.14.0 or newer. Earlier releases do
not recognize the token format.They also require an organization. Personal FloxHub accounts cannot have
service accounts, so to authenticate the CLI as yourself, use a
personal access token instead.
Access levels
Every service account is created with one of two access levels, which apply across the whole organization:
The access level belongs to the service account rather than to any one of its
tokens, so every token issued to it has the same access, and that access cannot
be narrowed to a subset of environments or packages.
A service account is never an organization owner, so it cannot manage members,
change organization settings, or create more service accounts. Creating a
service account and issuing its tokens both require a signed-in owner, which
means a leaked token cannot be used to create more credentials.
Creating a service account
Service accounts are created in FloxHub, and only by organization owners.- Sign in to FloxHub
- Open your organization’s page
- Go to the Service accounts tab
- Select Create service
- Give it a name and choose its access level
release-runner or
nightly-tests. The name is how you recognize the account later and has no
effect on its access.
Issuing a token
A service account has no credential until you issue one. From the Service accounts tab:- Select Issue token on the service account
- Choose how long it should last: 30 days (the default), 90 days, 1 year, or No expiration
- Copy the token
Using a token in CI
Set the token in theFLOX_FLOXHUB_TOKEN environment variable, which the Flox
CLI reads without a separate login step. This example is a GitHub Actions
workflow that reads the token from a repository secret:
.github/workflows/ci.yml
flox auth login:
Revoking a token
When a token is no longer needed, revoke it from the Service accounts tab:- Find the token under the service account it belongs to
- Select the delete icon next to it
- Confirm
Rotating without downtime
A service account can have several live tokens at once, so you can replace one without leaving a gap:- Issue a second token for the service account
- Deploy it to your CI platform in place of the old one
- Watch the old token’s Last used date until it stops moving
- Revoke the old token