Repository: amp-labs/connectors
Pull request #308 (2024-05-10 10:52:20)

git PR template: Proxy Connector
![image](https://github.com/amp-labs/connectors/assets/60330780/cf01438b-bcc8-46b6-914b-d212eff0348b)



Patch:
diff --git a/.github/PULL_REQUEST_TEMPLATE/proxy_connector.md b/.github/PULL_REQUEST_TEMPLATE/proxy_connector.md
new file mode 100644
index 00000000..b3f52a15
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/proxy_connector.md
@@ -0,0 +1,23 @@
+## Testing
+### GET
+URL: <localhost:4444/v2/some-api-call>
+Postman screenshot (must show the request URL, the response status code & body clearly)
+
+### POST
+URL: <localhost:4444/v2/some-api-call>
+Postman screenshot (must show the request URL, the response status code & body clearly)
+
+<Please add the same information for all other methods available - PUT, PATCH, DELETE, etc>
+
+### Invalid requests
+Wrong verb applied, invalid path.
+
+
+## Pagination
+Please add screenshots that show successful pagination using the connector. 
+
+## Successful console operation (operation & events)
+
+## Failed console operation (operation & events)
+
+## Raw token response
\ No newline at end of file
diff --git a/providers/catalog.go b/providers/catalog.go
index 248cbfa6..b171e4fe 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -59,6 +59,8 @@ const (
 	Typeform                            Provider = "typeform"
 	Zuora                               Provider = "zuora"
 	DropboxSign                         Provider = "dropboxSign"
+	ClickUp                             Provider = "clickup"
+	Discord                             Provider = "discord"
 )
 
 // ================================================================================
@@ -701,10 +703,14 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 		AuthType: Oauth2,
 		BaseURL:  "https://demo.docusign.net",
 		OauthOpts: OauthOpts{
+			GrantType:                 AuthorizationCode,
 			AuthURL:                   "https://account-d.docusign.com/oauth/auth",
 			TokenURL:                  "https://account-d.docusign.com/oauth/token",
 			ExplicitScopesRequired:    true,
 			ExplicitWorkspaceRequired: false,
+			TokenMetadataFields: TokenMetadataFields{
+				ScopesField: "scope",
+			},
 		},
 		Support: Support{
 			BulkWrite: BulkWriteSupport{
@@ -713,7 +719,7 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 				Upsert: false,
 				Delete: false,
 			},
-			Proxy:     false,
+			Proxy:     true,
 			Read:      false,
 			Subscribe: false,
 			Write:     false,
@@ -1040,7 +1046,7 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 				Upsert: false,
 				Delete: false,
 			},
-			Proxy:     false,
+			Proxy:     true,
 			Read:      false,
 			Subscribe: false,
 			Write:     false,
@@ -1447,4 +1453,56 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 			Write:     false,
 		},
 	},
+	// ClickUp Support Configuration
+	ClickUp: {
+		AuthType: Oauth2,
+		BaseURL:  "https://api.clickup.com",
+		OauthOpts: OauthOpts{
+			GrantType:                 AuthorizationCode,
+			AuthURL:                   "https://app.clickup.com/api",
+			TokenURL:                  "https://api.clickup.com/api/v2/oauth/token",
+			ExplicitScopesRequired:    false,
+			ExplicitWorkspaceRequired: false,
+		},
+		Support: Support{
+			BulkWrite: BulkWriteSupport{
+				Insert: false,
+				Update: false,
+				Upsert: false,
+				Delete: false,
+			},
+			Proxy:     false,
+			Read:      false,
+			Subscribe: false,
+			Write:     false,
+		},
+	},
+
+	// Discord Support Configuration
+	Discord: {
+		AuthType: Oauth2,
+		BaseURL:  "https://discord.com",
+		OauthOpts: OauthOpts{
+			GrantType:                 AuthorizationCode,
+			AuthURL:                   "https://discord.com/oauth2/authorize",
+			TokenURL:                  "https://discord.com/api/oauth2/token",
+			ExplicitScopesRequired:    true,
+			ExplicitWorkspaceRequired: false,
+			TokenMetadataFields: TokenMetadataFields{
+				ScopesField: "scope",
+			},
+		},
+		Support: Support{
+			BulkWrite: BulkWriteSupport{
+				Insert: false,
+				Update: false,
+				Upsert: false,
+				Delete: false,
+			},
+			Proxy:     false,
+			Read:      false,
+			Subscribe: false,
+			Write:     false,
+		},
+	},
 }


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 6d08361b..3b90cdfa 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -771,14 +771,18 @@ var testCases = []struct { // nolint
 					Delete: false,
 				},
 				Subscribe: false,
-				Proxy:     false,
+				Proxy:     true,
 			},
 			AuthType: Oauth2,
 			OauthOpts: OauthOpts{
+				GrantType:                 AuthorizationCode,
 				AuthURL:                   "https://account-d.docusign.com/oauth/auth",
 				TokenURL:                  "https://account-d.docusign.com/oauth/token",
 				ExplicitScopesRequired:    true,
 				ExplicitWorkspaceRequired: false,
+				TokenMetadataFields: TokenMetadataFields{
+					ScopesField: "scope",
+				},
 			},
 			BaseURL: "https://demo.docusign.net",
 		},
@@ -1149,7 +1153,7 @@ var testCases = []struct { // nolint
 					Delete: false,
 				},
 				Subscribe: false,
-				Proxy:     false,
+				Proxy:     true,
 			},
 			AuthType: Oauth2,
 			OauthOpts: OauthOpts{
@@ -1624,6 +1628,65 @@ var testCases = []struct { // nolint
 		},
 		expectedErr: nil,
 	},
+	{
+		provider:    ClickUp,
+		description: "Valid ClickUp provider config with no substitutions",
+		expected: &ProviderInfo{
+			AuthType: Oauth2,
+			OauthOpts: OauthOpts{
+				GrantType:                 AuthorizationCode,
+				AuthURL:                   "https://app.clickup.com/api",
+				TokenURL:                  "https://api.clickup.com/api/v2/oauth/token",
+				ExplicitScopesRequired:    false,
+				ExplicitWorkspaceRequired: false,
+			},
+			Support: Support{
+				BulkWrite: BulkWriteSupport{
+					Insert: false,
+					Update: false,
+					Upsert: false,
+					Delete: false,
+				},
+				Proxy:     false,
+				Read:      false,
+				Subscribe: false,
+				Write:     false,
+			},
+			BaseURL: "https://api.clickup.com",
+		},
+		expectedErr: nil,
+	},
+	{
+		provider:    Discord,
+		description: "Valid Discord provider config with no substitutions",
+		expected: &ProviderInfo{
+			AuthType: Oauth2,
+			OauthOpts: OauthOpts{
+				GrantType:                 AuthorizationCode,
+				AuthURL:                   "https://discord.com/oauth2/authorize",
+				TokenURL:                  "https://discord.com/api/oauth2/token",
+				ExplicitScopesRequired:    true,
+				ExplicitWorkspaceRequired: false,
+				TokenMetadataFields: TokenMetadataFields{
+					ScopesField: "scope",
+				},
+			},
+			Support: Support{
+				BulkWrite: BulkWriteSupport{
+					Insert: false,
+					Update: false,
+					Upsert: false,
+					Delete: false,
+				},
+				Proxy:     false,
+				Read:      false,
+				Subscribe: false,
+				Write:     false,
+			},
+			BaseURL: "https://discord.com",
+		},
+		expectedErr: nil,
+	},
 }
 
 func TestReadInfo(t *testing.T) { // nolint