Repository: amp-labs/connectors
Pull request #84 (2024-03-12 06:24:23)

[ENG-821] feat: Add Asana connector
## Catalog variables
No catalog variables

## Notes
Supports batching requests and offers App component API as well as REST API.

## Testing 
### GET 
<img width="1150" alt="Screenshot 2024-03-11 at 15 57 37" src="https://github.com/amp-labs/connectors/assets/52887226/8b95f179-1c44-4669-9bf8-ac3a5c2ad5bc">

### POST
<img width="1153" alt="Screenshot 2024-03-11 at 16 00 56" src="https://github.com/amp-labs/connectors/assets/52887226/6d58ae41-d70b-4cb4-947e-8a3b10d99ee0">

### PUT
<img width="1143" alt="Screenshot 2024-03-11 at 16 07 40" src="https://github.com/amp-labs/connectors/assets/52887226/e08b1db2-1e82-46ee-b60b-14f1f7303025">

### DELETE
<img width="1146" alt="Screenshot 2024-03-11 at 16 08 25" src="https://github.com/amp-labs/connectors/assets/52887226/dff32ef7-f3f2-4b92-9760-f98ebd0faf8d">

## Pagination
Requesting a page with pagination properties
<img width="1149" alt="Screenshot 2024-03-11 at 15 56 21" src="https://github.com/amp-labs/connectors/assets/52887226/8719eae9-4d78-4304-89ef-b3cc9bd986f1">

Using the next page details to go to the next page:
<img width="1143" alt="Screenshot 2024-03-11 at 15 55 48" src="https://github.com/amp-labs/connectors/assets/52887226/6af52f83-e6aa-489b-87ce-c0fc128c2279">



Patch:
diff --git a/providers/catalog.go b/providers/catalog.go
index 3ab71bdc..11050ca8 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -11,6 +11,7 @@ const (
 	Salesloft  Provider = "salesloft"
 	Outreach   Provider = "outreach"
 	Keap       Provider = "keap"
+	Asana      Provider = "asana"
 )
 
 // ================================================================================
@@ -136,4 +137,23 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 			Write:     false,
 		},
 	},
+
+	// Asana configuration
+	Asana: {
+		AuthType: Oauth2,
+		BaseURL:  "https://app.asana.com/api",
+		OauthOpts: OauthOpts{
+			AuthURL:                   "https://app.asana.com/-/oauth_authorize",
+			TokenURL:                  "https://app.asana.com/-/oauth_token",
+			ExplicitScopesRequired:    false,
+			ExplicitWorkspaceRequired: false,
+		},
+		Support: Support{
+			BulkWrite: false,
+			Proxy:     false,
+			Read:      false,
+			Subscribe: false,
+			Write:     false,
+		},
+	},
 }


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 1dffe72c..d7a041d8 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -173,6 +173,28 @@ var testCases = []struct { // nolint
 		},
 		expectedErr: nil,
 	},
+	{
+		provider:    Asana,
+		description: "Valid Asana provider config with no substitutions",
+		expected: &ProviderInfo{
+			Support: Support{
+				Read:      false,
+				Write:     false,
+				BulkWrite: false,
+				Subscribe: false,
+				Proxy:     false,
+			},
+			AuthType: Oauth2,
+			OauthOpts: OauthOpts{
+				AuthURL:                   "https://app.asana.com/-/oauth_authorize",
+				TokenURL:                  "https://app.asana.com/-/oauth_token",
+				ExplicitScopesRequired:    false,
+				ExplicitWorkspaceRequired: false,
+			},
+			BaseURL: "https://app.asana.com/api",
+		},
+		expectedErr: nil,
+	},
 }
 
 func TestReadInfo(t *testing.T) { // nolint