From f3c1f21e64eb1cbcd9f43b9f54bee6ef173a02d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20T=C3=B3th?= Date: Fri, 18 Oct 2024 12:47:28 +0200 Subject: [PATCH] private_key_file_location is not required when private_key_content specified for Signer class --- src/oci/signer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/oci/signer.py b/src/oci/signer.py index 325bff5917..5dee4dd9e0 100644 --- a/src/oci/signer.py +++ b/src/oci/signer.py @@ -246,13 +246,15 @@ class Signer(AbstractBaseSigner): """ - def __init__(self, tenancy, user, fingerprint, private_key_file_location, pass_phrase=None, private_key_content=None): + def __init__(self, tenancy, user, fingerprint, private_key_file_location=None, pass_phrase=None, private_key_content=None): self.api_key = tenancy + "/" + user + "/" + fingerprint if private_key_content: self.private_key = load_private_key(private_key_content, pass_phrase) - else: + elif private_key_file_location: self.private_key = load_private_key_from_file(private_key_file_location, pass_phrase) + else: + raise ValueError("Must supply either a private key content or a private key file path.") generic_headers = ["date", "(request-target)", "host"] body_headers = ["content-length", "content-type", "x-content-sha256"]