Skip to content

Secret key #264

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

Merged
merged 66 commits into from
Aug 12, 2015
Merged

Secret key #264

merged 66 commits into from
Aug 12, 2015

Conversation

aneda
Copy link
Contributor

@aneda aneda commented Jul 21, 2015

@theengineear @chriddyp @cldougl
Hey, this is a rough draft for secret_key. This only works for plot (py.plot(...)). I haven't done any tests and I am working on iplot (being stuck there). So I wanted to check if I am on the right track and this is what you had in mind. Thnaks!

@@ -1246,9 +1274,13 @@ def _send_to_plotly(figure, **plot_options):
url = get_config()['plotly_domain'] + "/clientresp"

r = requests.post(url, data=payload,
verify=get_config()['plotly_ssl_verification'])
verify=get_config()['plotly_ssl_verification'],)
Copy link
Contributor

Choose a reason for hiding this comment

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

did you mean to add this?

@theengineear
Copy link
Contributor

The general setup for this looks good to me. Sort of a bummer to have an extra request but it's the safest for all users (enterprise included) Every time we make a change to in streambed, we need to consider when certain users will actually receive that update.

When we start wrapping the other new endpoints I'd really like to move to a more RESTful design which will make this a bit smoother.

Ping me when you want a final review of it : D

both plot/ iplot can activate share_key
@aneda
Copy link
Contributor Author

aneda commented Jul 25, 2015

@theengineear @chriddyp I've added the share_key for iplot but I wasn't able to fix the error. The error happens on test_grid.py (test_plot_from_grid). I think the issue is due of this part :

https://github.com/plotly/python-api/blob/master/plotly/plotly/plotly.py#L829-L831

I am not too happy about _plot_option_logic but wasn't able to come up with another way...
Can I add @skip?

warnings.warn(
"Looks like you've activated the share_key for a public plot. "
"share_key can only be activaited for private plots."
"\nQuestions? support@plot.ly")
Copy link
Contributor

Choose a reason for hiding this comment

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

🐄 This isn't your fault, but should really be changed. support@plot.ly is intended for enterprise-related emails, not for the general public consumers. We should really be pointing users to feedback@plot.ly. We do this in a number of places.

@chriddyp actually, we could be a bit sneaky and return different supporty emails based on whether the plotly_domain matches the default plotly_domain in the session config? too sneaky? worthwhile?

@aneda
Copy link
Contributor Author

aneda commented Jul 28, 2015

@theengineear Hey thanks for your help and reviews! I wanted to keep you in the loop, last night @chriddyp had the idea to create a new key , sharing, that can be either {'public', 'private', 'secret'}, instead ofshare_key. I am working to addsharing` now. Let us know if you think that not a good route

@theengineear
Copy link
Contributor

would the new key be a python library thing or something that's going to be added to the backend api?

@aneda
Copy link
Contributor Author

aneda commented Jul 28, 2015

python library

@theengineear
Copy link
Contributor

do you mean share_key_enabled when you say share_key? in #264 (comment)

@theengineear
Copy link
Contributor

yeah, that seems like a pretty user-friendly way to do it. one concern is keeping backwards compat with the world_readable = False default. Does this mean we're deprecating this setting?

@aneda
Copy link
Contributor Author

aneda commented Jul 28, 2015

yes, my bad I meant share_key_enabled. We keep world_readable and just check if there is any conflict between the two (world_readable' andsharing`)

@aneda
Copy link
Contributor Author

aneda commented Jul 28, 2015

@theengineear @chriddyp @cldougl
I have removed share_key_enabled and added sharing to plot_options. sharing is a dict {'public', 'private', 'secret'}. I am writing the tests now but it failed test_grid

@theengineear
Copy link
Contributor

sweet, sounds good then!

@theengineear
Copy link
Contributor

re: #264 (comment)

try merging in master (you'll need to fix some conflicts) and then pushing back up. I think that will be resolved.

@chriddyp
Copy link
Member

looks great to me!

  • double check the CHANGELOG that I added
  • bump the version number
    then 💃

@chriddyp
Copy link
Member

(and after this gets merged, lets update the appropriate documentation: the getting started and the privacy section)

@theengineear
Copy link
Contributor

Re: #264 (comment) , @aneda can you either open a PR for this or open an issue in the 1.7 milestone so we don't forget?

@theengineear
Copy link
Contributor

@chriddyp 's comment here still needs addressing:

https://github.com/plotly/python-api/pull/264/files#r36436323

if (key == 'sharing' and not (kwargs[key] in SHARING_OPTIONS)):
raise exceptions.PlotlyError("'{0}' must be of either '{1}', '{2}'"
" or '{3}'"
.format(key, *SHARING_OPTIONS))
Copy link
Contributor

Choose a reason for hiding this comment

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

so DRY! 😸

@theengineear
Copy link
Contributor

non-blocking from me, i think there's a comment from chris that still needs to be checked and some general code style things that could be improved.

Feel free to 💃 after you've taken care of #264 (comment) and https://github.com/plotly/python-api/pull/264/files#r36436323

aneda pushed a commit that referenced this pull request Aug 12, 2015
@aneda aneda merged commit d9d83b2 into master Aug 12, 2015
@theengineear theengineear deleted the secret_key branch September 30, 2015 06:12
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.

4 participants