-
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,18 +6,22 @@ | |||||||||
|
||||||||||
from airbyte_cdk.sources import AbstractSource | ||||||||||
from airbyte_cdk.sources.streams import Stream | ||||||||||
from airbyte_cdk.sources.streams.http.auth import Oauth2Authenticator | ||||||||||
from airbyte_cdk.sources.streams.http.auth import BasicHttpAuthenticator, Oauth2Authenticator | ||||||||||
|
||||||||||
from .streams import Applications, Interviews, Notes, Offers, Opportunities, Referrals, Users | ||||||||||
|
||||||||||
|
||||||||||
def _auth_from_config(config): | ||||||||||
return Oauth2Authenticator( | ||||||||||
client_id=config["credentials"]["client_id"], | ||||||||||
client_secret=config["credentials"]["client_secret"], | ||||||||||
refresh_token=config["credentials"]["refresh_token"], | ||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. is it a typo, There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||||
return BasicHttpAuthenticator(username=config["credentials"]["api_key"], auth_method="Basic") | ||||||||||
else: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Similar to the unit test for |
||||||||||
return Oauth2Authenticator( | ||||||||||
client_id=config["credentials"]["client_id"], | ||||||||||
client_secret=config["credentials"]["client_secret"], | ||||||||||
refresh_token=config["credentials"]["refresh_token"], | ||||||||||
token_refresh_endpoint=f"{SourceLeverHiring.URL_MAP_ACCORDING_ENVIRONMENT[config['environment']]['login']}oauth/token", | ||||||||||
) | ||||||||||
|
||||||||||
|
||||||||||
class SourceLeverHiring(AbstractSource): | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,25 @@ | |
"airbyte_secret": true | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"title": "Authenticate via Lever (Api Key)", | ||
"required": ["api_key"], | ||
"properties": { | ||
"auth_type": { | ||
"type": "string", | ||
"const": "Api Key", | ||
"enum": ["Api Key"], | ||
"default": "Api Key", | ||
"order": 0 | ||
}, | ||
"api_key": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add an |
||
"title": "Api key", | ||
"type": "string", | ||
"description": "The Api Key of your Lever Hiring developer application." | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
|
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.