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

On v3, please provide only secret_key OR public_key. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alanjds
Copy link

@alanjds alanjds commented Jun 11, 2014

Providing public_key AND secret_key leads to trouble.
See: https://groups.google.com/d/msg/disqus-dev/9HBAftO0jr0/gD_j-rWdSqsJ

Question: should we get rid of public_key mentions on the whole codebase?

@@ -162,8 +162,8 @@ class DisqusAPI(Resource):
def __init__(self, secret_key=None, public_key=None, format='json', version='3.0', **kwargs):
self.secret_key = secret_key
self.public_key = public_key
if not public_key:
warnings.warn('You should pass ``public_key`` in addition to your secret key.')
if secret_key and public_key:
Copy link

Choose a reason for hiding this comment

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

Well, this doesn't warn them if they omit both. Not sure if it is necessary, just pointing out.

Copy link
Author

Choose a reason for hiding this comment

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

You are right.

I cannot find out an entrypoint that does not require at least the public_key, but here is said that Disqus "recommend using SSL for all requests to the API, but it is not required for anonymous requests.".

Question is: what "anonymous requests" means? If nothing can be hit without public or secret key, is safe to raise an exception for this case.

If someone can confirm that, I will happily update the PR to raise an exception for no key provided, or at least put one more warning.

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.

2 participants