-
Notifications
You must be signed in to change notification settings - Fork 319
dogshell doesn't accept app key with "ddapp_" prefix #930
Description
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
documentationlabel if this issue is related to documentation changes.
To Reproduce
Steps to reproduce the behavior:
- Go to https://us3.datadoghq.com/organization-settings/application-keys
- Click on "New Key", give it a name, create key.
- Delete
~/.dogrcif one exists - Run
dogand 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