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

Incorrect OAuth scopes (possibly throughout the library) #143

Open
saurabhnanda opened this issue Jan 16, 2020 · 2 comments
Open

Incorrect OAuth scopes (possibly throughout the library) #143

saurabhnanda opened this issue Jan 16, 2020 · 2 comments

Comments

@saurabhnanda
Copy link

saurabhnanda commented Jan 16, 2020

With Google clamping down on OAuth scopes being available to API clients [1], it is very important to make API calls with the LEAST "intrusive" scope. To give an example, here are the docs of spreadsheets.create (emphasis mine):

Requires one of the following OAuth scopes:

However, v0.5.0 of the library requires ALL of the scopes to make this API call:

type instance Scopes SpreadsheetsCreate
  = '["https://www.googleapis.com/auth/drive",
      "https://www.googleapis.com/auth/drive.file",
      "https://www.googleapis.com/auth/spreadsheets"]
    -- Defined in ‘Network.Google.Resource.Sheets.Spreadsheets.Create’

I have tried making this API call with the least restrictive (and in fact "free-to-use" OAuth scope), i.e. https://www.googleapis.com/auth/drive.file" and it seems to work.

[1] A lot of scopes are now classified as restricted and/or sensitive, and one has to complete a lengthy verification process to get access to these scopes in an external/production app.

@saurabhnanda
Copy link
Author

Does anyone know where this file is coming from? https://github.com/brendanhay/gogol/blob/develop/gen/model/sheets/v4/sheets-api.json

I guess the autogen infra is emitting Haskell code according to this file.

@saurabhnanda
Copy link
Author

I'm reading https://github.com/brendanhay/gogol/blob/develop/gen/README.md -- what kind of stuff can go into the annex/**.json files? Can we override the service descriptions via the corresponding annex file?

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

No branches or pull requests

2 participants