Skip to content

rsconnect list errors when no api-key included #283

@kgartland-rstudio

Description

@kgartland-rstudio

As of rsconnect-python 1.10.0, the api-key is no longer required when adding a new server. However after adding a server with a missing api-key we return an error when running rsconnect list:

> rsconnect list
Server information from /Users/kgartland/Library/Application Support/rsconnect-python/servers.json

Nickname: "fuzz"
    URL: http://18.232.160.200:3939/
    API key is saved
Traceback (most recent call last):
  File "/Users/kgartland/.pyenv/versions/3.8.2/lib/python3.8/site-packages/rsconnect/actions.py", line 80, in cli_feedback
    yield
  File "/Users/kgartland/.pyenv/versions/3.8.2/lib/python3.8/site-packages/rsconnect/main.py", line 389, in list_servers
    if server["insecure"]:
KeyError: 'insecure'

We also display "API key is saved" when there is no API Key.

The servers.json file contains:

{
    "fuzz": {
        "name": "fuzz",
        "url": "http://18.232.160.200:3939/",
        "account_name": null,
        "token": null,
        "secret": null
    }
}

After adding an api_key to the config, the servers.json file looks like this:

{
    "fuzz": {
        "name": "fuzz",
        "url": "http://18.232.160.200:3939/",
        "api_key": "[REDACTED]",
        "insecure": false,
        "ca_cert": null
    }
}

I think if there is no -k provided, we default to shinyapps.io credential structure.

Metadata

Metadata

Assignees

No one assigned

    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