Skip to content

Commit

Permalink
fixed s3 empty credentials erroring out (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
opaduchak authored Nov 25, 2024
1 parent 6fd1a78 commit 9c44c11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addon_service/authorized_account/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def process_and_set_auth(
"initiate_oauth": "this external service is not configured for oauth"
}
)
elif validated_data.get("credentials"):
elif authorized_account.credentials_format.is_direct_from_user:
if not validated_data.get("credentials"):
raise ModelValidationError("Credentials are required")
authorized_account.credentials = validated_data["credentials"]
authorized_account.imp_cls.confirm_credentials(
authorized_account.credentials
Expand Down
1 change: 1 addition & 0 deletions addon_service/common/credentials_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def is_direct_from_user(self) -> bool:
CredentialsFormats.ACCESS_KEY_SECRET_KEY,
CredentialsFormats.USERNAME_PASSWORD,
CredentialsFormats.PERSONAL_ACCESS_TOKEN,
CredentialsFormats.DATAVERSE_API_TOKEN,
}

def iter_headers(self, credentials: Credentials) -> Iterator[tuple[str, str]]:
Expand Down

0 comments on commit 9c44c11

Please sign in to comment.