Skip to content

Address internal review on LA-RF-81 followup logging - #41

Merged
Liroyalima merged 6 commits into
mainfrom
LA-RF-81-followup-logging
May 19, 2026
Merged

Address internal review on LA-RF-81 followup logging#41
Liroyalima merged 6 commits into
mainfrom
LA-RF-81-followup-logging

Conversation

@Liroyalima

Copy link
Copy Markdown
Collaborator

Summary

Internal code-review follow-up on LA-RF-81-followup-logging. Closes every Critical / High / Medium finding from the internal review.

  • Critical: redact secrets in the connection-options drift log (key-aware denylist in LogValueFormatter + RedactedOrFormat wrappers in GetDriftFieldDetails / ComputeDriftFields)
  • High: DriftField constructor guard rejects secret-shaped BeforeValue / AfterValue
  • High: split LogAuth0ApiCall into LogAuth0Read / LogAuth0Write (non-nullable DriftLogContext — compile-time contract; runtime ArgumentNullException removed)
  • High: restore ArgumentException to IsProgrammerBug allowlist now that the runtime guard is gone
  • Medium: visibility asymmetry — CamelCaseJsonStringEnumConverter made public (making the enums internal hits CS0051 on protected abstract signatures)
  • Medium: new test locks reconciliationType / changeType as camelCase strings, not numbers
  • Medium: document intentional AfterValue=null on first-reconcile synthesis (selective-update consumer reads FieldPath only)
  • Medium: drop connectionId from membership drift FieldPath (bounded Datadog facet cardinality)
  • Medium: symmetric enum serialization in PatchConnectionClientsAsync failure log
  • Low: fix KubeConflictRetryDelaysMs comment regression (four attempts, not three)

Three remaining Low + three Suggestion items deferred per human review.

Test plan

  • dotnet build Alethic.Auth0.Operator.sln — 8 projects, 0 errors, 0 warnings
  • dotnet test src/Alethic.Auth0.Operator.Tests/ — 42 passed, 0 failed

🤖 Generated with Claude Code

Liroyalima and others added 3 commits May 19, 2026 10:20
H1/H3/M1/L5  : log-shape cleanup, drift-context dedup, casing
CR-5         : plumb entity namespace/name through PatchConnectionClientsAsync
CR-1         : non-429 -> ErrorApiException so the tier-1 catch fires
V3           : broaden IsProgrammerBug (KeyNotFound, IndexOutOfRange, JsonSerialization)
CR-4         : document HasPolicy(Update) caller contract

No CRD shape changes; 42/42 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Redact secrets in connection options drift log (key-aware denylist + RedactedOrFormat)
- DriftField constructor guard rejects secret-shaped Before/AfterValue
- Split LogAuth0ApiCall into LogAuth0Read / LogAuth0Write (compile-time mandatory DriftLogContext)
- Restore ArgumentException to IsProgrammerBug now that the runtime guard is gone
- Make CamelCaseJsonStringEnumConverter public (resolves visibility asymmetry)
- Lock reconciliationType/changeType as camelCase string via new unit test
- Drop connectionId from membership FieldPath; document AfterValue=null intent
- Symmetric enum serialization on PatchConnectionClientsAsync failure log
- Fix retry-budget comment regression (four attempts, not three)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Liroyalima

Copy link
Copy Markdown
Collaborator Author

@rufus, please review this pull request.

@Liroyalima Liroyalima closed this May 19, 2026
Liroyalima and others added 3 commits May 19, 2026 15:19
- Dispose first-attempt HttpRequestMessage on 401 retry
- Rename ThrowFromHttpFailureAsync → ThrowFromHttpFailure ([DoesNotReturn] void)
- Narrow IsSensitiveKey token rule; expand denylist (signing_key, client_assertion, certificate, pfx)
- Clarify KubeConflictRetryDelaysMs comment phrasing

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts ~7 LOC of post-merge cleanup that's unrelated to RF-81:
- V1TenantEntityController.cs: restore OverlayOperatorOwnedMetadata
  comment text (EventSource.reportingController footnote + labels-branch
  rationale). Behavior unchanged.
- V1ClientControllerWireModels.cs:9: drop unrelated blank line.

Category I (V1Controller _kube/_logger dedup) intentionally kept in the
MR to avoid re-introducing 8 CS0108 hidden-member warnings; it ships as
part of this MR rather than a Phase 3 follow-up.

Plan: agent-vault/projects/auth0-operator/plans/2026-05-19__15-44-05 - auth0-operator - LA-RF-81-followup-logging - MR shrink-strip analysis.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts ~40 LOC of internal-review scope creep (category G(ii)) that
adds KeyNotFoundException / IndexOutOfRangeException /
JsonSerializationException to the programmer-bug allowlist. Their
addition is a separate invariant from the High #3 review concern
(restoring ArgumentException, which stays — that's G(i), locked to
the Read/Write split contract). Pre-diff behavior is preserved:
malformed Auth0 payloads continue to requeue rather than crash-loud.
The expansion can ship as a standalone follow-up MR.

- V1Controller.cs: remove the three exception types from
  IsProgrammerBug + trim their XML doc justifications.
- V1ControllerRetryAndRequeueTests.cs: delete
  ReconcileAsync_Propagates_JsonSerializationException_AsProgrammerBug.

Plan: agent-vault/projects/auth0-operator/plans/2026-05-19__15-44-05 - auth0-operator - LA-RF-81-followup-logging - MR shrink-strip analysis.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Liroyalima Liroyalima reopened this May 19, 2026
@Liroyalima Liroyalima self-assigned this May 19, 2026
@Liroyalima
Liroyalima requested a review from orlandomuner May 19, 2026 21:42
@Liroyalima
Liroyalima enabled auto-merge (squash) May 19, 2026 21:43
@Liroyalima
Liroyalima merged commit 929f026 into main May 19, 2026
2 checks passed
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