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

Adding Quotes to Sidebar #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

devinmatte
Copy link
Member

@devinmatte devinmatte commented Oct 28, 2017

Added Quotes to the Sidebar of members using the new Quotefault API!

This pull request includes a few changes:

  • Added quotes to the sidebar using quotefault api
  • Create a config.json to store things like the API key for quotefault
  • Update the package.json slightly to fit the current location of the repository
  • Allow for the top-row of popular to also collapse icons when checked off

Fixes #54

@@ -113,3 +113,6 @@ webnews/
webroster/
ybook2003/
yearbook/

# Ignore Config File from git
data/config.json
Copy link
Member

Choose a reason for hiding this comment

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

Could you have the file end with a newline? For reference on why this is important please visit: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

@@ -0,0 +1,3 @@
{
"quotefaultAPI": "keyherepls"
}
Copy link
Member

Choose a reason for hiding this comment

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

See above comment on ending files with newlines.

@@ -32,14 +42,26 @@ app.controller("MembersController", ['$scope', '$http', function($scope, $http)
console.error("Error getting meetings.json");
});

// Get the quotes
$scope.quote = [];
$http.get("./data/config.json").success(function (response) {
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this pose a security vulnerability where I could visit https://members.csh.rit.edu/data/config.json and then read out your API information and gain access to use that API as your user?

Copy link
Member

Choose a reason for hiding this comment

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

Thinking back I think this concern could be fairly dismissed since only people who would already have quotefault access would get to this point. The only route that would really lead to any questionable activity would be adding quotes, but if that ends up being a concern a good solution may be to add read-only keys to QuotefaultAPI (although I don't think we'll get to that point).

Copy link
Member Author

Choose a reason for hiding this comment

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

I can likely add readonly keys, but yeah in the meantime I'm not really worried about people accessing the key. Also couldn't we do something with permissions around the file to protect it? I don't really know what other way to store the key that makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

Since you'd be trying to access the file from client-side JS you'd need to make the file readable over HTTP to authenticated clients. I think that designing a way for that file to be secure would require more effort than would be worth it for protecting a database of quotes.

If you end up adding readonly keys I think that would be the simplest way to get a secure solution (from the perspective of someone with organization-level access accessing the API and mutating data through a key that 'anonymizes' them).

I'm fine with this change if @mbillow and @stevenmirabito also agree that this concern isn't high enough priority to block adding in this feature.

</div>
</div>
</div>

Copy link
Member

Choose a reason for hiding this comment

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

Could you not have this file end with a double-newline?

Copy link
Member

@liam-middlebrook liam-middlebrook left a comment

Choose a reason for hiding this comment

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

I totally messed up and didn't use the review feature to properly batch my comments together, sorry about that. Could you fix the changes / address the concerns I pointed out above?

@mbillow
Copy link
Member

mbillow commented Mar 5, 2018

@stevenmirabito and I talked about this and the best way to do it is to grab the access_token from https://members.csh.rit.edu/sso/redirect?info=json and then use that as a bearer token to authenticate directly to the Quotefault API without an API key. You will need to validate these JWTs in the Quotefault API.

@liam-middlebrook
Copy link
Member

@mbillow sounds good. I'll dismiss my pending review for that then and defer to you and @stevenmirabito.

@liam-middlebrook liam-middlebrook dismissed their stale review March 6, 2018 07:49

Deferring to @mbillow and @stevenmirabito for additional review for JWT integration with Keycloak for security purposes.

@multiojuice
Copy link
Member

@devinmatte with the new quotefault API, this will probably have to be refactored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants