Skip to content

Introduce -textproto flag #9

Closed
Oytrik wants to merge 1 commit into
mainfrom
f1
Closed

Introduce -textproto flag #9
Oytrik wants to merge 1 commit into
mainfrom
f1

Conversation

@Oytrik

@Oytrik Oytrik commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator

Introduce -textproto flag to allow testing string conversion into required proto.

@Oytrik Oytrik self-assigned this Sep 30, 2025
@Oytrik Oytrik requested review from TristonianJones and bansalkunal-google and removed request for bansalkunal-google September 30, 2025 10:12

@bansalkunal-google bansalkunal-google left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks fine.

Comment thread MODULE.bazel
bazel_dep(
name = "rules_proto",
version = "7.0.2",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this a random version number or have some reference to rules_proto?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That was one of the latest version of the library available
https://registry.bazel.build/modules/rules_proto

Comment thread README.md

**Example Usage:**

Assuming you have a file named `my_ruleset.txt` with content in the `VendorRulesetCollection` format:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[nit] file name: my_ruleset.textproto?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread cmd/rulescli.go
fs.StringVar(&o.file, "file", "", "File containing CEL expressions representing the Cloud Armor rule")
fs.StringVar(&o.outputFormat, "output_format", "", "output format (textproto, binarypb)")
fs.StringVar(&o.version, "version", "VCurrent", "valid versions (VCurrent, VNext)")
fs.StringVar(&o.textproto, "textproto", "", "File containing the VendorRulesetCollection ruleset textproto")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"File containing the rulesets as proto defined in VendorRulesetCollection"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread cmd/rulescli.go
return parseErr
}

verboseLog(verbose, "Successfully validated vendor ruleset")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is only a single rule.
Let's print it irrespective of verbose option.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

@Oytrik Oytrik closed this Oct 6, 2025
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