Skip to content

Comments

refactor(auth): return EnvCredentials by value in VerifyEnvCredentials#374

Open
ahjota wants to merge 1 commit intodatarobot-oss:mainfrom
ahjota:aj/auth-verify-return-by-value
Open

refactor(auth): return EnvCredentials by value in VerifyEnvCredentials#374
ahjota wants to merge 1 commit intodatarobot-oss:mainfrom
ahjota:aj/auth-verify-return-by-value

Conversation

@ahjota
Copy link
Contributor

@ahjota ahjota commented Feb 15, 2026

RATIONALE

Was reviewing the code in #354 again and saw a couple of things to fix.

CHANGES

  • VerifyEnvCredentials() does not need to return EnvCredentials struct as a pointer. Let's just return it by value.
  • Update auth dev docs a bit.

This makes the return type consistent with GetEnvCredentials, which already returns by value. EnvCredentials is a small struct (two strings) anyway.

PR Automation

Comment-Commands: Trigger CI by commenting on the PR:

  • /trigger-smoke-test or /trigger-test-smoke - Run smoke tests
  • /trigger-install-test or /trigger-test-install - Run installation tests

Labels: Apply labels to trigger workflows:

  • run-smoke-tests or go - Run smoke tests on demand (only works for non-forked PRs)

Important

For Forked PRs: If you're an external contributor, the run-smoke-tests label won't work. Only maintainers can trigger smoke tests on forked PRs by applying the approved-for-smoke-tests label after security review. Please comment requesting maintainer review if you need smoke tests to run.

- Change VerifyEnvCredentials() signature from (*EnvCredentials, error) to (EnvCredentials, error)
- Update test assertions to check struct fields directly instead of pointer non-nil
- Document GetEnvCredentials and VerifyEnvCredentials in authentication.md

This makes the return type consistent with GetEnvCredentials, which already returns by value. Since EnvCredentials is a small struct (two strings), returning by value is more idiomatic.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant