From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CE84042D67 for ; Tue, 27 Jun 2023 19:32:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6E864113F; Tue, 27 Jun 2023 19:32:12 +0200 (CEST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id B9CDB40EE1 for ; Tue, 27 Jun 2023 19:32:10 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-557790487feso3323143a12.0 for ; Tue, 27 Jun 2023 10:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1687887130; x=1690479130; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ec/Gl1RpyyqEIKpQoyACgvAUXTwiEWBueBdq2ylF9og=; b=fYJG9Znhbh27zQZoiKpk/Shaz/VNVwbD19JHG6FIP9NurL/xKdNnDk5wiCLVr8feF3 L2le5c+8Bs43q+wCN9sUDjwOllgiT2U2Jjfy0YKp5OhS7GCnB0MtZeYegvRARC4Ey8QY Mh91jPvDhmqGTSy4Vtw5SeKY/TQCD4yRvUYf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687887130; x=1690479130; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ec/Gl1RpyyqEIKpQoyACgvAUXTwiEWBueBdq2ylF9og=; b=iC92X0hXjOeo5tSbAsU0I9FLjIzmvwiY2TBV7YojdnviPro9wbCCSEd4bEB+UX4HoG t/QILYtfjJD9y79QilmycAFmggyTL1gKrOb5wyDZF+o7DHdoFQFgBYf5+FhfYVB+HgdD lwT6KS9Px9zZqOIWBPoL5RIww8/sIs5OkB2tlIa6R+HJrNFq/fucTxjlVbJdWr6s/xYF YmZejkFdWJsKBMh4ncYEFRb2DycrGg65gYYCQ2k/d4fAidsXHSJA2ERCzpvH2isVK9gk Cgrol+aQGXE6oMZ+8JuYoFyV+a3ceC5kZ4++KJV4zl+H7lnREb0/yqOhQtQBdYanPZHg 7eJA== X-Gm-Message-State: AC+VfDyNuugbXScyIxQG713i7JDpVL7uHR40dxHkDaj85mcfmrCVH8+9 oNlmqEo8mgfD5nztohsqVn9i1+hooon1snChU7qKfUzV6ocs9ltj X-Google-Smtp-Source: ACHHUZ5hP4xtkqUs5CduyYMK/ceuir3xhihFo9ToZtYmiYgTclwvRMHO+VRZThDGDy5ZLMniVTWGYOklTOCuqz7oDRg= X-Received: by 2002:a17:90a:c258:b0:261:49b:d65 with SMTP id d24-20020a17090ac25800b00261049b0d65mr20022547pjx.28.1687887129645; Tue, 27 Jun 2023 10:32:09 -0700 (PDT) MIME-Version: 1.0 References: <20230626213746.25465-2-jspewock@iol.unh.edu> In-Reply-To: From: Jeremy Spewock Date: Tue, 27 Jun 2023 13:31:58 -0400 Message-ID: Subject: Re: [PATCH v2] tools: add jwt renewal function to acvp_tool To: Aaron Conole Cc: ci@dpdk.org Content-Type: multipart/alternative; boundary="000000000000c8a63505ff1fd892" X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org --000000000000c8a63505ff1fd892 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 27, 2023 at 12:19=E2=80=AFPM Aaron Conole = wrote: > jspewock@iol.unh.edu writes: > > > From: Jeremy Spewock > > > > Adds a method that follows the process for renewing your jwt according > > to NIST API documentation. This way, if there are load issues and it > > takes too long to get vectors back with multi-algorithm testing, the > > script will always handle the jwt expiring. > > > > Also added a maximum number of renewals so that the script cannot run > > infinitely. > > > > Signed-off-by: Jeremy Spewock > > --- > > Hi Jeremy, > > Thanks for the changes, it is much easier to follow now. > > I ran this through 'black' and it did flag a few of your changes, but > I don't think it is an issue here because they are single quote > vs. double quote usage, and the usage you have is consistent with the > rest of the file. > > > tools/acvp/acvp_tool.py | 71 ++++++++++++++++++++++++++++++++++++----- > > 1 file changed, 63 insertions(+), 8 deletions(-) > > mode change 100755 =3D> 100644 tools/acvp/acvp_tool.py > > Was this mode change intentional? I guess it must not be since the > README advocates usage as: > > acvp_tool.py --request $DOWNLOAD_PATH > > I can fix on apply if you confirm. > Great catch, you're right, this was not something I meant to change. I noticed there was a conflict with file modes when I was creating and testing the patch and I thought I fixed it to be the right one before submitting but I suppose I did it in reverse. if you could fix it what would be appreciated, thank you. > > diff --git a/tools/acvp/acvp_tool.py b/tools/acvp/acvp_tool.py > > old mode 100755 > > new mode 100644 > > index 40d2f2f..a28760d > > --- a/tools/acvp/acvp_tool.py > > +++ b/tools/acvp/acvp_tool.py > > @@ -1,7 +1,7 @@ > > #!/usr/bin/env python3 > > > > # SPDX-License-Identifier: BSD-3-Clause > > -# Copyright 2022 The University of New Hampshire > > +# Copyright 2023 The University of New Hampshire > > > > import hashlib > > import sys > > @@ -36,6 +36,8 @@ class ACVPProxy: > > self.totp_path: str =3D totp_path > > self.login_data: Optional[Dict[str, Any]] =3D None > > self.session_data: Optional[Dict[str, Any]] =3D None > > + self.retries: int =3D 0 > > + self.max_retries: int =3D 2 > > > > with open(config_path, 'r') as f: > > self.config: Any =3D json.load(f) > > @@ -70,7 +72,13 @@ class ACVPProxy: > > cert=3Dself.cert, > > headers=3D{'Authorization': f'Bearer {token}'} > > ) > > - if not response.ok: > > + if response.status_code =3D=3D 401: > > + if self.__renew_jwt(): > > + token =3D self.session_data['jwt'] > > + continue > > + logging.error("Failed to renew expired jwt") > > + return None > > + elif not response.ok: > > logging.error(f'Failed to fetch vector set {url}') > > logging.error(json.dumps(response.json(), indent=3D4)) > > return None > > @@ -85,6 +93,35 @@ class ACVPProxy: > > logging.info(f'Downloaded vector set {url}') > > return vector_set_json > > > > + def __renew_jwt(self) -> bool: > > + """Renews the jwt in session_data. > > + > > + JWTs provided by the NIST API last 30 minutes which can cause > this > > + script to fail even with good data. This method renews the jwt > using > > + the login endpoint. > > + > > + @return: True if successfully renewed token > > + """ > > + if self.retries >=3D self.max_retries: > > + logging.error("Maximum number of jwt renewals has been > reached.") > > + return False > > + response =3D requests.post( > > + url=3Df'{self.config["url"]}/acvp/v1/login', > > + json=3D[ > > + {'acvVersion': '1.0'}, > > + { > > + 'password': self.__get_totp(), > > + 'accessToken': self.session_data["jwt"] > > + } > > + ], > > + cert=3Dself.cert, > > + ) > > + if response.ok: > > + self.retries +=3D 1 > > + self.session_data["jwt"] =3D > response.json()[1].pop("accessToken") > > + return True > > + return False > > + > > def login(self) -> bool: > > """Log into the API server. > > > > @@ -178,6 +215,12 @@ class ACVPProxy: > > 'Authorization': f'Bearer > {self.session_data["jwt"]}' > > } > > ) > > + if result.status_code =3D=3D 401: > > + if self.__renew_jwt(): > > + write_data[0]["jwt"] =3D self.session_data["jw= t"] > > + continue > > + logging.error("Failed to renew jwt") > > + return None > > version, result_json =3D result.json() > > if 'retry' in result_json: > > duration =3D result_json['retry'] > > @@ -208,7 +251,19 @@ class ACVPProxy: > > headers=3D{'Authorization': f'Bearer > {self.session_data["jwt"]}'} > > ) > > > > - if not response.ok: > > + if response.status_code =3D=3D 401: > > + if self.__renew_jwt(): > > + response =3D requests.post( > > + f'{self.config["url"]}{session_url}/vectorSets= /' > > + f'{vector_set["vsId"]}/results', > > + json=3D[version, vector_set], > > + cert=3Dself.cert, > > + headers=3D{'Authorization': f'Bearer > {self.session_data["jwt"]}'} > > + ) > > + else: > > + logging.error("Failed to renew jwt") > > + return False > > + elif not response.ok: > > has_error =3D True > > logging.error(f'Could not upload vector set response > for ' > > f'vector set ID {vector_set["vsId"]}.') > > @@ -239,13 +294,13 @@ def main(request_path: Optional[str], > > config_path=3Dconfig_path, > > ) > > > > - logging.info('Attempting to log in...') > > - if not proxy.login(): > > - logging.error('Could not log in.') > > - sys.exit(1) > > - logging.info('Successfully logged in.') > > > > if request_path: > > + logging.info('Attempting to log in...') > > + if not proxy.login(): > > + logging.error('Could not log in.') > > + sys.exit(1) > > + logging.info('Successfully logged in.') > > logging.info('Creating a new test session and downloading > vectors...') > > test_session =3D proxy.register() > > if not test_session: > > --000000000000c8a63505ff1fd892 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


<= div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jun 27, 2023 at 12:19=E2=80=AF= PM Aaron Conole <aconole@redhat.co= m> wrote:
jspewock@iol.unh= .edu writes:

> From: Jeremy Spewock <jspewock@iol.unh.edu>
>
> Adds a method that follows the process for renewing your jwt according=
> to NIST API documentation. This way, if there are load issues and it > takes too long to get vectors back with multi-algorithm testing, the > script will always handle the jwt expiring.
>
> Also added a maximum number of renewals so that the script cannot run<= br> > infinitely.
>
> Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> ---

Hi Jeremy,

Thanks for the changes, it is much easier to follow now.

I ran this through 'black' and it did flag a few of your changes, b= ut
I don't think it is an issue here because they are single quote
vs. double quote usage, and the usage you have is consistent with the
rest of the file.

>=C2=A0 tools/acvp/acvp_tool.py | 71 +++++++++++++++++++++++++++++++++++= +-----
>=C2=A0 1 file changed, 63 insertions(+), 8 deletions(-)
>=C2=A0 mode change 100755 =3D> 100644 tools/acvp/acvp_tool.py

Was this mode change intentional?=C2=A0 I guess it must not be since the README advocates usage as:

=C2=A0 =C2=A0acvp_tool.py --request $DOWNLOAD_PATH

I can fix on apply if you confirm.

Great catch= , you're right, this was not something I meant to change. I noticed the= re was a conflict with file modes when I was creating and testing the patch= and I thought I fixed it to be the right one before submitting but I suppo= se I did it in reverse.

if you could fix it what would be appr= eciated, thank you.


> diff --git a/tools/acvp/acvp_tool.py b/tools/acvp/acvp_tool.py
> old mode 100755
> new mode 100644
> index 40d2f2f..a28760d
> --- a/tools/acvp/acvp_tool.py
> +++ b/tools/acvp/acvp_tool.py
> @@ -1,7 +1,7 @@
>=C2=A0 #!/usr/bin/env python3
>=C2=A0
>=C2=A0 # SPDX-License-Identifier: BSD-3-Clause
> -# Copyright 2022 The University of New Hampshire
> +# Copyright 2023 The University of New Hampshire
>=C2=A0
>=C2=A0 import hashlib
>=C2=A0 import sys
> @@ -36,6 +36,8 @@ class ACVPProxy:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.totp_path: str =3D totp_path >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.login_data: Optional[Dict[str, = Any]] =3D None
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.session_data: Optional[Dict[str= , Any]] =3D None
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.retries: int =3D 0
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.max_retries: int =3D 2
>=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 with open(config_path, 'r') = as f:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.config: Any =3D j= son.load(f)
> @@ -70,7 +72,13 @@ class ACVPProxy:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cert=3Ds= elf.cert,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 headers= =3D{'Authorization': f'Bearer {token}'}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not response.ok:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if response.status_code =3D= =3D 401:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if self.__ren= ew_jwt():
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= token =3D self.session_data['jwt']
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= continue
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.error= ("Failed to renew expired jwt")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return None > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elif not response.ok:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.= error(f'Failed to fetch vector set {url}')
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.= error(json.dumps(response.json(), indent=3D4))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return N= one
> @@ -85,6 +93,35 @@ class ACVPProxy:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.info(f'Downl= oaded vector set {url}')
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return vector_set_json=
>=C2=A0
> +=C2=A0 =C2=A0 def __renew_jwt(self) -> bool:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Renews the jwt in sessi= on_data.
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 JWTs provided by the NIST API last 30 min= utes which can cause this
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 script to fail even with good data. This = method renews the jwt using
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 the login endpoint.
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 @return: True if successfully renewed tok= en
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if self.retries >=3D self.max_retries:=
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.error("Maximum= number of jwt renewals has been reached.")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return False
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 response =3D requests.post(
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 url=3Df'{self.config[&q= uot;url"]}/acvp/v1/login',
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 json=3D[
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {'acvVers= ion': '1.0'},
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'password= ': self.__get_totp(),
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'accessTo= ken': self.session_data["jwt"]
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ],
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cert=3Dself.cert,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 )
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if response.ok:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.retries +=3D 1
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.session_data["jwt= "] =3D response.json()[1].pop("accessToken")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return True
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 return False
> +
>=C2=A0 =C2=A0 =C2=A0 def login(self) -> bool:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """Log into the API s= erver.
>=C2=A0
> @@ -178,6 +215,12 @@ class ACVPProxy:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 'Authorization': f'Bearer {self.session_da= ta["jwt"]}'
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if result.sta= tus_code =3D=3D 401:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= if self.__renew_jwt():
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 write_data[0]["jwt"] =3D self.session_data["j= wt"]
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 continue
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= logging.error("Failed to renew jwt")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= return None
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 version,= result_json =3D result.json()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if '= retry' in result_json:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 duration =3D result_json['retry']
> @@ -208,7 +251,19 @@ class ACVPProxy:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 headers= =3D{'Authorization': f'Bearer {self.session_data["jwt"= ;]}'}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
>=C2=A0
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not response.ok:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if response.status_code =3D= =3D 401:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if self.__ren= ew_jwt():
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= response =3D requests.post(
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 f'{self.config["url"]}{session_url}/vectorSets= /'
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 f'{vector_set["vsId"]}/results',
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 json=3D[version, vector_set],
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 cert=3Dself.cert,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 headers=3D{'Authorization': f'Bearer {self.sessi= on_data["jwt"]}'}
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= )
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= logging.error("Failed to renew jwt")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= return False
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elif not response.ok:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 has_erro= r =3D True
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.= error(f'Could not upload vector set response for '
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f'vector set ID {vector_set[&= quot;vsId"]}.')
> @@ -239,13 +294,13 @@ def main(request_path: Optional[str],
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 config_path=3Dconfig_path,
>=C2=A0 =C2=A0 =C2=A0 )
>=C2=A0
> -=C2=A0 =C2=A0 logging.info('Attempting to log in...')
> -=C2=A0 =C2=A0 if not proxy.login():
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.error('Could not log in.'= )
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 sys.exit(1)
> -=C2=A0 =C2=A0 logging.info('Successfully logged in.')
>=C2=A0
>=C2=A0 =C2=A0 =C2=A0 if request_path:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.info('Attempting to log in...&#= 39;)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if not proxy.login():
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.error('Could no= t log in.')
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sys.exit(1)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.info('Successfully logged in.&#= 39;)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.info('Creating a new test= session and downloading vectors...')
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 test_session =3D proxy.register() >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not test_session:

--000000000000c8a63505ff1fd892--