mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 22:27:48 +00:00
It needs to have api prefix otherwise nginx won't even route it to the backend
This commit is contained in:
@@ -15,6 +15,7 @@ from josepy import JSONObjectWithFields
|
|||||||
|
|
||||||
ACC_KEY_BITS = 2048
|
ACC_KEY_BITS = 2048
|
||||||
ACC_KEY_PUBLIC_EXPONENT = 65537
|
ACC_KEY_PUBLIC_EXPONENT = 65537
|
||||||
|
NOCK_API_PREFIX = "/api/__bdd_nock__"
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
faker = Faker()
|
faker = Faker()
|
||||||
|
|
||||||
@@ -265,7 +266,7 @@ def x509_cert_to_dict(cert: x509.Certificate) -> dict:
|
|||||||
def define_nock(context: Context, definitions: list[dict]):
|
def define_nock(context: Context, definitions: list[dict]):
|
||||||
jwt_token = context.vars["AUTH_TOKEN"]
|
jwt_token = context.vars["AUTH_TOKEN"]
|
||||||
response = context.http_client.post(
|
response = context.http_client.post(
|
||||||
"/api/v1/bdd-nock/define",
|
f"/{NOCK_API_PREFIX}/define",
|
||||||
headers=dict(authorization="Bearer {}".format(jwt_token)),
|
headers=dict(authorization="Bearer {}".format(jwt_token)),
|
||||||
json=dict(definitions=definitions),
|
json=dict(definitions=definitions),
|
||||||
)
|
)
|
||||||
@@ -275,7 +276,7 @@ def define_nock(context: Context, definitions: list[dict]):
|
|||||||
def restore_nock(context: Context):
|
def restore_nock(context: Context):
|
||||||
jwt_token = context.vars["AUTH_TOKEN"]
|
jwt_token = context.vars["AUTH_TOKEN"]
|
||||||
response = context.http_client.post(
|
response = context.http_client.post(
|
||||||
"/api/v1/bdd-nock/restore",
|
f"{NOCK_API_PREFIX}/restore",
|
||||||
headers=dict(authorization="Bearer {}".format(jwt_token)),
|
headers=dict(authorization="Bearer {}".format(jwt_token)),
|
||||||
json=dict(),
|
json=dict(),
|
||||||
)
|
)
|
||||||
@@ -285,7 +286,7 @@ def restore_nock(context: Context):
|
|||||||
def clean_all_nock(context: Context):
|
def clean_all_nock(context: Context):
|
||||||
jwt_token = context.vars["AUTH_TOKEN"]
|
jwt_token = context.vars["AUTH_TOKEN"]
|
||||||
response = context.http_client.post(
|
response = context.http_client.post(
|
||||||
"/api/v1/bdd-nock/clean-all",
|
f"{NOCK_API_PREFIX}/clean-all",
|
||||||
headers=dict(authorization="Bearer {}".format(jwt_token)),
|
headers=dict(authorization="Bearer {}".format(jwt_token)),
|
||||||
json=dict(),
|
json=dict(),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2702,7 +2702,7 @@ export const registerRoutes = async (
|
|||||||
// Note: This is a special route for BDD tests. It's only available in development mode and only for BDD tests.
|
// Note: This is a special route for BDD tests. It's only available in development mode and only for BDD tests.
|
||||||
// This route should NEVER BE ENABLED IN PRODUCTION!
|
// This route should NEVER BE ENABLED IN PRODUCTION!
|
||||||
if (getConfig().isBddNockApiEnabled) {
|
if (getConfig().isBddNockApiEnabled) {
|
||||||
await server.register(registerBddNockRouter, { prefix: "/bdd-nock" });
|
await server.register(registerBddNockRouter, { prefix: "/api/__bdd_nock__" });
|
||||||
}
|
}
|
||||||
|
|
||||||
server.addHook("onClose", async () => {
|
server.addHook("onClose", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user