Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Source SurveyMonkey: add OAuth support #7433

Merged
merged 3 commits into from
Oct 31, 2021

Conversation

gaart
Copy link
Contributor

@gaart gaart commented Oct 27, 2021

What

Closes #6283

How

Add oauth interface to mimic standard workflow

Pre-merge Checklist

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

@github-actions github-actions bot added the area/connectors Connector related issues label Oct 27, 2021
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Oct 27, 2021
@gaart gaart temporarily deployed to more-secrets October 27, 2021 19:45 Inactive
}
}
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're missing the authspecification node in the spec.
Take a look at the github source spec for an example.

@gaart gaart requested a review from eliziario October 28, 2021 13:37
@gaart gaart temporarily deployed to more-secrets October 28, 2021 13:38 Inactive
else:
token = config.get("credentials", {}).get("access_token")

return TokenAuthenticator(token=token)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems incorrect because we're not using the client ID and refresh token anywhere, could you provide more info on why that's the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sherifnada the SurveyMonkey does not provide a refresh token, only an access token which never expires. The Oauth2Authenticator class is not used here. In fact, OAuth in SurveyMonkey boils down to obtaining an access token in a different way than in the current implementation, the way of authentication remains the same

Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after other comments will be addressed

@gaart
Copy link
Contributor Author

gaart commented Oct 31, 2021

/test connector=connectors/source-surveymonkey

🕑 connectors/source-surveymonkey https://github.com/airbytehq/airbyte/actions/runs/1404411800
✅ connectors/source-surveymonkey https://github.com/airbytehq/airbyte/actions/runs/1404411800
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                              Stmts   Miss  Cover
	 -----------------------------------------------------
	 source_surveymonkey/__init__.py       2      0   100%
	 source_surveymonkey/source.py        30     17    43%
	 source_surveymonkey/streams.py      145     86    41%
	 -----------------------------------------------------
	 TOTAL                               177    103    42%

@jrhizor jrhizor temporarily deployed to more-secrets October 31, 2021 09:59 Inactive
@gaart
Copy link
Contributor Author

gaart commented Oct 31, 2021

/publish connector=connectors/source-surveymonkey

🕑 connectors/source-surveymonkey https://github.com/airbytehq/airbyte/actions/runs/1404455334
✅ connectors/source-surveymonkey https://github.com/airbytehq/airbyte/actions/runs/1404455334

@jrhizor jrhizor temporarily deployed to more-secrets October 31, 2021 10:24 Inactive
@gaart gaart merged commit 74c78b9 into master Oct 31, 2021
@gaart gaart deleted the gaart/6283-survey-monkey-oauth branch October 31, 2021 10:33
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
* Add OAuth support

* Upd changelog

* Upd spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source SurveyMonkey: support oauth
5 participants