Skip to content

Commit

Permalink
Update source.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alexchouraki committed Oct 18, 2022
1 parent 77b10a6 commit 3d6d83c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@


def _auth_from_config(config):
if config and config["credentials"] and 'api_key' in config["credentials"]:
if config["auth_type"] == 'Api Key':
return BasicHttpAuthenticator(username=config["credentials"]["api_key"], password = None, auth_method="Basic")
else:
elif config["auth_type"] == 'Client':
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",
)

token_refresh_endpoint=f"{SourceLeverHiring.URL_MAP_ACCORDING_ENVIRONMENT[config['environment']]['login']}oauth/token")
else:
print("Auth type was not configured properly")
return None

class SourceLeverHiring(AbstractSource):
URL_MAP_ACCORDING_ENVIRONMENT = {
Expand Down

0 comments on commit 3d6d83c

Please sign in to comment.