Skip to content

Commit

Permalink
Merge pull request #40 from Jeffrey04/feature/#39/20201217-add-auth-s…
Browse files Browse the repository at this point in the history
…upport

Feature/#39/20201217 add auth support
  • Loading branch information
kaerumy authored Feb 6, 2021
2 parents e99fe35 + f1d868b commit 7a72111
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/popit_relationship/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def sync():
@sync.command("all")
@coro
@click.pass_context
async def all_sync(ctx):
async def all_sync(_ctx):
await tree_import(TYPE_PERSON, "Person", person_build_node)
await tree_import(TYPE_RELATIONSHIP, "Relationship", relationship_build_node)
await tree_import(TYPE_ORGANIZATION, "Organization", organization_build_node)
Expand Down Expand Up @@ -366,7 +366,15 @@ def relationship_filter_empty(result):

def session_start_http():
return aiohttp.ClientSession(
headers={"Accept": "application/json"}, json_serialize=ujson.dumps
headers={"Accept": "application/json"},
json_serialize=ujson.dumps,
auth=(
aiohttp.BasicAuth(
os.environ["API_AUTH_USER"], os.environ.get("API_AUTH_PASS", None)
)
if os.environ.get("API_AUTH_USER", False)
else None
),
)


Expand Down

0 comments on commit 7a72111

Please sign in to comment.