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

To use the Oauth1 session, Is the logic correct? #225

Closed
fmarcolino opened this issue Dec 29, 2017 · 0 comments
Closed

To use the Oauth1 session, Is the logic correct? #225

fmarcolino opened this issue Dec 29, 2017 · 0 comments

Comments

@fmarcolino
Copy link
Contributor

fmarcolino commented Dec 29, 2017

if api_key or token:

self.oauth = OAuth1(client_key=api_key, client_secret=api_secret,

resource_owner_key=token, resource_owner_secret=token_secret)


self.oauth = None


Try use in the Python Shell the bellow command:

\>>> bool("string" or None)
True
... where "string" -> api_key and None -> token = None (for default).
So, for use the Oauth session, we need both the variables (api_key and token != None), or no?
If we use the logic operation OR, one variable different of None alread is valid (if api_key != None and token = None) -> True in this condition, which causes the execution of the first block wrongly.

Now, users can use only api_key and secret_key, which causes o `self.oauth = None'.
So, in my opinion, the operation logic should be AND.

I am using the logic operation AND, and the code is running perfectly well.

Good Night! Thanks for you approve my pull request!

@fmarcolino fmarcolino changed the title To use the Oauth1 session, the logic is correct? To use the Oauth1 session, Is the logic correct? Dec 29, 2017
rbeuque74 added a commit to rbeuque74/py-trello that referenced this issue Dec 31, 2017
Fixes sarumont#225
When TrelloClient initalise itself, it should look if token and
token_secret are provided to enable OAuth, otherwise, fallback to 3rd
authentication

Signed-off-by: Romain Beuque <[email protected]>
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

No branches or pull requests

1 participant