Skip to content

Add TLS profile fields to Authorino CR - #335

Merged
philbrookes merged 1 commit into
Kuadrant:mainfrom
philbrookes:ocp5-tls-compliance
Jul 10, 2026
Merged

Add TLS profile fields to Authorino CR#335
philbrookes merged 1 commit into
Kuadrant:mainfrom
philbrookes:ocp5-tls-compliance

Conversation

@philbrookes

@philbrookes philbrookes commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

blocked by: Kuadrant/authorino#647

Summary

  • Adds tlsMinVersion and tlsCipherSuites fields to AuthorinoSpec
  • Passes values as --tls-min-version and --tls-cipher-suites CLI flags to the Authorino container
  • CRD and DeepCopy regenerated

Context

Part of OCP5 TLS profile compliance. The kuadrant-operator sets these fields on the Authorino CR after reading the cluster's TLS security profile.

Depends on: Kuadrant/authorino#647

Test plan

  • Verify new fields appear in CRD schema
  • Verify buildAuthorinoArgs() includes flags when fields are set
  • Verify flags are omitted when fields are empty

Summary by CodeRabbit

  • New Features

    • Added configurable minimum and maximum TLS versions for listener and OIDC server connections.
    • Added support for specifying permitted TLS cipher suites.
    • Configuration values are validated against supported TLS versions and applied automatically when TLS is enabled.
  • Tests

    • Added coverage for enabled, disabled, default, and customised TLS configurations.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 97fbc7aa-be0f-4281-914b-becc378a7c89

📥 Commits

Reviewing files that changed from the base of the PR and between fc51985 and e338dd0.

📒 Files selected for processing (11)
  • api/v1beta1/authorino_types.go
  • api/v1beta1/zz_generated.deepcopy.go
  • bundle/manifests/authorino-operator.clusterserviceversion.yaml
  • bundle/manifests/operator.authorino.kuadrant.io_authorinos.yaml
  • charts/authorino-operator/templates/manifests.yaml
  • config/crd/bases/operator.authorino.kuadrant.io_authorinos.yaml
  • config/deploy/manifests.yaml
  • config/install/manifests.yaml
  • pkg/reconcilers/authorino_reconciler_test.go
  • pkg/reconcilers/consts.go
  • pkg/reconcilers/deployment.go
✅ Files skipped from review due to trivial changes (3)
  • bundle/manifests/authorino-operator.clusterserviceversion.yaml
  • api/v1beta1/zz_generated.deepcopy.go
  • pkg/reconcilers/consts.go
🚧 Files skipped from review as they are similar to previous changes (7)
  • config/install/manifests.yaml
  • config/crd/bases/operator.authorino.kuadrant.io_authorinos.yaml
  • config/deploy/manifests.yaml
  • bundle/manifests/operator.authorino.kuadrant.io_authorinos.yaml
  • pkg/reconcilers/deployment.go
  • api/v1beta1/authorino_types.go
  • pkg/reconcilers/authorino_reconciler_test.go

📝 Walkthrough

Walkthrough

TLS configuration now supports optional minimum and maximum versions and cipher suites for listener and OIDC TLS settings. These values are validated in CRD schemas, copied safely, translated into deployment arguments, and covered by reconciliation tests.

Changes

TLS configuration support

Layer / File(s) Summary
API type and deepcopy support
api/v1beta1/authorino_types.go, api/v1beta1/zz_generated.deepcopy.go
Tls exposes optional version and cipher-suite fields, with deep-copy handling for the cipher-suite slice.
CRD schema and generated manifests
bundle/manifests/..., config/crd/..., config/deploy/..., config/install/..., charts/authorino-operator/templates/manifests.yaml
Listener and OIDC TLS schemas accept cipher suites and enumerated TLS versions; the CSV timestamp is updated.
Deployment flag wiring and validation
pkg/reconcilers/consts.go, pkg/reconcilers/deployment.go, pkg/reconcilers/authorino_reconciler_test.go
TLS settings are converted into listener and OIDC command-line flags, with tests covering enabled, disabled, default, and empty-field cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AuthorinoCR
  participant buildAuthorinoArgs
  participant AuthorinoProcess
  AuthorinoCR->>buildAuthorinoArgs: provide TLS versions and cipher suites
  buildAuthorinoArgs->>AuthorinoProcess: append TLS command-line flags
  AuthorinoProcess->>AuthorinoProcess: retain certificate and key flags
Loading

Suggested reviewers: guicassolato, mikenairn

Poem

A rabbit hops through TLS leaves,
With cipher suites tucked in sleeves.
Min and max versions join the dance,
Deep copies keep each field’s own space.
Flags march neatly, tests cheer bright—
Secure settings bound just right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding TLS-related fields to the Authorino custom resource.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread api/v1beta1/authorino_types.go Outdated
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.77%. Comparing base (72111de) to head (4d48b2e).

Files with missing lines Patch % Lines
pkg/reconcilers/deployment.go 0.00% 4 Missing and 2 partials ⚠️
api/v1beta1/zz_generated.deepcopy.go 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #335      +/-   ##
==========================================
- Coverage   57.20%   56.77%   -0.43%     
==========================================
  Files          13       13              
  Lines        1458     1469      +11     
==========================================
  Hits          834      834              
- Misses        529      537       +8     
- Partials       95       98       +3     
Flag Coverage Δ
unit 56.77% <0.00%> (-0.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread api/v1beta1/authorino_types.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/reconcilers/deployment.go`:
- Around line 268-296: The new TLS version and cipher suite arguments in
deployment.go are being appended even when TLS is disabled, unlike the existing
cert path/key flags. Update the argument-building logic in the deployment
reconciliation code so the listener and OIDC TLS min/max version and cipher
suite flags are only added when the same TLS enabled condition used for the cert
path flags passes. Use the existing enabled check around the deployment args
assembly and the relevant FlagTlsMinVersion, FlagTlsMaxVersion,
FlagTlsCipherSuites, FlagOidcTlsMinVersion, FlagOidcTlsMaxVersion, and
FlagOidcTlsCipherSuites symbols to keep behavior consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5d2b3fb-41f5-4728-8cba-12fa77b773e4

📥 Commits

Reviewing files that changed from the base of the PR and between 4d48b2e and 7209f7e.

📒 Files selected for processing (9)
  • api/v1beta1/authorino_types.go
  • api/v1beta1/zz_generated.deepcopy.go
  • bundle/manifests/authorino-operator.clusterserviceversion.yaml
  • bundle/manifests/operator.authorino.kuadrant.io_authorinos.yaml
  • config/crd/bases/operator.authorino.kuadrant.io_authorinos.yaml
  • config/deploy/manifests.yaml
  • config/install/manifests.yaml
  • pkg/reconcilers/consts.go
  • pkg/reconcilers/deployment.go
✅ Files skipped from review due to trivial changes (2)
  • api/v1beta1/zz_generated.deepcopy.go
  • bundle/manifests/authorino-operator.clusterserviceversion.yaml

Comment thread pkg/reconcilers/deployment.go Outdated
@maksymvavilov maksymvavilov moved this to In Review in Kuadrant Jul 9, 2026
Comment thread pkg/reconcilers/deployment.go
MaxVersion string `json:"maxVersion,omitempty"`
// TLS cipher suites (IANA names).
// +optional
CipherSuites []string `json:"cipherSuites,omitempty"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are omitempty and "" Enum trying to do opposite things?

With this, we can now have invalid CipherSuites or an odd combination of Min/Max that will crash the Authorino pod. Should we safeguard it (crd rules or operator-side check)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

omitempty means the field is omitted from JSON when empty, and "" in the Enum allows an empty string to pass validation when the field is present. They work together to allow the field to be optional.

@philbrookes
philbrookes force-pushed the ocp5-tls-compliance branch from 5b08e63 to fc51985 Compare July 9, 2026 14:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/reconcilers/authorino_reconciler_test.go (1)

87-223: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Use Ginkgo/Gomega for BDD-style tests per coding guidelines.

The coding guidelines for **/*_test.go files specify using Ginkgo/Gomega for BDD-style tests. The newly added TestBuildAuthorinoArgs and its subtests use the standard testing package with t.Run instead. Consider rewriting these as Gomega assertions within a Ginkgo Describe/Context block to comply with repository conventions.

As per coding guidelines: **/*_test.go: Use Ginkgo/Gomega for BDD style tests with envtest from controller-runtime for testing against a minimal Kubernetes API server.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/reconcilers/authorino_reconciler_test.go` around lines 87 - 223, The new
TestBuildAuthorinoArgs coverage uses the standard testing package with t.Run,
but this test file should follow the repository’s Ginkgo/Gomega BDD style.
Rewrite the scenarios around buildAuthorinoArgs, hasArg, and getArgValue into
Ginkgo Describe/Context/It blocks using Gomega expectations, preserving the same
cases for TLS disabled, enabled, nil-enabled defaults, and empty fields omitted.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/sync-authorino-manifests.yaml:
- Around line 39-42: The change check in the sync-authorino-manifests workflow
only uses git diff, so it can miss newly created untracked artifacts from the
manifest generation step. Update the Check for meaningful changes logic to also
detect untracked files, similar to the verify-manifests guard, and keep the skip
decision false when new files appear. Use the existing check step in
sync-authorino-manifests.yaml as the place to combine tracked-diff and
untracked-file detection so make manifests bundle helm-build always triggers a
PR when it produces new artifacts.

---

Nitpick comments:
In `@pkg/reconcilers/authorino_reconciler_test.go`:
- Around line 87-223: The new TestBuildAuthorinoArgs coverage uses the standard
testing package with t.Run, but this test file should follow the repository’s
Ginkgo/Gomega BDD style. Rewrite the scenarios around buildAuthorinoArgs,
hasArg, and getArgValue into Ginkgo Describe/Context/It blocks using Gomega
expectations, preserving the same cases for TLS disabled, enabled, nil-enabled
defaults, and empty fields omitted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5cab56a-13f7-4ad9-989f-5c676a5f0470

📥 Commits

Reviewing files that changed from the base of the PR and between 5b08e63 and fc51985.

📒 Files selected for processing (13)
  • .github/workflows/sync-authorino-manifests.yaml
  • api/v1beta1/authorino_types.go
  • api/v1beta1/zz_generated.deepcopy.go
  • bundle/manifests/authorino-operator.clusterserviceversion.yaml
  • bundle/manifests/authorino.kuadrant.io_authconfigs.yaml
  • bundle/manifests/operator.authorino.kuadrant.io_authorinos.yaml
  • charts/authorino-operator/templates/manifests.yaml
  • config/crd/bases/operator.authorino.kuadrant.io_authorinos.yaml
  • config/deploy/manifests.yaml
  • config/install/manifests.yaml
  • pkg/reconcilers/authorino_reconciler_test.go
  • pkg/reconcilers/consts.go
  • pkg/reconcilers/deployment.go
✅ Files skipped from review due to trivial changes (4)
  • bundle/manifests/authorino-operator.clusterserviceversion.yaml
  • api/v1beta1/zz_generated.deepcopy.go
  • config/crd/bases/operator.authorino.kuadrant.io_authorinos.yaml
  • pkg/reconcilers/consts.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • api/v1beta1/authorino_types.go
  • config/install/manifests.yaml
  • bundle/manifests/operator.authorino.kuadrant.io_authorinos.yaml
  • pkg/reconcilers/deployment.go

Comment thread .github/workflows/sync-authorino-manifests.yaml
@philbrookes
philbrookes force-pushed the ocp5-tls-compliance branch 2 times, most recently from d338855 to c06198f Compare July 10, 2026 07:36

@guicassolato guicassolato 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.

Missing the Helm charts. Can you please run make manifests bundle helm-buildhelm-build being the part to care about?

Move TLS version and cipher suite configuration into the existing
per-listener Tls struct (Listener.Tls and OIDCServer.Tls) instead of
top-level AuthorinoSpec fields. The authorino-operator translates these
into per-listener CLI flags (--tls-min-version, --oidc-tls-min-version,
etc.) only when TLS is enabled for that listener.

Includes unit tests for buildAuthorinoArgs covering TLS enabled,
disabled, nil-defaults-to-enabled, and empty-values-omitted cases.

Signed-off-by: Phil Brookes <pbrookes@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@philbrookes
philbrookes force-pushed the ocp5-tls-compliance branch from c06198f to e338dd0 Compare July 10, 2026 12:39
@philbrookes

Copy link
Copy Markdown
Contributor Author

Missing the Helm charts. Can you please run make manifests bundle helm-buildhelm-build being the part to care about?

that's done, thanks @guicassolato

@guicassolato guicassolato 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.

🏅

@philbrookes
philbrookes added this pull request to the merge queue Jul 10, 2026
Merged via the queue into Kuadrant:main with commit e6cd27e Jul 10, 2026
14 checks passed
@philbrookes
philbrookes deleted the ocp5-tls-compliance branch July 10, 2026 13:36
@github-project-automation github-project-automation Bot moved this from In Review to Done in Kuadrant Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants