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 6F07142D34 for ; Fri, 23 Jun 2023 23:23:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73A5440EE4; Fri, 23 Jun 2023 23:23:28 +0200 (CEST) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 9C44540ED7 for ; Fri, 23 Jun 2023 23:23:27 +0200 (CEST) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-25eb401995aso652336a91.2 for ; Fri, 23 Jun 2023 14:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1687555406; x=1690147406; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=p2KT+xqxb0NlJaSPNmV3lu1HItEufNNnE9rRZZ/5tAA=; b=FlA70zKRvW9gdLf7Qj6bY9mjd3nAuRi76bA3xy4Dj3jwK37wj5XBkXVAEz5K0ku4eu RtLfySr7sZyOe8eM3q0zzz6ATDUqVhpYHDFq5lC5F1emB8dzAY69qV611KpRV9JPmwbh Fn0RyBq+jnqPglNfSgxmAXU1BCXFalTK+giMo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687555406; x=1690147406; 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=p2KT+xqxb0NlJaSPNmV3lu1HItEufNNnE9rRZZ/5tAA=; b=CE7gkJODUBYDIvY6m4mwvyXKsLvPlGA9qrDQdbUj3Fc60hDitNJWIqWgwwzkuU69Pf +GaYiIKEwZ8HMSgjJf43XC9/P+leWCMGKlq05QP6wVVr02aO+vMEIBRzuH3+LtbudFHz a2BCMDxYeE7h2U0vkhxJq6ZaqO6G+PHUQwbEObDn6vn6eqeyiUnVU81Ke2DSkXS0izz0 NWjUBTDOdJ0M6ixRPHJUZ+PseJAByNh94+GYRq1kYiJZjV97l2zFS+X4WrEIa89SV//k tZPa2XCUckaFgNdIeBjJ5hep6J6RGekDbbsq/j8TOIMkVDwv9Q7KHoELxSDoeYnXInkF MG8Q== X-Gm-Message-State: AC+VfDxDYJdMjR1ZNludGO2pYoKLg2+IyYjKtDsROjVq2xmhKYU7L/Pw nd+/ytdPZk2WqhdhuTR/XDztdsWxHV8sRBVgPDxr6g3iDqy/VwKk X-Google-Smtp-Source: ACHHUZ5iIPUQO/NK2BgCu8pi0/+0bDH/P1g8IAaTy4V7pPAQzemlzZWFPJM/x9IjXUykJTImAZ/hn1780QGSjvbtbqw= X-Received: by 2002:a17:90a:f0c3:b0:259:17bc:1a3c with SMTP id fa3-20020a17090af0c300b0025917bc1a3cmr15127688pjb.7.1687555406499; Fri, 23 Jun 2023 14:23:26 -0700 (PDT) MIME-Version: 1.0 References: <20230621195342.5035-2-jspewock@iol.unh.edu> In-Reply-To: From: Jeremy Spewock Date: Fri, 23 Jun 2023 17:23:15 -0400 Message-ID: Subject: Re: [PATCH v1] tools: add jwt renewal function to acvp_tool To: Aaron Conole Cc: ci@dpdk.org Content-Type: multipart/alternative; boundary="0000000000008b381005fed29c39" 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 --0000000000008b381005fed29c39 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 23, 2023 at 10:15=E2=80=AFAM 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, you ca= n > > still get restuls and the script will not error. > > > > Also, added a maximum number of renewals so that the script cannot run > > infinitely. > > > > Signed-off-by: Jeremy Spewock > > --- > > Just some nits - I haven't run this through black / flake8. > > > tools/acvp/acvp_tool.py | 73 +++++++++++++++++++++++++++++++++++------ > > 1 file changed, 63 insertions(+), 10 deletions(-) > > > > diff --git a/tools/acvp/acvp_tool.py b/tools/acvp/acvp_tool.py > > index 40d2f2f..8d50a58 100755 > > --- 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. > > > > @@ -141,7 +178,6 @@ class ACVPProxy: > > cert=3Dself.cert, > > headers=3D{'Authorization': f'Bearer > {self.login_data["jwt"]}'} > > ) > > - > > Why this line changed? > I guess this line just ended up getting removed when I was making edits. I didn't do it for any deliberate reason other than spacing when I was making edits. > > > if not response.ok: > > logging.error('Unable to register.') > > logging.error(json.dumps(response.json(), indent=3D4)) > > @@ -178,6 +214,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'] > > @@ -207,8 +249,19 @@ class ACVPProxy: > > cert=3Dself.cert, > > headers=3D{'Authorization': f'Bearer > {self.session_data["jwt"]}'} > > ) > > - > > - if not response.ok: > > You also dropped a line spacing here as well. > I think this is the same thing as above, when I was testing and writing things in a couple of places this line also disappeared just because I felt it wasn't needed, but there wasn't any particular reason. > > > + 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 +292,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: > Would it be preferred that I add these lines back so that they closer align with the original script? Thanks, Jeremy --0000000000008b381005fed29c39 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


<= div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 23, 2023 at 10:15=E2=80=AF= AM 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, you c= an
> still get restuls and the script will not error.
>
> Also, added a maximum number of renewals so that the script cannot run=
> infinitely.
>
> Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> ---

Just some nits - I haven't run this through black / flake8.

>=C2=A0 tools/acvp/acvp_tool.py | 73 +++++++++++++++++++++++++++++++++++= ------
>=C2=A0 1 file changed, 63 insertions(+), 10 deletions(-)
>
> diff --git a/tools/acvp/acvp_tool.py b/tools/acvp/acvp_tool.py
> index 40d2f2f..8d50a58 100755
> --- 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
> @@ -141,7 +178,6 @@ class ACVPProxy:
>=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 headers=3D{'Author= ization': f'Bearer {self.login_data["jwt"]}'}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
> -

Why this line changed?

I guess this line just = ended up getting removed when I was making edits. I didn't do it for an= y deliberate reason other than spacing when I was making edits.
=
=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 =C2=A0 logging.error('Una= ble to register.')
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging.error(json.dum= ps(response.json(), indent=3D4))
> @@ -178,6 +214,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']
> @@ -207,8 +249,19 @@ 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 {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 if not response.ok:

You also dropped a line spacing here as well.

= I think this is the same thing as above, when I was testing and writing thi= ngs in a couple of places this line also disappeared just because I felt it= wasn't needed, but there wasn't any particular reason.
=
=C2=A0

> +=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 +292,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:

Would it be preferred that I add these lines back so that they clo= ser align with the original script?

Thanks,
Jeremy
--0000000000008b381005fed29c39--