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

remove google photos 😢 #5690

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ here.

### New providers

- [ ] Google Photos (#2163)
- [ ] MediaLibrary provider which shows you files that have already been
uploaded #450, #1121, #1112 #362
- [ ] Giphy image search (on top of Unsplash plugin) ()
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/integration/dashboard-transloadit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('Dashboard with Transloadit', () => {
client_ip: null,
client_referer: null,
transloadit_client:
'uppy-core:3.2.0,uppy-transloadit:3.1.3,uppy-tus:3.1.0,uppy-dropbox:3.1.1,uppy-box:2.1.1,uppy-facebook:3.1.1,uppy-google-drive:3.1.1,uppy-google-photos:0.0.1,uppy-instagram:3.1.1,uppy-onedrive:3.1.1,uppy-zoom:2.1.1,uppy-url:3.3.1',
'uppy-core:3.2.0,uppy-transloadit:3.1.3,uppy-tus:3.1.0,uppy-dropbox:3.1.1,uppy-box:2.1.1,uppy-facebook:3.1.1,uppy-google-drive:3.1.1,uppy-instagram:3.1.1,uppy-onedrive:3.1.1,uppy-zoom:2.1.1,uppy-url:3.3.1',
start_date: new Date().toISOString(),
upload_meta_data_extracted: false,
warnings: [],
Expand Down
1 change: 0 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@uppy/golden-retriever": "workspace:^",
"@uppy/google-drive": "workspace:^",
"@uppy/google-drive-picker": "workspace:^",
"@uppy/google-photos": "workspace:^",
"@uppy/google-photos-picker": "workspace:^",
"@uppy/image-editor": "workspace:^",
"@uppy/informer": "workspace:^",
Expand Down
1 change: 0 additions & 1 deletion examples/angular-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@uppy/core": "workspace:*",
"@uppy/drag-drop": "workspace:*",
"@uppy/google-drive": "workspace:*",
"@uppy/google-photos": "workspace:*",
"@uppy/progress-bar": "workspace:*",
"@uppy/tus": "workspace:*",
"@uppy/webcam": "workspace:*",
Expand Down
34 changes: 12 additions & 22 deletions packages/@uppy/companion/src/config/grant.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
const google = {
// access_type: offline is needed in order to get refresh tokens.
// prompt: 'consent' is needed because sometimes a user will get stuck in an authenticated state where we will
// receive no refresh tokens from them. This seems to be happen when running on different subdomains.
// therefore to be safe that we always get refresh tokens, we set this.
// https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token/65108513#65108513
custom_params: { access_type : 'offline', prompt: 'consent' },

// copied from https://github.com/simov/grant/blob/master/config/oauth.json
"authorize_url": "https://accounts.google.com/o/oauth2/v2/auth",
"access_url": "https://oauth2.googleapis.com/token",
"oauth": 2,
"scope_delimiter": " "
}

const defaults = {
transport: 'session',
state: true, // Enable CSRF check
Expand All @@ -25,17 +10,22 @@ module.exports = () => {
// and because it would be a too big rewrite to allow reuse of the same provider.
googledrive: {
...defaults,
...google,
// access_type: offline is needed in order to get refresh tokens.
// prompt: 'consent' is needed because sometimes a user will get stuck in an authenticated state where we will
// receive no refresh tokens from them. This seems to be happen when running on different subdomains.
// therefore to be safe that we always get refresh tokens, we set this.
// https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token/65108513#65108513
custom_params: { access_type : 'offline', prompt: 'consent' },

// copied from https://github.com/simov/grant/blob/master/config/oauth.json
authorize_url: "https://accounts.google.com/o/oauth2/v2/auth",
access_url: "https://oauth2.googleapis.com/token",
oauth: 2,
scope_delimiter: ' ',
state: true,
callback: '/drive/callback',
scope: ['https://www.googleapis.com/auth/drive.readonly'],
},
googlephotos: {
...defaults,
...google,
callback: '/googlephotos/callback',
scope: ['https://www.googleapis.com/auth/photoslibrary.readonly', 'https://www.googleapis.com/auth/userinfo.email'], // if name is needed, then add https://www.googleapis.com/auth/userinfo.profile too
},
dropbox: {
...defaults,
authorize_url: 'https://www.dropbox.com/oauth2/authorize',
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions packages/@uppy/companion/src/server/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
const dropbox = require('./dropbox')
const box = require('./box')
const { Drive } = require('./google/drive')
const googlephotos = require('./google/googlephotos')
const instagram = require('./instagram/graph')
const facebook = require('./facebook')
const onedrive = require('./onedrive')
Expand Down Expand Up @@ -69,7 +68,7 @@ module.exports.getProviderMiddleware = (providers, grantConfig) => {
* @returns {Record<string, typeof Provider>}
*/
module.exports.getDefaultProviders = () => {
const providers = { dropbox, box, drive: Drive, googlephotos, facebook, onedrive, zoom, instagram, unsplash, webdav }
const providers = { dropbox, box, drive: Drive, facebook, onedrive, zoom, instagram, unsplash, webdav }

return providers
}
Expand Down
5 changes: 0 additions & 5 deletions packages/@uppy/companion/src/standalone/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ const getConfigFromEnv = () => {
secret: getSecret('COMPANION_GOOGLE_SECRET'),
credentialsURL: process.env.COMPANION_GOOGLE_KEYS_ENDPOINT,
},
googlephotos: {
key: process.env.COMPANION_GOOGLE_KEY,
secret: getSecret('COMPANION_GOOGLE_SECRET'),
credentialsURL: process.env.COMPANION_GOOGLE_KEYS_ENDPOINT,
},
dropbox: {
key: process.env.COMPANION_DROPBOX_KEY,
secret: getSecret('COMPANION_DROPBOX_SECRET'),
Expand Down
25 changes: 0 additions & 25 deletions packages/@uppy/companion/test/__tests__/provider-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('Test Provider options', () => {
expect(grantConfig.googledrive.key).toBe('google_key')
expect(grantConfig.googledrive.secret).toBe('google_secret')

expect(grantConfig.googlephotos.key).toBe('google_key')
expect(grantConfig.googledrive.secret).toBe('google_secret')

expect(grantConfig.instagram.key).toBe('instagram_key')
Expand Down Expand Up @@ -96,25 +95,6 @@ describe('Test Provider options', () => {
},
})

expect(grantConfig.googlephotos).toEqual({
access_url: "https://oauth2.googleapis.com/token",
authorize_url: "https://accounts.google.com/o/oauth2/v2/auth",
oauth: 2,
scope_delimiter: " ",

key: 'google_key',
secret: 'google_secret',
transport: 'session',
"state": true,
redirect_uri: 'http://localhost:3020/googlephotos/redirect',
scope: ['https://www.googleapis.com/auth/photoslibrary.readonly', 'https://www.googleapis.com/auth/userinfo.email'],
callback: '/googlephotos/callback',
custom_params: {
access_type: 'offline',
prompt: 'consent',
},
})

expect(grantConfig.zoom).toEqual({
key: 'zoom_key',
secret: 'zoom_secret',
Expand Down Expand Up @@ -142,7 +122,6 @@ describe('Test Provider options', () => {
expect(grantConfig.dropbox.secret).toBe('xobpord')
expect(grantConfig.box.secret).toBe('xwbepqd')
expect(grantConfig.googledrive.secret).toBe('elgoog')
expect(grantConfig.googlephotos.secret).toBe('elgoog')
expect(grantConfig.instagram.secret).toBe('margatsni')
expect(grantConfig.zoom.secret).toBe('u8Z5ceq')
expect(companionOptions.providerOptions.zoom.verificationToken).toBe('o0u8Z5c')
Expand All @@ -162,9 +141,6 @@ describe('Test Provider options', () => {
expect(grantConfig.googledrive.key).toBeUndefined()
expect(grantConfig.googledrive.secret).toBeUndefined()

expect(grantConfig.googlephotos.key).toBeUndefined()
expect(grantConfig.googlephotos.secret).toBeUndefined()

expect(grantConfig.instagram.key).toBeUndefined()
expect(grantConfig.instagram.secret).toBeUndefined()

Expand All @@ -179,7 +155,6 @@ describe('Test Provider options', () => {
expect(grantConfig.dropbox.redirect_uri).toBe('http://domain.com/dropbox/redirect')
expect(grantConfig.box.redirect_uri).toBe('http://domain.com/box/redirect')
expect(grantConfig.googledrive.redirect_uri).toBe('http://domain.com/drive/redirect')
expect(grantConfig.googlephotos.redirect_uri).toBe('http://domain.com/googlephotos/redirect')
expect(grantConfig.instagram.redirect_uri).toBe('http://domain.com/instagram/redirect')
expect(grantConfig.zoom.redirect_uri).toBe('http://domain.com/zoom/redirect')
})
Expand Down
Loading
Loading