fix: redact sensitive query and form logging - #389
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9edaec267
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Found one remaining gap in the credential-key matcher that can still expose query/form secrets.
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Re-reviewed the updated credential matcher across INFO completion paths, DEBUG request URLs, and URL-encoded request/response bodies. The new case-sensitive uppercase-Key branch covers camelCase key suffixes without redacting lowercase safe names such as monkey, while credentials? covers both singular and plural nested containers. Array, nested, and percent-decoded boundary handling remain consistent.
Summary
application/x-www-form-urlencodedrequest and response bodies with the existing URL-query sanitizer, preserving safe fields, duplicate parameters, and the original request body.Logger/StringIOand a framework-provided delegatedMinitest::Mock; keep the existing 943-line logging test file below the 1,000-line maintainability boundary.Castiron impact
No upstream Castiron/compiler, template, OpenAPI schema, regeneration, or companion source change is required.
I inspected Castiron's actual Ruby
render_tree_from_viewsimplementation inapi/castiron/crates/castiron-render-ruby/src/output.rs: it emits package roots/indexes, generated clients, resources, models, and resource tests, but does not emitlib/openai/internal/logging.rb. Itsresource_test_pathemitstest/pkgxyz/resources/<resource>_test.rb, not the SDK-ownedtest/openai/logging_security_test.rbadded here. The only generator-owned observability boundary is the client constructor, and its upstream companion openai/openai#1277393 is already merged. The later generated SDK update changed.castiron.stats.ymlwhile preserving this logging overlay; merged #384 independently records the same ownership analysis. This PR changes neither generated constructor signatures nor RBI/RBS declarations.Verification
accessKey, and pluralcredentials[value]review feedback.bundle exec rake typecheck:sorbet, no errors.bundle exec rake build:gem.