mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 07:27:58 +00:00
B64url
This commit is contained in:
@@ -350,15 +350,14 @@ def step_impl(context: Context, var_path: str, hostname: str):
|
|||||||
if hostname != "localhost":
|
if hostname != "localhost":
|
||||||
raise ValueError("Currently only localhost is supported")
|
raise ValueError("Currently only localhost is supported")
|
||||||
challenge = eval_var(context, var_path, as_json=False)
|
challenge = eval_var(context, var_path, as_json=False)
|
||||||
acme_challenge = challenge.chall
|
response, validation = challenge.response_and_validation(
|
||||||
response, validation = acme_challenge.response_and_validation(
|
|
||||||
context.acme_client.net.key
|
context.acme_client.net.key
|
||||||
)
|
)
|
||||||
resource = standalone.HTTP01RequestHandler.HTTP01Resource(
|
resource = standalone.HTTP01RequestHandler.HTTP01Resource(
|
||||||
chall=acme_challenge, response=response, validation=validation
|
chall=challenge, response=response, validation=validation
|
||||||
)
|
)
|
||||||
# TODO: make port configurable
|
# TODO: make port configurable
|
||||||
servers = standalone.HTTP01DualNetworkedServers(("", 8087), resource)
|
servers = standalone.HTTP01DualNetworkedServers(("0.0.0.0", 8087), resource)
|
||||||
# Start client standalone web server.
|
# Start client standalone web server.
|
||||||
web_server = threading.Thread(name="web_server", target=servers.serve_forever)
|
web_server = threading.Thread(name="web_server", target=servers.serve_forever)
|
||||||
web_server.daemon = True
|
web_server.daemon = True
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
// RFC 8555 suggests a token with at least 128 bits of entropy
|
// RFC 8555 suggests a token with at least 128 bits of entropy
|
||||||
// We are using 256 bits of entropy here, should be enough for now
|
// We are using 256 bits of entropy here, should be enough for now
|
||||||
// ref: https://datatracker.ietf.org/doc/html/rfc8555#section-11.3
|
// ref: https://datatracker.ietf.org/doc/html/rfc8555#section-11.3
|
||||||
token: crypto.randomBytes(32).toString("base64"),
|
token: crypto.randomBytes(32).toString("base64url"),
|
||||||
// TODO: read config from the profile to get the expiration time instead
|
// TODO: read config from the profile to get the expiration time instead
|
||||||
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000)
|
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user