Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth status incorrectly claims a non-existent user is authenticated #53

Closed
peterjmorgan opened this issue Jun 21, 2021 · 0 comments · Fixed by #60
Closed

auth status incorrectly claims a non-existent user is authenticated #53

peterjmorgan opened this issue Jun 21, 2021 · 0 comments · Fixed by #60
Assignees
Labels
bug Something isn't working medium priority Should be handled as soon as possible

Comments

@peterjmorgan
Copy link
Contributor

Describe the bug
auth status sometimes will report that a user that has never been registered with phylum auth register is currently authenticated.

I'm setting as Medium Priority but Low might make sense.

To Reproduce
Steps to reproduce the behavior:

  1. Manually edit $HOME/.phylum/settings.yaml to have credentials to a new, un-registered user.
  2. Attempt to perform an action that requires authentication, such as analyze
  3. Note the 401 Unauthorized error
  4. Finally, execute phylum auth status
  5. Note that phylum believes the user to be currently authenticated

Expected behavior
The auth status command should send a small message to the API to confirm that the current user authentication status is
accurate. I suspect this will be useful for situations in CI/CD automation.

Screenshots

❯ phylum analyze package-LES-lock.json
---------------- Update Available ----------------

A new version of the Phylum CLI is available. Run

        phylum update

to update to the latest version!

--------------------------------------------------


[2021-06-18T18:35:41Z ERROR phylum_cli::restson] server returned "401 Unauthorized" error
[2021-06-18T18:35:41Z ERROR phylum] Error attempting to authenticate: HttpError(401, "{\"msg\":\"Invalid login credentials provided\"}\n")
❗ Error: Error attempting to authenticate

root in Customer-provided package files/abbott/LES on ☁  (us-west-2) 
❯ phylum auth
---------------- Update Available ----------------

A new version of the Phylum CLI is available. Run

        phylum update

to update to the latest version!

--------------------------------------------------


auth
Manage authentication, registration, and API keys

USAGE:
    auth [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    help        Prints this message or the help of the given subcommand(s)
    keys        Manage API keys
    login       Login to an existing account
    register    Register a new account
    status      Return the current authentication status


root in Customer-provided package files/abbott/LES on ☁  (us-west-2) 
❯ phylum auth status
---------------- Update Available ----------------

A new version of the Phylum CLI is available. Run

        phylum update

to update to the latest version!

--------------------------------------------------


✅ Currenty authenticated as pete2@phylum.io
@peterjmorgan peterjmorgan added bug Something isn't working medium priority Should be handled as soon as possible labels Jun 21, 2021
@eeclfrei eeclfrei self-assigned this Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium priority Should be handled as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants