feat: SPCS authentication includes API key#1248
Merged
aronatkins merged 4 commits intomainfrom Oct 28, 2025
Merged
Conversation
SPCS (Snowpark Container Services) deployments require a dual authentication model: - Snowflake tokens provide proxied authentication to reach the server - API keys identify the user to the Connect server itself Changes: - Updated authHeaders() to include X-RSC-Authorization header when both snowflakeToken and apiKey are present - Added apiKey parameter to connectSPCSUser() function - Updated getSPCSAuthedUser() to accept and use apiKey - Store apiKey in account registration alongside snowflakeConnectionName - Updated function documentation to explain the dual authentication model - Added comprehensive test coverage for API key handling This aligns with updated Connect server requirements for Snowflake SPCS deployments and mirrors the authentication pattern in rsconnect-python. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Document the addition of API key support for SPCS authentication, including the breaking change to connectSPCSUser() which now requires an apiKey parameter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5a48fe0 to
de7e0b5
Compare
costrouc
approved these changes
Oct 28, 2025
Member
There was a problem hiding this comment.
Successfully tested publishing externally into Snowflake
> remotes::install_github("rstudio/rsconnect@aron-snowflake-double-auth")
> rsconnect::addServer(
+ "https://..........snowflakecomputing.app/",
+ name = "connect-snowflake",
+ snowflakeConnectionName = "......."
+ )
! Both connections.toml and config.toml exist. Using connections.toml.
Server 'connect-snowflake' added successfully: https://..........snowflakecomputing.app/__api__
> rsconnect::connectSPCSUser(
+ server = "connect-snowflake",
+ apiKey = "TrV.......fkJ",
+ snowflakeConnectionName = "...."
+ )
! Both connections.toml and config.toml exist. Using connections.toml.
✔ Registered account for server: connect-snowflake / username: CHRIS.OSTROUCHOV@POSIT.CO
> rsconnect::deployApp("simple-quarto/hello.qmd", server = "connect-snowflake")
✔ Successfully deployed to <https://........snowflakecomputing.app/content/47a8dea5-......-36bccc0ce86e/>
Contributor
Author
|
@edavidaja - added you as a reviewer just so you're aware of these changes. |
7 tasks
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.
Replaces #1244; it contains additional details.
Given these changes, deployment to a "new" Connect Snowflake deployment succeeds.