From f10ec367651f551ef3037858d8e0f35be2aa52b3 Mon Sep 17 00:00:00 2001 From: Cristiano Hoshikawa Date: Mon, 28 Oct 2024 15:48:35 -0300 Subject: [PATCH] correct the oci streaming endpoint --- files/func.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/func.py b/files/func.py index f133bf0..0ea1d07 100644 --- a/files/func.py +++ b/files/func.py @@ -16,7 +16,7 @@ def get_date(): def get_signing(d, streaming_host, oci_region): with open('oci_api_key.pem', 'rb') as key_file: private_key = load_pem_private_key(key_file.read(), password=None)# Dados para assinar - str = b'(request-target): post /20180418/streams//groupCursors\ndate: \nhost: cell-1.streaming..oci.oraclecloud.com'# Assine os dados usando SHA-256 e a chave privada + str = b'(request-target): post /20180418/streams//groupCursors\ndate: \nhost: streaming..oci.oraclecloud.com'# Assine os dados usando SHA-256 e a chave privada data = str.replace(b'', bytes(d.encode())).replace(b'', bytes(streaming_host.encode())).replace(b'', bytes(oci_region.encode())) signature = private_key.sign(data, padding.PKCS1v15(), hashes.SHA256())# Imprima a assinatura @@ -166,4 +166,4 @@ def handler(ctx, data: io.BytesIO = None): ctx, status_code=401, response_data=json.dumps({"active": False, "wwwAuthenticate": jsonData}) - ) \ No newline at end of file + )