From a0c2ff58cb2f24c1183f54d66bd0bf1605727a12 Mon Sep 17 00:00:00 2001 From: GHOST Date: Fri, 15 Sep 2023 21:58:43 +0000 Subject: [PATCH 1/2] feat: add patreon --- patreon/patreon.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 patreon/patreon.go diff --git a/patreon/patreon.go b/patreon/patreon.go new file mode 100644 index 000000000..4a1216aca --- /dev/null +++ b/patreon/patreon.go @@ -0,0 +1,16 @@ +// Copyright 2023 The Go 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 patreon provides constants for using OAuth2 to access Patreon APIs. +package patreon // import "golang.org/x/oauth2/patreon" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is the Patreon OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.patreon.com/oauth2/authorize", + TokenURL: "https://www.patreon.com/api/oauth2/token", +} From d9d41204a12ea52d11577f2778cfbe6fdc01168b Mon Sep 17 00:00:00 2001 From: GHOST Date: Sat, 23 Sep 2023 20:18:30 +0000 Subject: [PATCH 2/2] fix: switch to endpoints.go --- endpoints/endpoints.go | 10 ++++++++-- patreon/patreon.go | 16 ---------------- 2 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 patreon/patreon.go diff --git a/endpoints/endpoints.go b/endpoints/endpoints.go index 7fb3314bf..24ea9ed53 100644 --- a/endpoints/endpoints.go +++ b/endpoints/endpoints.go @@ -68,8 +68,8 @@ var GitLab = oauth2.Endpoint{ // Google is the endpoint for Google. var Google = oauth2.Endpoint{ - AuthURL: "https://accounts.google.com/o/oauth2/auth", - TokenURL: "https://oauth2.googleapis.com/token", + AuthURL: "https://accounts.google.com/o/oauth2/auth", + TokenURL: "https://oauth2.googleapis.com/token", DeviceAuthURL: "https://oauth2.googleapis.com/device/code", } @@ -217,6 +217,12 @@ var Zoom = oauth2.Endpoint{ TokenURL: "https://zoom.us/oauth/token", } +// Patreon is the endpoint for Patreon. +var Patreon = oauth2.Endpoint{ + AuthURL: "https://www.patreon.com/oauth2/authorize", + TokenURL: "https://www.patreon.com/api/oauth2/token", +} + // 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/patreon/patreon.go b/patreon/patreon.go deleted file mode 100644 index 4a1216aca..000000000 --- a/patreon/patreon.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2023 The Go 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 patreon provides constants for using OAuth2 to access Patreon APIs. -package patreon // import "golang.org/x/oauth2/patreon" - -import ( - "golang.org/x/oauth2" -) - -// Endpoint is the Patreon OAuth 2.0 endpoint. -var Endpoint = oauth2.Endpoint{ - AuthURL: "https://www.patreon.com/oauth2/authorize", - TokenURL: "https://www.patreon.com/api/oauth2/token", -}