From 27b2cd37a0cdc9af5aaf93cf4f7933297f72338a Mon Sep 17 00:00:00 2001 From: Emmaly Date: Wed, 27 May 2020 19:03:16 -0700 Subject: [PATCH 1/2] Added Withings Health Mate OAuth2 endpoint --- withings/withings.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 withings/withings.go diff --git a/withings/withings.go b/withings/withings.go new file mode 100644 index 000000000..ff18fa3e9 --- /dev/null +++ b/withings/withings.go @@ -0,0 +1,16 @@ +// Copyright 2018 The oauth2 Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package withings provides constants for using OAuth2 to access the Withings Health Mate API, formerly known as the Nokia Health Mate API. +package withings + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is the Withings Health Mate OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://account.withings.com/oauth2_user/authorize2", + TokenURL: "https://account.withings.com/oauth2/token", +} From 29e5e36bb73f2b27bd9f8af8e569a842bd7b913e Mon Sep 17 00:00:00 2001 From: Emmaly Date: Wed, 27 May 2020 20:08:54 -0700 Subject: [PATCH 2/2] Removed oauth2/{nokiahealth,withings}, updated oauth2/endpoints for withings --- endpoints/endpoints.go | 15 +++++++++------ nokiahealth/nokiahealth.go | 16 ---------------- withings/withings.go | 16 ---------------- 3 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 nokiahealth/nokiahealth.go delete mode 100644 withings/withings.go diff --git a/endpoints/endpoints.go b/endpoints/endpoints.go index 811e101f9..10904b1a1 100644 --- a/endpoints/endpoints.go +++ b/endpoints/endpoints.go @@ -125,12 +125,6 @@ var Microsoft = oauth2.Endpoint{ TokenURL: "https://login.live.com/oauth20_token.srf", } -// NokiaHealth is the endpoint for Nokia Health. -var NokiaHealth = oauth2.Endpoint{ - AuthURL: "https://account.health.nokia.com/oauth2_user/authorize2", - TokenURL: "https://account.health.nokia.com/oauth2/token", -} - // Odnoklassniki is the endpoint for Odnoklassniki. var Odnoklassniki = oauth2.Endpoint{ AuthURL: "https://www.odnoklassniki.ru/oauth/authorize", @@ -185,6 +179,12 @@ var Vk = oauth2.Endpoint{ TokenURL: "https://oauth.vk.com/access_token", } +// Withings is the endpoint for Withings Health Mate. +var Withings = oauth2.Endpoint{ + AuthURL: "https://account.withings.com/oauth2_user/authorize2", + TokenURL: "https://account.withings.com/oauth2/token", +} + // Yahoo is the endpoint for Yahoo. var Yahoo = oauth2.Endpoint{ AuthURL: "https://api.login.yahoo.com/oauth2/request_auth", @@ -197,6 +197,9 @@ var Yandex = oauth2.Endpoint{ TokenURL: "https://oauth.yandex.com/token", } +// NokiaHealth is an alias to the endpoint for Withings. +var NokiaHealth = Withings + // AzureAD returns a new oauth2.Endpoint for the given tenant at Azure Active Directory. // If tenant is empty, it uses the tenant called `common`. // diff --git a/nokiahealth/nokiahealth.go b/nokiahealth/nokiahealth.go deleted file mode 100644 index c181ccd0f..000000000 --- a/nokiahealth/nokiahealth.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The oauth2 Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package nokiahealth provides constants for using OAuth2 to access the Nokia Health Mate API. -package nokiahealth - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is Nokia Health Mate's OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://account.health.nokia.com/oauth2_user/authorize2", - TokenURL: "https://account.health.nokia.com/oauth2/token", -} diff --git a/withings/withings.go b/withings/withings.go deleted file mode 100644 index ff18fa3e9..000000000 --- a/withings/withings.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The oauth2 Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package withings provides constants for using OAuth2 to access the Withings Health Mate API, formerly known as the Nokia Health Mate API. -package withings - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is the Withings Health Mate OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://account.withings.com/oauth2_user/authorize2", - TokenURL: "https://account.withings.com/oauth2/token", -}