drive, googlephotos: warn when using rclone's shared client_id #9580
The shared Google Drive and Google Photos client_id is being retired and will stop working during 2026. Warn users who rely on it (ie who have not configured their own client_id) so they can create their own in advance. The warning is only shown for auth flows that actually use the shared client_id, not for service account, environment or anonymous auth. See: https://forum.rclone.org/t/google-drive-and-google-photos-users-action-required/54005
This commit is contained in:
@@ -484,6 +484,24 @@ func OverrideCredentials(name string, m configmap.Mapper, origConfig *Config) (n
|
||||
return newConfig, changed
|
||||
}
|
||||
|
||||
// SharedClientIDWarning warns the user that this remote is relying on
|
||||
// rclone's built-in shared OAuth client_id.
|
||||
//
|
||||
// It only warns when the user has not configured their own client_id
|
||||
// (config.ConfigClientID is blank in the config), so it must only be
|
||||
// called from the code path that actually uses the shared client_id -
|
||||
// not for service account, environment or anonymous auth which don't.
|
||||
//
|
||||
// name is the remote's name, service is the human readable name of the
|
||||
// service (eg "Google Drive") and helpURL points at the docs describing
|
||||
// how to make your own client_id.
|
||||
func SharedClientIDWarning(name, service, helpURL string, m configmap.Mapper) {
|
||||
if clientID, _ := m.Get(config.ConfigClientID); clientID != "" {
|
||||
return
|
||||
}
|
||||
fs.Logf(name, "This remote uses rclone's shared %s client_id, which is being retired and will stop working during 2026. Create your own client_id to avoid interruption: %s", service, helpURL)
|
||||
}
|
||||
|
||||
// NewClientWithBaseClient gets a token from the config file and
|
||||
// configures a Client with it. It returns the client and a
|
||||
// TokenSource which Invalidate may need to be called on. It uses the
|
||||
|
||||
Reference in New Issue
Block a user