Skip to content

Commit

Permalink
fix: odk credentials are passed without encrypting at first to avoid …
Browse files Browse the repository at this point in the history
…double encryption (#1957)
  • Loading branch information
Sujanadh authored Dec 5, 2024
1 parent 086b776 commit df454b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/backend/app/organisations/organisation_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ async def get_org_odk_creds(
)

return central_schemas.ODKCentralDecrypted(
odk_central_url=org.odk_central_url,
odk_central_user=org.odk_central_user,
odk_central_password=org.odk_central_password,
odk_central_url=url,
odk_central_user=user,
odk_central_password=password,
)


Expand Down
12 changes: 4 additions & 8 deletions src/backend/app/organisations/organisation_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,16 @@ def parse_organisation_input(
The parsed data is returned as an OrganisationIn instance, with the
ODKCentralIn fields merged in.
"""
odk_central_data = ODKCentralIn(
odk_central_url=odk_central_url,
odk_central_user=odk_central_user,
odk_central_password=odk_central_password,
)
org_data = OrganisationUpdate(
return OrganisationUpdate(
name=name,
slug=slug,
created_by=created_by,
community_type=community_type,
type=type,
**odk_central_data.dict(exclude_unset=True),
odk_central_url=odk_central_url,
odk_central_user=odk_central_user,
odk_central_password=odk_central_password,
)
return org_data


class OrganisationOut(BaseModel):
Expand Down

0 comments on commit df454b7

Please sign in to comment.