Repository navigation
Conversation
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
| continue | ||
| } | ||
| value := field.GetSecretContentType() | ||
| if !field.GetIsSecret() || len(value) > 128 || !secretContentTypePattern.MatchString(value) { |
There was a problem hiding this comment.
🟡 Suggestion (medium confidence): an action with one typed secret return plus any other secret return passes registration, but validateTypedOutputContext then fails every invocation with "requires exactly one secret return" (see the test at secret_content_type_test.go:183). Since registration already rejects other invalid declarations, it could reject this one too, so the connector author sees the error at startup rather than on the first production call.
Superseded — see the current review report for commit
|
There was a problem hiding this comment.
No blocking issues found — see the full review report
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
Superseded — see the current review report for commit
|
There was a problem hiding this comment.
No blocking issues found — see the full review report
Rewrite the scenario if-else chain as a switch (gocritic ifElseChain) and scope a nolint:gosec to the fixture marshal at the G117 finding. The password value is a constant fixture payload that must survive encryption; the test pins its exact bytes, so the JSON key stays realistic. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
Superseded — see the current review report for commit
|
There was a problem hiding this comment.
No blocking issues found — see the full review report
| bool is_secret = 7; | ||
| // Secret action return content type. Absent means generic; not valid on | ||
| // configuration fields, action arguments, or public returns. | ||
| optional string secret_content_type = 8 [(validate.rules).string = { |
There was a problem hiding this comment.
Why not make this content_type? There are probably non-secret fields that we'd like to hint at the content.
Also can a field have multiple possible content types? eg: Could an action return YAML or JSON depending on some configuration?
Brings the released dotc1z/sqlite package and version bump into the typed secret output declaration branch. No conflicts; declaration and guard sources are unchanged. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
| for _, field := range schema.GetReturnTypes() { | ||
| if !field.HasSecretContentType() { | ||
| continue | ||
| } | ||
| value := field.GetSecretContentType() | ||
| if !field.GetIsSecret() || len(value) > 128 || !secretContentTypePattern.MatchString(value) { | ||
| return errors.New("secret action return content type is invalid") | ||
| } | ||
| } | ||
| return nil |
There was a problem hiding this comment.
🟡 Suggestion (medium confidence): Each return field is validated on its own here. A schema with one typed secret return plus another secret return therefore registers successfully. It then fails on every invocation at validateTypedOutputContext ("requires exactly one secret return", line 62). Rejecting that shape here would show the mistake when the connector starts, not on the first call.
Superseded — see the current review report for commit
|
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
Superseded — see the current review report for commit
|
There was a problem hiding this comment.
No blocking issues found — see the full review report
Content_type is an optional mime content type on fields. It's only relevant for StringField, StringSliceField, and StringMapField. Tags are used to classify fields. eg: If a connector action returns an encrypted field that is a credential for multipass, the tags could be, "credential", "multipass", & "api_key_v2".
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
| return true, err | ||
| } | ||
|
|
||
| if err := rejectLegacyFieldJSON(b, msg.ProtoReflect().Descriptor()); err != nil { |
There was a problem hiding this comment.
🟡 Suggestion (medium confidence): This pre-scan now runs on every legacy-JSON request and response, before the protojson fast path. Each nested message object gets re-decoded into a map, so the cost grows with payload size × nesting depth, and large List* responses pay it on the default path. It contradicts the doc comment above ("The fast path is a plain protojson unmarshal").
It also guards a field that main never shipped: field 8 doesn't exist at the base, and DiscardUnknown would drop it anyway. Consider removing the scan, or running it only after protojson fails, and updating the comment to match.
Superseded — see the current review report for commit
|
There was a problem hiding this comment.
No blocking issues found — see the full review report
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
Superseded — see the current review report for commit
|
There was a problem hiding this comment.
No blocking issues found — see the full review report
Keep the accepted tag rules and retain the upstream MIME comment. Generated files retain the pre-generation baseline for the following regeneration commit. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
| return true, err | ||
| } | ||
|
|
||
| if err := rejectLegacyFieldJSON(b, msg.ProtoReflect().Descriptor()); err != nil { |
There was a problem hiding this comment.
🟡 Suggestion (medium confidence): rejectLegacyFieldJSON now runs on every legacy (non-wire-frame) payload before protojson. It decodes the document with encoding/json and re-decodes each nested subtree, so cost scales with payload size × depth. That contradicts the comment at lines 41-44 ("the fast path is a plain protojson unmarshal"). It also guards secret_content_type, a field main never shipped. Consider dropping the guard, or gating it, and updating the comment.
|
|
||
| | Criterion | Executable artifact and assertion | Status | | ||
| | --- | --- | --- | | ||
| | Declaration presence and schema round-trip | TestSecretContentTypeSchemaRoundTrip, binary/JSON equality and HasSecretContentType absent/present; explicit empty ValidateAll refusal | Verified to stated coverage | |
There was a problem hiding this comment.
🟡 Suggestion: This ledger (and plan.md change order 1) still describes HasSecretContentType and config.Field.secret_content_type=8, and it cites pre-squash commit hashes. None of those exist in this PR. The current design is content_type (8) plus a multipass-type- entry in tags (9), resolved by crypto.ResolveFieldOutput. Please update these references or remove them.
| not select a type. The earlier prototype used Field 8 for a bare logical type; | ||
| that encoding is incompatible and valid bare values are rejected. JSON using | ||
| `secret_content_type` on a Field is also rejected by the legacy transport. | ||
| Native `request_schema` and descriptor `secret_content_type` remain readable; |
There was a problem hiding this comment.
🟡 Suggestion: This says native request_schema and descriptor secret_content_type "remain readable", and that new and legacy declarations must agree. Neither surface exists in this PR. A reader would expect a compatibility path that doesn't exist, so please remove the claim or move it to the PR that adds those surfaces (#1195).
General PR Review: Declare typed secret action outputs before producer executionBlocking Issues: 0 | Suggestions: 3 | Threads Resolved: 0 Review SummaryThe PR adds two fields to
Schemas are now cloned on registration, in I scanned the full diff for security and correctness and found no blocking issues. The AAD parser rejects duplicate and escaped-duplicate keys, trailing data, and oversize input. The guard runs after Criteria:
Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agentsReviewed commit: |
There was a problem hiding this comment.
No blocking issues found — see the full review report
Squire (openai/gpt-6.1-sol):
Let connectors declare a secret output's content type before producer execution. Existing generic declarations remain compatible. Registration snapshots the declaration and refuses incompatible typed-output cardinality; generic/legacy multi-secret and typed-singleton-plus-public-result cases remain supported.
For explicitly typed output, the existing full-knowledge recipient context must agree before action allocation or handler invocation. Result metadata cannot override the snapshotted declaration. These checks bind delivery identity and encryption context; they do not validate payload JSON fields or a Multipass schema.
Review this bottom layer first, then #1194 for simple credential JSON builders and #1195 for native request inputs and output binding. The native tip is the single combined C1 dependency. No Multipass contract-export PR or copied schema bundle is required.
This output-layer source is unchanged by the builder simplification. Its existing registration, snapshot, context, encryption/opening and generic compatibility results retain their original revision attribution. New builder/native tests and compatibility checks are recorded on the successor PRs. Historical broader normal/race/build/vet checks and the unrelated local uhttp lint baseline remain attributed to their original revisions; no baseline waiver is implied.
Published history is preserved through forward merges. No merge, SDK release, deployment, live provider or permission expansion is claimed.