[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add context variables and stage variables to API NG context #11111

Merged
merged 7 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
address PR comments about logging
  • Loading branch information
bentsku committed Jul 1, 2024
commit 6a1308dbee55cb0c79f2adec7d4edb4f8f5f6637
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ def parse_and_enrich(self, context: RestApiInvocationContext):
# then we can create the ContextVariables, used throughout the invocation as payload and to render authorizer
# payload, mapping templates and such.
context.context_variables = self.create_context_variables(context)
# TODO: maybe adjust the logging
LOG.debug("Initializing $context='%s'", context.context_variables)
# then populate the stage variables
context.stage_variables = self.fetch_stage_variables(context)
LOG.debug("Initializing $stageVariables='%s'", context.stage_variables)

def create_invocation_request(self, request: Request) -> InvocationRequest:
params, multi_value_params = self._get_single_and_multi_values_from_multidict(request.args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ def route_and_enrich(self, context: RestApiInvocationContext):
def update_context_variables_with_resource(
context_variables: ContextVariables, resource: Resource
):
# TODO: log updating the context_variables?
LOG.debug("Updating $context.resourcePath='%s'", resource["path"])
context_variables["resourcePath"] = resource["path"]
LOG.debug("Updating $context.resourceId='%s'", resource["id"])
context_variables["resourceId"] = resource["id"]

@staticmethod
Expand Down
Loading