8000 Revert "Adds HTTP integration URIs" · codeperl/localstack@ca22507 · GitHub
[go: up one dir, main page]

Skip to content

Commit ca22507

Browse files
committed
Revert "Adds HTTP integration URIs"
This reverts commit c239fc0.
1 parent c239fc0 commit ca22507

File tree

3 files changed

+2
-54
lines changed

3 files changed

+2
-54
lines changed

localstack/services/apigateway/integration.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -648,21 +648,8 @@ def invoke(self, invocation_context: ApiInvocationContext):
648648
if isinstance(payload, dict):
649649
payload = json.dumps(payload)
650650

651-
# https://docs.aws.amazon.com/apigateway/latest/developerguide/aws-api-gateway-stage-variables-reference.html
652-
# HTTP integration URIs
653-
#
654-
# A stage variable can be used as part of an HTTP integration URL, as shown in the following examples:
655-
#
656-
# A full URI without protocol – http://${stageVariables.<variable_name>}
657-
# A full domain – http://${stageVariables.<variable_name>}/resource/operation
658-
# A subdomain – http://${stageVariables.<variable_name>}.example.com/resource/operation
659-
# A path – http://example.com/${stageVariables.<variable_name>}/bar
660-
# A query string – http://example.com/foo?q=${stageVariables.<variable_name>}
661-
render_vars = {"stageVariables": invocation_context.stage_variables}
662-
rendered_uri = VtlTemplate().render_vtl(uri, render_vars)
663-
664651
uri = apply_request_parameters(
665-
rendered_uri,
652+
uri,
666653
integration=integration,
667654
path_params=path_params,
668655
query_params=query_string_params,

tests/integration/apigateway/test_apigateway_import.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
OAS_30_CIRCULAR_REF_WITH_REQUEST_BODY = os.path.join(
4444
PARENT_DIR, "files", "openapi.spec.circular-ref-with-request-body.json"
4545
)
46-
OAS_30_STAG F479 E_VARIABLES = os.path.join(PARENT_DIR, "files", "openapi.spec.stage-variables.json")
46+
4747
TEST_LAMBDA_PYTHON_ECHO = os.path.join(PARENT_DIR, "awslambda/functions/lambda_echo.py")
4848

4949

@@ -722,23 +722,3 @@ def test_import_with_circular_models_and_request_validation(
722722
request = requests.post(url, json=wrong_request_schema)
723723
assert request.status_code == 400
724724
assert request.json().get("message") == "Invalid request body"
725-
726-
def test_import_with_stage_variables(self, import_apigw, aws_client, echo_http_server):
727-
728-
spec_file = load_file(OAS_30_STAGE_VARIABLES)
729-
import_resp, root_id = import_apigw(body=spec_file, failOnWarnings=True)
730-
rest_api_id = import_resp["id"]
731-
732-
response = aws_client.apigateway.create_deployment(restApiId=rest_api_id)
733-
734-
aws_client.apigateway.create_stage(
735-
restApiId=rest_api_id,
736-
stageName="v1",
737-
variables={"foo": echo_http_server},
738-
deploymentId=response["id"],
739-
)
740-
741-
url = api_invoke_url(api_id=rest_api_id, stage="v1", path="/path1")
742-
response = requests.get(url)
743-
744-
assert response.ok

tests/integration/files/openapi.spec.stage-variables.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0