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

add support for saving credentials with your api key #270

Merged
merged 20 commits into from Sep 11, 2018
Merged

Conversation

davecap
Copy link
Member

@davecap davecap commented Jul 12, 2018

  • Add new docs about saving credentials

@davecap davecap requested a review from jsh2134 August 23, 2018 16:58
@jsh2134
Copy link
Contributor

jsh2134 commented Sep 5, 2018

not sure if this expected behavior but....CLI login works as we expect and creates the credentials file.

solvebio login --api-key=XXXX
You are logged-in to the "AAAA" domain as AAA.AAA@AAAA.com with role member.
You are now logged-in as  AAA.AAA@AAAA.com.

## Note: it does print twice ^^

But if I try to login from within the client it does not work

$ SOLVEBIO_API_KEY=invalid-key solvebio
SolveBio Python shell started.
Error: Invalid API key
Invalid credentials. You may not be logged-in.
No authentication credentials found.

# If I try and call login() it works as expected.

login()
Please enter your SolveBio credentials
Domain (e.g. <domain>.solvebio.com): q

# But if I try and pass an api_key it does not

login(api_key='VALID_KEY')

TypeError: login() got an unexpected keyword argument 'api_key'


In [3]: login
Out[3]: <function solvebio.cli.auth.login>

Also if I import solvebio and then login, it also does not create the credentials files

import solvebio
solvebio.login(api_key="REAL_KEY")
solvebio.User.retrieve()
# login works! but no credentials file created

@jsh2134
Copy link
Contributor

jsh2134 commented Sep 5, 2018

Also it prints a link to the security page to get your auth token, and says that there will be instructions there, but there are not

cc @davecap

@davecap
Copy link
Member Author

davecap commented Sep 5, 2018

Thanks! I'll look it over again.

.travis.yml Outdated
- pip install requests==2.10.0 flake8==2.6.2 nose mock tox
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install ordereddict unittest2;
fi
- pip install -r requirements.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename this requirements_dev.txt or something that denotes it is for dev/testing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

import pkgutil
import unittest

# FIXME: redo how testing works.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@davecap davecap closed this Sep 11, 2018
@davecap davecap reopened this Sep 11, 2018
@davecap
Copy link
Member Author

davecap commented Sep 11, 2018

(travis check didn't update on success, closing the PR and re-opening triggers a travis rebuild)

@davecap
Copy link
Member Author

davecap commented Sep 11, 2018

@davecap davecap merged commit 96b2792 into master Sep 11, 2018
@davecap davecap deleted the f-login-with-key branch September 11, 2018 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants