Skip to content

Make acceptance tests runnable with key-pair auth only#173

Closed
bbhorrigan wants to merge 2 commits intohashicorp:mainfrom
bbhorrigan:main
Closed

Make acceptance tests runnable with key-pair auth only#173
bbhorrigan wants to merge 2 commits intohashicorp:mainfrom
bbhorrigan:main

Conversation

@bbhorrigan
Copy link

Summary

Snowflake is deprecating password authentication (see #172), but the acceptance test suite hard-requires SNOWFLAKE_PASSWORD via dsnString(), making the entire suite impossible to run with only key-pair credentials. This PR makes password-dependent tests optional so the suite runs with key-pair auth alone.

  • Password-dependent tests skip when SNOWFLAKE_PASSWORD is unset
  • Key-pair subtests in TestSnowflake_NewUser now use key-pair admin connections for initialization and cleanup
  • New TestSnowflake_RenewUser_KeyPair and TestSnowflake_RevokeUser_KeyPair tests cover critical flows without password auth
  • Fixes a bug in getKeyPairAuthParameters that used user instead of account in the connection URL (introduced in Add support for keypair root configuration #109), causing key-pair SQL operations to hit the wrong host
  • Fixes verifyConnWithKeyPairCredential which used ParseDSN that rejects empty passwords even for JWT auth, making key-pair verification impossible

Test plan

  • go vet ./... and go build ./... pass
  • Unit tests pass: go test -v -run 'TestGetSnowflakeConfig|TestGetPrivateKey|TestConnectionProducer' ./...
  • Full acceptance suite verified against a live Snowflake account with only key-pair env vars — password tests skip cleanly, all key-pair tests pass

Closes #172

@bbhorrigan bbhorrigan requested a review from a team as a code owner February 21, 2026 04:33
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Feb 21, 2026

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@bbhorrigan
Copy link
Author

Hey, I also work at Snowflake and emailed John-Michael last week about this change. I tested this quite a bit and went through acceptance testing as requested, and found a couple of small bugs along the way.

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.

Acceptance tests still require SNOWFLAKE_PASSWORD

1 participant