Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
Snowflake.

* Push-button publishing from desktop RStudio is now compatible with Connect
servers hosted on Snowflake.
servers hosted on Snowflake. This includes support for browser-based
authentication during deployment. (#1289)

* Added support for using identity federation to authenticate against Connect
when running in Posit Workbench, when available. This allows deploying to
Expand Down
7 changes: 7 additions & 0 deletions R/client-connect.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ getSnowflakeAuthToken <- function(url, snowflakeConnectionName) {
parsedURL <- parseHttpUrl(url)
ingressURL <- parsedURL$host

# Detect when we're running in the Deploy pane of RStudio and enable
# "interactive" temporarily so that external browser authentication is
# permitted.
if (rstudioapi::isBackgroundJob()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a mix of calls to base::interactive() and rlang::is_interactive(). Should they all shift to rlang::is_interactive()? Alternatively, should we have our own internal is_interactive() implementation which consults rstudioapi::isBackgroundJob()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like this targeted fix is what I'm after for now. Changing how we think about interactive() everywhere might have other side effects.

rlang::local_options(rlang_interactive = TRUE)
}

token <- snowflakeauth::snowflake_credentials(
snowflakeauth::snowflake_connection(snowflakeConnectionName),
spcs_endpoint = ingressURL
Expand Down
Loading