Skip to content

Adding proto changes and translation logic for handling TypedProperties#2856

Merged
O-sura merged 2 commits into
mainfrom
feat/sdk-typedproperties
Jul 27, 2026
Merged

Adding proto changes and translation logic for handling TypedProperties#2856
O-sura merged 2 commits into
mainfrom
feat/sdk-typedproperties

Conversation

@O-sura

@O-sura O-sura commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Purpose

This PR adds the new TypedProperties mapping logic into python policy engine to stores additional properties which has complex structures which needs to be preserved in their original typed form (e.g. arrays or objects) preserving structure that Properties flattens to strings.

Related with:

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a9bc9508-e815-4860-bfb2-2abfdafd3ab7

📥 Commits

Reviewing files that changed from the base of the PR and between 135a77d and 503f5c9.

⛔ Files ignored due to path filters (2)
  • gateway/gateway-runtime/policy-engine/go.sum is excluded by !**/*.sum
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/proto/python_executor.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (8)
  • gateway/gateway-runtime/api/proto/python_executor.proto
  • gateway/gateway-runtime/policy-engine/go.mod
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/translator.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/translator_test.go
  • gateway/gateway-runtime/python-executor/executor/translator.py
  • gateway/gateway-runtime/python-executor/proto/python_executor_pb2.py
  • gateway/gateway-runtime/python-executor/tests/test_translator.py
  • sdk-python/src/apip_sdk_core/policy/v1alpha2/types.py

📝 Walkthrough

Walkthrough

Changes

Structured AuthContext propagation

Layer / File(s) Summary
AuthContext contract and generated schema
gateway/gateway-runtime/api/proto/python_executor.proto, sdk-python/src/.../types.py, gateway/gateway-runtime/python-executor/proto/python_executor_pb2.py
Adds typed_properties to protobuf and SDK AuthContext models and regenerates the Python protobuf descriptor.
Go AuthContext serialization and validation
gateway/gateway-runtime/policy-engine/...
Serializes structured properties, propagates nested conversion errors, and tests structured, numeric, and invalid values.
Python AuthContext deserialization and verification
gateway/gateway-runtime/python-executor/executor/translator.py, gateway/gateway-runtime/python-executor/tests/test_translator.py
Converts protobuf typed properties into Python dictionaries and verifies arrays and scalar claims.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GoSharedContext
  participant GoTranslator
  participant PythonExecutorProto
  participant PythonTranslator
  participant PythonAuthContext
  GoSharedContext->>GoTranslator: ToProtoSharedContext
  GoTranslator->>PythonExecutorProto: serialize typed_properties
  PythonExecutorProto->>PythonTranslator: provide AuthContext Struct
  PythonTranslator->>PythonAuthContext: convert Struct to dict
Loading

Possibly related PRs

Suggested reviewers: chamilaadhi, malinthaprasan, pubudu538

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only covers Purpose and omits most required template sections like Goals, Approach, tests, security, and test environment. Add the missing template sections: Goals, Approach, User stories, Documentation, Automation tests, Security checks, Samples, Related PRs, and Test environment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: proto updates and translation logic for TypedProperties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sdk-typedproperties

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

⚠️ Please verify the scope of the dependencies usage is necessary

@O-sura

O-sura commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@O-sura
O-sura merged commit b36df2e into main Jul 27, 2026
11 checks passed
@O-sura
O-sura deleted the feat/sdk-typedproperties branch July 27, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants