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

Extends the Google Drive support in 2.0.0 by supporting the Google Picker API (also introduces Rails 5.1.z support) #331

Conversation

jrgriffiniii
Copy link
Collaborator

@jrgriffiniii jrgriffiniii commented Feb 28, 2020

This brings in updates which I've introduced in order to support the usage of a Google Picker API within the React user interface (please see the ongoing work on samvera-deprecated/browse-everything-redux-react@master...jrgriffiniii:issues-319-jrgriffiniii-google-filepicker). This was also developed against an existing Rails 5.1.z app. which is required to use the 0.1 release of activestorage.

The Google Picker API is a client-side JavaScript solution for selecting Google Drive items (please see https://developers.google.com/picker/). The interaction with the Rails API for 2.0.0 was most consistent, but there were some adjustments needed for supporting a slightly different approach for OAuth2 authorization.

Advances #319

@@ -2,6 +2,10 @@

module BrowseEverything
class AuthorizationsController < ActionController::Base
include BrowseEverything::Controller::JsonApiRequestable

skip_before_action :verify_authenticity_token if respond_to?(:verify_authenticity_token)
Copy link
Collaborator Author

@jrgriffiniii jrgriffiniii Feb 28, 2020

Choose a reason for hiding this comment

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

These respond_to?(:verify_authenticity_token) statements were needed in order to support Rails 5.1.z releases.

@serializer = AuthorizationSerializer.new(@authorization)
serialized_json = @serializer.serialized_json
serialized = JSON.parse(serialized_json)
# I do not know why this is happening
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems to be an issue with the fast_jsonapi serialization for Authorizations

@jrgriffiniii jrgriffiniii force-pushed the issues-319-jrgriffiniii-google-picker branch from 5e01b5c to 1587331 Compare February 28, 2020 14:12
Controllers which do not implement #verify_authenticity_token;
Implementing support for HMAC using SHA-256 for JSON Web Tokens;
Providing support for activestorage release 0.1 (for Rails 5.1.z
releases); Extending Uploads and UploadFiles to store information
regarding Bytestream and Container structure; Implementing partials for
the React user interface and a Bootstrap 3 modal containing the React
UI; Adjusting the Google Drive support for cases where the OAuth2 token
is passed only from a client (as is the case with the Picker API
JavaScript client)
@jrgriffiniii jrgriffiniii force-pushed the issues-319-jrgriffiniii-google-picker branch from 1587331 to 235a0f0 Compare March 9, 2020 19:33
@jrgriffiniii jrgriffiniii force-pushed the issues-319-jrgriffiniii-google-picker branch from 2a35ad4 to 9db03d7 Compare March 9, 2020 20:06
@jrgriffiniii
Copy link
Collaborator Author

I've tested this throughout the past two weeks against a custom Samvera repository for integrating Google Drive uploads. In order to advance a 2.0.0.pre.alpha1 pre-release, I'm going to merge this.

@jrgriffiniii jrgriffiniii marked this pull request as ready for review March 12, 2020 14:29
@jrgriffiniii jrgriffiniii merged commit 36d42e4 into samvera:2.x-stable Mar 12, 2020
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.

1 participant