Skip to content

stored deployment target takes precedence over command-line and environment variable #684

@aronatkins

Description

@aronatkins
rsconnect add -n localhost -s http://localhost:3939/ -k valid-api-key

Expected:

rsconnect content search -k invalid-api-key --title-contains "this returns nothing"
#> Error: Posit Connect reported an error (calling /__api__/v1/content): We couldn't log you in with the provided credentials. Please ask your administrator for assistance.
CONNECT_API_KEY=invalid-api-key rsconnect content search --title-contains "this returns nothing"
#> Error: Posit Connect reported an error (calling /__api__/v1/content): We couldn't log you in with the provided credentials. Please ask your administrator for assistance.

Actual:

rsconnect content search -k invalid-api-key --title-contains "this returns nothing"
#> []
CONNECT_API_KEY=invalid-api-key rsconnect content search --title-contains "this returns nothing"
#> []

The stored API key is being used even though the command-line / environment variable provides an overriding value.

# TODO: Is this logic backward? Seems like the provided value should override the stored value.
api_key = server_data.api_key or api_key
snowflake_connection_name = server_data.snowflake_connection_name or snowflake_connection_name
insecure = server_data.insecure or insecure
ca_data = server_data.ca_data or ca_data
account_name = server_data.account_name or account_name
token = server_data.token or token
secret = server_data.secret or secret

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions