-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Adding Basic Auth Authorization to Lever Hiring Connector #16572
Conversation
## What Adding Basic Authentication to Lever Hiring Issue raised in commit: airbytehq#16358 ## How *Describe the solution* ## Recommended reading order 1. `x.java` 2. `y.python` ## 🚨 User Impact 🚨 Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed. ## Pre-merge Checklist Expand the relevant checklist and delete the others. <details><summary><strong>New Connector</strong></summary> ### Community member or Airbyter - [ ] **Community member?** Grant edit access to maintainers ([instructions](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests)) - [ ] 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](https://docs.google.com/document/d/1ypdgmwmEHWv-TrO4_YOQ7pAJGVrMp5BOkEVh831N260/edit?usp=sharing) - [ ] `docs/integrations/<source or destination>/<name>.md` including changelog. See changelog [example](https://docs.airbyte.io/integrations/sources/stripe#changelog) - [ ] `docs/integrations/README.md` - [ ] `airbyte-integrations/builds.md` - [ ] PR name follows [PR naming conventions](https://docs.airbyte.io/contributing-to-airbyte/updating-documentation#issues-and-pull-requests) ### 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 - [ ] If new credentials are required for use in CI, add them to GSM. [Instructions](https://docs.airbyte.io/connector-development#using-credentials-in-ci). - [ ] [`/test connector=connectors/<name>` command](https://docs.airbyte.io/connector-development#updating-an-existing-connector) is passing - [ ] New Connector version released on Dockerhub by running the `/publish` command described [here](https://docs.airbyte.io/connector-development#updating-an-existing-connector) - [ ] After the connector is published, connector added to connector index as described [here](https://docs.airbyte.io/connector-development#publishing-a-connector) - [ ] Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described [here](https://docs.airbyte.io/connector-development#publishing-a-connector) </details> <details><summary><strong>Updating a connector</strong></summary> ### Community member or Airbyter - [ ] Grant edit access to maintainers ([instructions](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests)) - [ ] 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](https://docs.google.com/document/d/1ypdgmwmEHWv-TrO4_YOQ7pAJGVrMp5BOkEVh831N260/edit?usp=sharing) - [ ] Changelog updated in `docs/integrations/<source or destination>/<name>.md` including changelog. See changelog [example](https://docs.airbyte.io/integrations/sources/stripe#changelog) - [ ] PR name follows [PR naming conventions](https://docs.airbyte.io/contributing-to-airbyte/updating-documentation#issues-and-pull-requests) ### 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 - [ ] If new credentials are required for use in CI, add them to GSM. [Instructions](https://docs.airbyte.io/connector-development#using-credentials-in-ci). - [ ] [`/test connector=connectors/<name>` command](https://docs.airbyte.io/connector-development#updating-an-existing-connector) is passing - [ ] New Connector version released on Dockerhub and connector version bumped by running the `/publish` command described [here](https://docs.airbyte.io/connector-development#updating-an-existing-connector) </details> <details><summary><strong>Connector Generator</strong></summary> - [ ] Issue acceptance criteria met - [ ] PR name follows [PR naming conventions](https://docs.airbyte.io/contributing-to-airbyte/updating-documentation#issues-and-pull-requests) - [ ] If adding a new generator, add it to the [list of scaffold modules being tested](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connector-templates/generator/build.gradle#L41) - [ ] The generator test modules (all connectors with `-scaffold` in their name) have been updated with the latest scaffold by running `./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates` then checking in your changes - [ ] Documentation which references the generator is updated as needed </details> ## Tests <details><summary><strong>Unit</strong></summary> *Put your unit tests output here.* </details> <details><summary><strong>Integration</strong></summary> *Put your integration tests output here.* </details> <details><summary><strong>Acceptance</strong></summary> *Put your acceptance tests output here.* </details>
Issue was linked to Harvestr Discovery: Source Lever Hiring: Support API Key authentication |
Hi @akashkmr27089, thanks for working on this feature. This PR is part of Airbyte's Community Maintainer program and someone from the community will be assigned to review your PR and get it merged. Thanks for being patient! |
@@ -41,5 +41,8 @@ | |||
"editor.codeActionsOnSave": { | |||
"source.fixAll.stylelint": true | |||
} | |||
} | |||
}, | |||
"python.analysis.extraPaths": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it may improve your local vscode setup, is it okay to undo this change? Thanks.
token_refresh_endpoint=f"{SourceLeverHiring.URL_MAP_ACCORDING_ENVIRONMENT[config['environment']]['login']}oauth/token", | ||
) | ||
|
||
if config and config["credemtials"] and 'api_key' in config["credentials"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a typo, credemtials
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it okay to add a check on config["credentials"]["auth_type"], when the auth_type is Api Key
"default": "Api Key", | ||
"order": 0 | ||
}, | ||
"api_key": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an order
for the property api_key
?
can you help update the read me to reflect the additional authorization mode? And can you please add a row to the changelog? https://github.com/airbytehq/airbyte/blob/master/docs/integrations/sources/lever-hiring.md#getting-started Also, it would be great if you could add a sample_config for api_key, another file similar to the one for oauth: |
|
||
if config and config["credemtials"] and 'api_key' in config["credentials"]: | ||
return BasicHttpAuthenticator(username=config["credentials"]["api_key"], auth_method="Basic") | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
airbyte/airbyte-integrations/connectors/source-lever-hiring/unit_tests/test_source.py
Lines 11 to 14 in e198311
def setup_responses(): | |
responses.add( | |
responses.POST, "https://sandbox-lever.auth0.com/oauth/token", json={"access_token": "fake_access_token", "expires_in": 3600} | |
) |
Similar to the unit test for check_connection
above, can you add one for the basic auth? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some tests for the basic auth? Can you also update the readme to reflect the new authorization mode? Thanks.
@akashkmr27089, where are we with this PR? Can you provide an update? Thanks! |
Hello! |
@alexchouraki Hi, we didn't hear an update from @akashkmr27089, my last change request is to add unit tests for the basic auth, add sample config, and update the readme doc. You are encouraged to continue the work if you are interested. |
@YiyangLi, just did so, please have a look! :) |
What
Describe what the change is solving
Added Basic Auth authentication to the Lever Hiring connector
#16358
https://hire.lever.co/developer/documentation
Impact:
No impact in functionality