Skip to content

dogshell doesn't accept app key with "ddapp_" prefix #930

@dancavallaro

Description

@dancavallaro

Describe the bug
My application keys are generated with a ddapp_ prefix, but dogshell refuses to accept it because of this appnum.isalnum() check: https://github.com/DataDog/datadogpy/blob/master/datadog/dogshell/common.py#L97-L99.

Here's what happens when I run dog for the first time:

/Users/dan/.dogrc does not exist. Would you like to create it? [Y/n] y
What is your api key? (Get it here: https://app.datadoghq.com/account/settings#api) <REDACTED>
What is your app key? (Get it here: https://app.datadoghq.com/account/settings#api) ddapp_<REDACTED>
Datadog app keys can only contain alphanumeric characters.
What is your app key? (Get it here: https://app.datadoghq.com/account/settings#api)

Initially I tried removing the prefix which allowed dogshell to accept it, but of course that wound up resulting in ERROR: Unauthorized because it's not actually a valid app key.

I've confirmed that manually editing .dogrc to add the prefix allows dogshell to work successfully.

Label the issue properly.

  • Add severity/ label.
  • Add documentation label if this issue is related to documentation changes.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://us3.datadoghq.com/organization-settings/application-keys
  2. Click on "New Key", give it a name, create key.
  3. Delete ~/.dogrc if one exists
  4. Run dog and follow the prompts to provide API and app keys.

Expected behavior
Expected dogshell to accept my app key exactly as generated in the Console.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment and Versions (please complete the following information):
A clear and precise description of your setup:

  • version for this project in use.
  • services, libraries, languages and tools list and versions.

Additional context
I installed dogshell yesterday via pip3 install datadog, here's the version:

$ dog --version
dog 0.52.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions