fix: make machine account credentials files portable across environments#145
Merged
fix: make machine account credentials files portable across environments#145
Conversation
Drop api_endpoint, token_uri, scope, and project_id from the required set in machine account credentials files. Discover the token endpoint from the OIDC provider's well-known config using --hostname, matching the interactive login flow. Credentials files are now portable across environments. Fixes #144 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Address review feedback: - Join missing-fields error with commas instead of Go's default slice formatting - Add a hint to the OIDC discovery error pointing at --hostname - Clarify the default scope comment about backward compatibility - Add a login example showing --credentials with --hostname Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kevwilliams
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Machine account credentials files no longer need to carry environment-specific configuration.
datumctlnow discovers the auth endpoint from--hostname— the same way interactive login already works — so the same credentials file can be used against dev, staging, and production by simply pointingdatumctlat a different hostname.What changed for users
Before this fix, a credentials file had to contain
api_endpoint,token_uri,scope, andproject_idor login would fail with:After this fix, a minimal credentials file only needs:
type(must bedatum_machine_account)client_idprivate_key_idprivate_keyclient_emailis optional and only used for display. Older credentials files that still include the extra fields continue to work unchanged.One thing to know when migrating
If you were previously logging in against a non-default environment using just
--credentials old-file.json(and relying on the file'stoken_urito pick the environment), you will now need to pass--hostnameexplicitly:The login examples in
datumctl auth login --helphave been updated to show this.Fixes #144
Test plan
type,client_id,private_key_id,private_key) against the default hostname--hostnamepointing at a non-default environment🤖 Generated with Claude Code