Fix find existing account

This commit is contained in:
Fang-Pen Lin
2025-11-18 09:46:40 -08:00
parent a668822e19
commit 9ae862fc1f

View File

@@ -437,13 +437,10 @@ def step_impl(context: Context, email: str, kid: str, secret: str, account_var:
@then("I find the existing ACME account without EAB as {account_var}") @then("I find the existing ACME account without EAB as {account_var}")
def step_impl(context: Context, account_var: str): def step_impl(context: Context, account_var: str):
acme_client = context.acme_client acme_client = context.acme_client
registration = messages.NewRegistration.from_data( # registration = messages.RegistrationResource.from_json(dict(uri=""))
only_return_existing=True, registration = acme_client.net.account
)
# Reset account so that it will send JWK instead of KID
acme_client.net.account = None
try: try:
context.vars[account_var] = acme_client.new_account(registration) context.vars[account_var] = acme_client.query_registration(registration)
except Exception as exp: except Exception as exp:
context.vars["error"] = exp context.vars["error"] = exp