Note that there are some explanatory texts on larger screens.

plurals
  1. POListing files with search query returns out-of-scope results (drive.files.list call, using drive.files scope)
    primarykey
    data
    text
    <p>I'm running into a strange issue with the Google Drive SDK — I'm not sure if this is the designed behavior or if it's a bug in the scoping.</p> <p>Quick background: we're developing an application using the "drive.files" scope (e.g. only files / folders created by our app) and we want to list all folders created by our app. So we use the drive.files.list method call (using the Javascript client API), with a query for the drive folder mimeType:</p> <pre><code>mimeType = 'application/vnd.google-apps.folder' </code></pre> <p><strong>The problem</strong>: what comes back is a list of <em>all</em> folders in the user's Drive account, not just the ones created by our app.</p> <p>Is this not a blatant violation of scope? As far as I can tell, the documentation doesn't indicate whether we should expect to see out-of-scope files returned from search queries.</p> <p>This behavior can be repeated using the Google APIs explorer:</p> <ol> <li>Open the Google APIs explorer: <a href="https://developers.google.com/apis-explorer/#s/drive/v2/drive.files.list?_h=3&amp;" rel="nofollow">Google APIs Explorer: drive.files.list with empty query</a></li> <li>Turn OAuth authorization to ON, using only the drive.file authorization.</li> <li>Click "Execute" with an empty query. The results list should be empty.</li> <li><p>Now, enter the folder query into the 'q' parameter box:</p> <p>mimeType = 'application/vnd.google-apps.folder'</p></li> <li><p>Click "Execute". The results list shows folders in the users' Drive account that have <em>not</em> been created by the APIs Explorer app. </p></li> </ol> <p>Am I missing something here? Is this the expected behavior? And if so — is there a better way to get the list of folders only created by our app?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload