Skip to content

cel: add url.{encode,decode} functions#1884

Open
howardjohn wants to merge 1 commit into
agentgateway:mainfrom
howardjohn:cel/url-enc-dec
Open

cel: add url.{encode,decode} functions#1884
howardjohn wants to merge 1 commit into
agentgateway:mainfrom
howardjohn:cel/url-enc-dec

Conversation

@howardjohn
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds URL percent-encoding helpers to the CEL function surface, enabling policies/logging expressions to encode/decode URL components without relying on form.encode/decode.

Changes:

  • Register new CEL functions url.encode and url.decode in agent-celx.
  • Implement URL component percent-encoding/decoding using percent-encoding.
  • Document the new functions and add unit tests.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
schema/cel-functions.md Documents url.encode / url.decode usage and semantics.
crates/celx/src/general.rs Implements and registers the new CEL URL encode/decode functions.
crates/celx/src/function_tests.rs Adds unit tests covering URL encode/decode behavior and failure cases.
crates/celx/Cargo.toml Adds percent-encoding as a dependency for agent-celx.
Cargo.lock Records the new dependency in the lockfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

const URL_COMPONENT_ENCODE_SET: &AsciiSet = &CONTROLS
.add(b' ')
Comment on lines +121 to +122
Ok(
percent_encode(v.as_bytes_pre_materialized()?, URL_COMPONENT_ENCODE_SET)
Signed-off-by: John Howard <john.howard@solo.io>
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.

2 participants