Skip to content

Conversation

@josenavas
Copy link
Contributor

This modifies the plugins so they work with OAuth2.

This includes the commits from @squirrelo in #1562

@antgonza antgonza mentioned this pull request Dec 21, 2015
@antgonza
Copy link
Member

Just to double check, the plan is to close #1562 and fully review this one, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm missing something here...

Should this be a public key, not a private key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, the server needs the private key to run.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will the server key be automatically regenerated? Otherwise, distributing a
private key is usually not a good idea
On Dec 22, 2015 09:13, "Jose Navas" notifications@github.com wrote:

In qiita_core/support_files/server.key
#1584 (comment):

@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----

Nope, the server needs the private key to run.


Reply to this email directly or view it on GitHub
https://github.com/biocore/qiita/pull/1584/files#r48275147.

@josenavas josenavas mentioned this pull request Dec 23, 2015
@antgonza
Copy link
Member

@josenavas could you update your branch? Note that I merged #1562 with the idea that all test should pass on this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Over-indent!

Copy link
Contributor

Choose a reason for hiding this comment

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

@mortonjt this still needs a pull and update before review.

@josenavas
Copy link
Contributor Author

Done

@antgonza
Copy link
Member

antgonza commented Jan 3, 2016

Now this has conflicts ... could you fix? Thanks.

@josenavas
Copy link
Contributor Author

Done

@antgonza
Copy link
Member

antgonza commented Jan 3, 2016

👍 when tests pass.

@antgonza
Copy link
Member

antgonza commented Jan 3, 2016

Note that this PR is going to have failures, @josenavas can you fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is duplicated from setUp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't remove this one - tests fail. The other 2, however, have been removed.

@josenavas
Copy link
Contributor Author

Tests should be passing right now.

@antgonza
Copy link
Member

antgonza commented Jan 7, 2016

Thanks, one more question, should the values of the keys be shown in the qiita-test-install output?

@josenavas
Copy link
Contributor Author

That's probably a good point. However, how is that going to scale? Meaning, as the number of plugins increase, how ugly is going to be showing that list?

Do you think that adding to qiita-test-install output is the best one, or should we add a flag, --show-plugin-info that show such information? If so, we can potentially remove the print statements from the patch and just point to the script.

What do you think?

@antgonza
Copy link
Member

antgonza commented Jan 7, 2016

I thought the plan was to have a certificate per system not per plugin, is that inaccurate?

@josenavas
Copy link
Contributor Author

The certificate is for the system but each plugin has its own client id and client secret.

@antgonza
Copy link
Member

antgonza commented Jan 7, 2016

IMOO is fine to display all the plugins ids/secrets in the qiita-test-install by default but fine if you want to add a flag for this.

@josenavas
Copy link
Contributor Author

Ok, thanks! Will try to update later today - busy with classes right now...

@squirrelo
Copy link
Contributor

That seems like a bad security issue if we are going to have people post their qiita-test-install outputs anywhere for debugging, like we do with print_qiime_config, as it will expose all the system's client username and passwords. Flag would be safer, but this issue may still happen if someone accidentally posts their output with the flag on.

@antgonza
Copy link
Member

antgonza commented Jan 8, 2016

IMOO this is fine and why we have an email for help and not a forum. At least for the moment.

@josenavas
Copy link
Contributor Author

Ok, I just realized that to do this correctly I need to do some modifications on the DB. The issue is that the system does not know which client_id belongs to each plugin and although @squirrelo suggested that is not needed for the oauth2 workflow, it is actually needed for the system to keep track of ownerships.

I have to work in something else right now, but I will update the PR soon.

@josenavas
Copy link
Contributor Author

PR updated

Copy link
Member

Choose a reason for hiding this comment

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

This has an extra h

@antgonza
Copy link
Member

antgonza commented Jan 8, 2016

Thanks. One minor comment and then 👍

@josenavas
Copy link
Contributor Author

Comments addressed

@squirrelo
Copy link
Contributor

What do you mean ownerships? By oauth2 standards, there are no specific ownerships for keys. All you transmit is the client id and client secret, and no other information. If you want to transmit the plugin id or other information as well, that is no longer following oauth2 specification, and we need to discuss this.

@josenavas
Copy link
Contributor Author

I'm not transmitting this information anywhere - is a information that the system needs to know to inform the user which client id and client secret needs to provide to the plugin config file - does it make sense?

@squirrelo
Copy link
Contributor

Not really. There's no reason we couldn't use a single client id/secret per system for app plugins if we wanted to, and this may actually make sense for single-computer systems like laptop deploys, since it means the user only needs one client login instead of many. The multi-client login does makes sense for larger or distributed setups, however.
I do not think we need to tie specific logins to specific plugins when displaying, since it creates a tie in the display that does not actually exist in the system. The system does not actually connect a login to a plugin in at all, as you could just as easily use the client id/secret for plugin A on plugin B and still have it work fine. The display should reflect that.

@josenavas
Copy link
Contributor Author

Ok this is getting annoying - in one of my previous comments I stated that each plugin has its own cliend_id/client_secret pair. If you didn't agree with that, you should raise up your concern then, instead of wasting my time. I'm not going to continue working on this until we reach a consensus.

@antgonza
Copy link
Member

antgonza commented Jan 9, 2016

There is nothing in the code that limits the use of the same id/secret if the user chooses to, right? In that case, we are covering both scenarios, right?

@josenavas
Copy link
Contributor Author

Yes - right now we are covering both scenarios.

@josenavas
Copy link
Contributor Author

I'm unsure why the tests are failing here - my guess is that it has to do with the Oauth2 authorization. I've done a small change to see if tests pass now as I can't reproduce in my machine.

@josenavas
Copy link
Contributor Author

Ok, it looks like it was a timing issue

@josenavas
Copy link
Contributor Author

@squirrelo ping

squirrelo added a commit that referenced this pull request Jan 11, 2016
@squirrelo squirrelo merged commit 0909755 into qiita-spots:artifact Jan 11, 2016
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.

5 participants