mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 04:26:33 +00:00
Implement EAB verification
This commit is contained in:
@@ -220,9 +220,20 @@ def step_impl(context: Context):
|
|||||||
"I register a new ACME account with email {email} and EAB key id {kid} with secret {secret} as {account_var}"
|
"I register a new ACME account with email {email} and EAB key id {kid} with secret {secret} as {account_var}"
|
||||||
)
|
)
|
||||||
def step_impl(context: Context, email: str, kid: str, secret: str, account_var: str):
|
def step_impl(context: Context, email: str, kid: str, secret: str, account_var: str):
|
||||||
# TODO: add EAB info here
|
acme_client = context.acme_client
|
||||||
registration = messages.NewRegistration.from_data(email=email)
|
account_public_key = acme_client.net.key.public_key()
|
||||||
context.vars[account_var] = context.acme_client.new_account(registration)
|
eab = messages.ExternalAccountBinding.from_data(
|
||||||
|
account_public_key=account_public_key,
|
||||||
|
kid=kid,
|
||||||
|
hmac_key=secret,
|
||||||
|
directory=acme_client.directory,
|
||||||
|
hmac_alg="HS256",
|
||||||
|
)
|
||||||
|
registration = messages.NewRegistration.from_data(
|
||||||
|
email=email,
|
||||||
|
external_account_binding=eab,
|
||||||
|
)
|
||||||
|
context.vars[account_var] = acme_client.new_account(registration)
|
||||||
|
|
||||||
|
|
||||||
@then(
|
@then(
|
||||||
|
|||||||
Reference in New Issue
Block a user