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

Adding Basic Auth Authorization to Lever Hiring Connector #16572

Closed
wants to merge 4 commits into from

Conversation

akashkmr27089
Copy link

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

## 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>
@CLAassistant
Copy link

CLAassistant commented Sep 11, 2022

CLA assistant check
All committers have signed the CLA.

@akashkmr27089
Copy link
Author

hi @sajarin , i have created the pr for resolving issue #16358
I have not tested the flow as i dont have credentials, but based on documentation it should work fine.
Please review it

@akashkmr27089 akashkmr27089 changed the title Hiring lever Adding Basic Auth Authorization to Lever Hiring Connector Sep 11, 2022
@misteryeo
Copy link
Contributor

Issue was linked to Harvestr Discovery: Source Lever Hiring: Support API Key authentication

@sajarin sajarin added the bounty-M Maintainer program: claimable medium bounty PR label Sep 13, 2022
@sajarin
Copy link
Contributor

sajarin commented Sep 13, 2022

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": [
Copy link
Contributor

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"]:
Copy link
Contributor

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?

Copy link
Contributor

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": {
Copy link
Contributor

@YiyangLi YiyangLi Sep 15, 2022

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?

@YiyangLi
Copy link
Contributor

YiyangLi commented Sep 15, 2022

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:
https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-lever-hiring/integration_tests/sample_config.json


if config and config["credemtials"] and 'api_key' in config["credentials"]:
return BasicHttpAuthenticator(username=config["credentials"]["api_key"], auth_method="Basic")
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@YiyangLi YiyangLi left a 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.

@sajarin
Copy link
Contributor

sajarin commented Sep 29, 2022

@akashkmr27089, where are we with this PR? Can you provide an update? Thanks!

@alexchouraki
Copy link
Contributor

Hello!
Any news on this one? It would be pretty useful for me in my deployment of Airbyte...

@YiyangLi
Copy link
Contributor

@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.

@alexchouraki
Copy link
Contributor

@YiyangLi, just did so, please have a look! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues bounty bounty-M Maintainer program: claimable medium bounty PR community connectors/source/lever-hiring reward-100
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

8 participants