Skip to content

Conversation

ya7010
Copy link

@ya7010 ya7010 commented Mar 14, 2025

After updating from 3.7.0 to 4.0.1, authentication by keypath now gives an error.

This PR restores the implementation that recognizes SNOWFLAKE_PRIVATE_KEY_PATH, SNOWFLAKE_PRIVATE_KEY_PASSPHRASE.

The GitHub Action workflow we used is as follows:

jobs:
  schemachange:
      - ...
      - name: Execute Snowflake migration
        env:
          SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
          SNOWFLAKE_PRIVATE_KEY_PATH: ${{ secrets.SNOWFLAKE_PRIVATE_KEY_PATH }}
          SNOWFLAKE_PRIVATE_KEY_PASSPHRASE: ${{ secrets.SCHEMA_CHANGE_SNOWFLAKE_PRIVATE_KEY_PASSPHRASE }}
        run: |
          echo "${{ secrets.SCHEMA_CHANGE_SNOWFLAKE_PRIVATE_KEY }}" > ${{ env.SNOWFLAKE_PRIVATE_KEY_PATH }}
          schemachange -a $SNOWFLAKE_ACCOUNT
          rm -f ${{ env.SNOWFLAKE_PRIVATE_KEY_PATH }}

Since Snowflake is discontinuing single-factor password authentication, my team has moved to Key/Pair authentication.

), # TODO: Remove when connections.toml is enforced
"private_key_file_pwd": kwargs.get(
"private_key_file_pwd"
), # TODO: Remove when connections.toml is enforced
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement should not be removed even after connections.toml is enforced. Since, we will not want to write the private key passphrase into a file even then.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cd20507

Fixed to use private_key_path, and removed comments.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AttilaVM

My team is waiting for PASSPHRASE support to be released.

Is there anything else I can do?

Copy link

@mibelbahri mibelbahri Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ya7010 shouldn't we go all the way to just supporting SNOWFLAKE_PRIVATE_KEY as an env variable instead of SNOWFLAKE_PRIVATE_KEY_PATH (avoiding materializing the key all together)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mibelbahri
Are you referring to using SNOWFLAKE_PRIVATE_KEY instead of SNOWFLAKE_PRIVATE_KEY_PATH?

I think SNOWFLAKE_PRIVATE_KEY_PASSPHRASE should be retained.

@ya7010 ya7010 requested a review from AttilaVM May 1, 2025 08:32
@sfc-gh-tmathew sfc-gh-tmathew self-assigned this Aug 29, 2025
@sfc-gh-tmathew sfc-gh-tmathew added the bug Something isn't working label Aug 29, 2025
@ya7010
Copy link
Author

ya7010 commented Oct 10, 2025

@sfc-gh-tmathew

Is there anything I can do to help merge this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants