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

fix: OAuth code returned via redirect_uri #719

Merged
merged 3 commits into from May 16, 2022

Conversation

eol-account
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

This fixes the OAuth authentication procedure used by the Spreadsheet Gateway.

  • What is the current behavior? (You can also link to an open issue here)

Currently the Spreadsheet Gateway relies on the user approving access to their Google Drive, then copying and pasting a code from a page displayed by Google into a form hosted in Sofie.

Since this was first implemented, Google has deprecated (and subsequently removed) support for this copy-paste method of entering access codes. Instead, it is required that Sofie provides a callback url which can be provided with the code as a URL parameter.

  • What is the new behavior (if this is a feature change)?

Two new URL handlers have been added:

  • /devices/:deviceId/oauthResponse
    • This handles the callback from the OAuth process and forwards the access code to the gateway
  • /devices/:deviceId/resetAuth
    • The settings form for the OAuth flow now provides a button for resetting / clearing the auth settings from a peripheral device, offering a way to "sign out" from the Drive integration
  • Other information:

There have also been a couple of QoL improvements made to the OAuth form, as well as removing references to "spreadsheet" to allow the form to be reused for other OAuth-based services.

Status

  • Code documentation for the relevant parts in the code have been added/updated by the PR author
  • The functionality has been tested by the PR author
  • The functionality has been tested by NRK

@Julusian Julusian added ✨ enhancement New feature or request Contribution from SuperFly.tv Contributions sponsored by SuperFly.tv labels May 6, 2022
meteor/server/api/peripheralDevice.ts Outdated Show resolved Hide resolved
meteor/server/api/peripheralDevice.ts Show resolved Hide resolved
meteor/server/api/peripheralDevice.ts Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2022

Codecov Report

Merging #719 (f5ecb90) into release43 (bbc0945) will increase coverage by 0.14%.
The diff coverage is 8.51%.

@@              Coverage Diff              @@
##           release43     #719      +/-   ##
=============================================
+ Coverage      69.70%   69.84%   +0.14%     
=============================================
  Files            307      276      -31     
  Lines          34796    34202     -594     
  Branches        4731     4639      -92     
=============================================
- Hits           24255    23889     -366     
+ Misses         10090     9874     -216     
+ Partials         451      439      -12     
Impacted Files Coverage Δ
meteor/server/api/peripheralDevice.ts 54.83% <8.51%> (-4.83%) ⬇️
meteor/server/migration/lib.ts 55.55% <0.00%> (-21.37%) ⬇️
meteor/server/migration/0_1_0.ts 88.88% <0.00%> (-3.80%) ⬇️
meteor/server/migration/databaseMigration.ts 59.89% <0.00%> (-0.28%) ⬇️
meteor/server/migration/1_18_0.ts 100.00% <0.00%> (ø)
meteor/server/migration/1_19_0.ts 100.00% <0.00%> (ø)
meteor/server/migration/1_37_0.ts 51.21% <0.00%> (ø)
meteor/server/migration/1_38_0.ts 50.00% <0.00%> (ø)
meteor/server/migration/1_39_0.ts 58.33% <0.00%> (ø)
meteor/server/migration/1_40_0.ts 57.14% <0.00%> (ø)
... and 40 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbc0945...f5ecb90. Read the comment docs.

@Julusian Julusian merged commit 9789585 into nrkno:release43 May 16, 2022
@Julusian Julusian deleted the fix/oauth branch May 16, 2022 12:46
@Julusian Julusian mentioned this pull request May 18, 2022
5 tasks
@Julusian Julusian mentioned this pull request Jul 5, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution from SuperFly.tv Contributions sponsored by SuperFly.tv ✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants