oncall-engine/engine/apps
Joey Orlando eb777f5415
address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802)
# What this PR does

Follow up PR to https://github.com/grafana/oncall/pull/4792

Basically if when communicating with Google Calendar's API we encounter
an HTTP 403, or the Google client throws a
`google.auth.exceptions.RefreshError` this means one of three things:
1. the refresh token we have persisted for the user is missing the
`https://www.googleapis.com/auth/calendar.events.readonly` scope (HTTP
403)
2. the Google user has been deleted
(`google.auth.exceptions.RefreshError`)
3. the refresh token has expired (`google.auth.exceptions.RefreshError`)

To prevent scenario 1 above from happening in the future we now will
check that the token has been granted the required scopes. If the user
doesn't grant us all the necessary scopes, we will show them an error
message in the UI:
https://www.loom.com/share/0055ef03192b4154b894c2221cecbd5f

For tokens that were granted prior to this PR and which are missing the
required scope, we will show the user a dismissible warning banner in
the UI letting them know that they will need to reconnect their account
and grant us the missing permissions (see [this second demo
video](https://www.loom.com/share/bf2ee8b840864a64893165370a892bcd)
showing this).

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Dominik <dominik.broj@grafana.com>
2024-08-14 18:02:34 -04:00
..
alerts Fix N+1 issue on alert group list page (#4738) 2024-07-25 17:26:05 +00:00
api address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802) 2024-08-14 18:02:34 -04:00
api_for_grafana_incident add labels in grafana-incident alertgroup endpoint (#4448) 2024-06-25 14:50:55 +00:00
auth_token Fix refactored permissions sync (#4771) 2024-07-31 20:27:42 +00:00
base patch default user notification policy changes + fix failing e2e test (#4635) 2024-07-09 11:23:53 -04:00
chatops_proxy Fix app redirect (#4725) 2024-07-24 09:59:56 +00:00
email Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
exotel Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
google address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802) 2024-08-14 18:02:34 -04:00
grafana_plugin address occasional missing nextCursor data key from GCOM GET /instances (#4794) 2024-08-09 15:42:10 +00:00
heartbeat Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
integrations Add tilt button to run pytest, fix local dev config for pytest, minor improvements to til (#3927) 2024-07-09 01:24:18 +00:00
labels Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
metrics_exporter Fix collecting metrics (#4822) 2024-08-14 13:53:43 +00:00
mobile_app Better logging for send_message_to_fcm_device (#4814) 2024-08-13 17:47:43 +00:00
oss_installation bump uwsgi to 2.0.26 + Python to 3.12.3 (#4495) 2024-06-10 15:33:37 -04:00
phone_notifications Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
public_api Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
schedules Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
slack Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
social_auth address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802) 2024-08-14 18:02:34 -04:00
telegram Address deprecation warnings in tests (#4681) 2024-08-13 20:51:18 +00:00
twilioapp Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
user_management address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802) 2024-08-14 18:02:34 -04:00
webhooks apps.webhooks.tasks.trigger_webhook.execute_webhook task - don't retry on requests.exceptions.SSLError (#4796) 2024-08-09 17:45:09 +00:00
zvonok Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00