Skip to content

feat: Add Rust Plugins - Set/re-set cookies - #308

Open
victorwoli wants to merge 18 commits into
GoogleCloudPlatform:mainfrom
victorwoli:set-reset-cookies-rust
Open

feat: Add Rust Plugins - Set/re-set cookies#308
victorwoli wants to merge 18 commits into
GoogleCloudPlatform:mainfrom
victorwoli:set-reset-cookies-rust

Conversation

@victorwoli

Copy link
Copy Markdown
Contributor

This plugin lets you set, reset, or delete a domain cookie before the request reaches the Cloud/Media CDN cache. You can create session cookies or time-based cookies using Apache log format. If a cookie already exists from the origin, the plugin can overwrite it or remove the set-cookie header entirely.

@victorwoli
victorwoli requested a review from a team as a code owner January 21, 2026 17:15
@snippet-bot

snippet-bot Bot commented Jan 21, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@victorwoli victorwoli changed the title feat: Add rUST Plugins - Set/re-set cookies feat: Add Rust Plugins - Set/re-set cookies Jan 21, 2026
Comment thread plugins/samples/set_reset_cookie/plugin.rs Outdated
Comment thread plugins/samples/set_reset_cookie/plugin.rs Outdated
@mpwarres mpwarres self-assigned this Jan 28, 2026
@mpwarres

Copy link
Copy Markdown
Collaborator

There look to be some compilation errors, e.g.:

error: environment variable `OUT_DIR` not defined at compile time
  --> samples/set_reset_cookie/plugin.rs:21:18
   |
21 | include!(concat!(env!("OUT_DIR"), "/cookie_config.rs"));
   |                  ^^^^^^^^^^^^^^^
   |
   = help: Cargo sets build script variables at run time. Use `std::env::var("OUT_DIR")` instead
   = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `protobuf`
   --> samples/set_reset_cookie/plugin.rs:292:5
    |
292 |     protobuf::text_format::parse_from_str(text).map_err(|e| e.to_string())
    |     ^^^^^^^^ use of undeclared crate or module `protobuf`

error[E0412]: cannot find type `CookieConfig` in this scope
  --> samples/set_reset_cookie/plugin.rs:32:25
   |
32 |     cookie_configs: Vec<CookieConfig>,
   |                         ^^^^^^^^^^^^ not found in this scope
   |
help: you might be missing a type parameter
   |
31 | struct CookieManagerRootContext<CookieConfig> {
   |                                ++++++++++++++

error[E0412]: cannot find type `CookieManagerConfig` in this scope
  --> samples/set_reset_cookie/plugin.rs:61:21
   |
61 |         let config: CookieManagerConfig = match parse_text_proto(&config_string) {
   |                     ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `CookieConfig` in this scope
   --> samples/set_reset_cookie/plugin.rs:135:25
    |
135 |     cookie_configs: Vec<CookieConfig>,
    |                         ^^^^^^^^^^^^ not found in this scope
    |
help: you might be missing a type parameter

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