Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions assets/components/openshift-router/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ spec:
value: '{{ .RouterCiphers }}'
- name: ROUTER_CIPHERSUITES
value: '{{ .RouterCiphersSuites }}'
{{- if .RouterCurves }}
- name: ROUTER_CURVES
value: '{{ .RouterCurves }}'
{{- end }}
- name: ROUTER_DISABLE_HTTP2
value: '{{ .RouterDisableHttp2 }}'
- name: ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK
Expand Down
32 changes: 25 additions & 7 deletions cmd/generate-config/config/config-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -738,19 +738,37 @@
"type": "object",
"properties": {
"custom": {
"description": "custom is a user-defined TLS security profile. Be extremely careful using a custom\nprofile as invalid configurations can be catastrophic. An example custom profile\nlooks like this:\n\n ciphers:\n\n - ECDHE-ECDSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-AES128-GCM-SHA256\n\n - ECDHE-ECDSA-AES128-GCM-SHA256\n\n minTLSVersion: VersionTLS11",
"description": "custom is a user-defined TLS security profile. Be extremely careful using a custom\nprofile as invalid configurations can be catastrophic.\n\nThe curve list for this profile is empty by default.\n\nAn example custom profile looks like this:\n\n minTLSVersion: VersionTLS11\n ciphers:\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256",
"type": "object",
"properties": {
"ciphers": {
"description": "ciphers is used to specify the cipher algorithms that are negotiated\nduring the TLS handshake. Operators may remove entries their operands\ndo not support. For example, to use DES-CBC3-SHA (yaml):\n\n ciphers:\n - DES-CBC3-SHA",
"description": "ciphers is used to specify the cipher algorithms that are negotiated\nduring the TLS handshake. Operators may remove entries that their operands\ndo not support. For example, to use only ECDHE-RSA-AES128-GCM-SHA256 (yaml):\n\n ciphers:\n - ECDHE-RSA-AES128-GCM-SHA256\n\nTLS 1.3 cipher suites (e.g. TLS_AES_128_GCM_SHA256) are not configurable\nand are always enabled when TLS 1.3 is negotiated.",
"type": "array",
"items": {
"type": "string"
},
"x-kubernetes-list-type": "atomic"
},
"curves": {
"description": "curves is an optional field used to specify the elliptic curves that are used during\nthe TLS handshake. Operators may remove entries their operands do\nnot support.\n\nWhen omitted, this means no opinion and the platform is left to choose reasonable defaults which are\nsubject to change over time and may be different per platform component depending on the underlying TLS\nlibraries they use. If specified, the list must contain at least one curve and each curve must be unique.\n\nFor example, to use X25519 and SecP256r1 (yaml):\n\n curves:\n - X25519\n - SecP256r1",
"type": "array",
"maxItems": 5,
"minItems": 1,
"items": {
"description": "TLSCurve is a named curve identifier that can be used in TLSProfile.Curves.\nThere is a one-to-one mapping between these names and the curve IDs defined\nin crypto/tls package based on IANA's \"TLS Supported Groups\" registry:\nhttps://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8",
"type": "string",
"enum": [
"X25519",
"SecP256r1",
"SecP384r1",
"SecP521r1",
"X25519MLKEM768"
]
},
"x-kubernetes-list-type": "set"
},
"minTLSVersion": {
"description": "minTLSVersion is used to specify the minimal version of the TLS protocol\nthat is negotiated during the TLS handshake. For example, to use TLS\nversions 1.1, 1.2 and 1.3 (yaml):\n\n minTLSVersion: VersionTLS11\n\nNOTE: currently the highest minTLSVersion allowed is VersionTLS12",
"description": "minTLSVersion is used to specify the minimal version of the TLS protocol\nthat is negotiated during the TLS handshake. For example, to use TLS\nversions 1.1, 1.2 and 1.3 (yaml):\n\n minTLSVersion: VersionTLS11",
"type": "string",
"enum": [
"VersionTLS10",
Expand All @@ -763,22 +781,22 @@
"nullable": true
},
"intermediate": {
"description": "intermediate is a TLS security profile based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29\n\nand looks like this (yaml):\n\n ciphers:\n\n - TLS_AES_128_GCM_SHA256\n\n - TLS_AES_256_GCM_SHA384\n\n - TLS_CHACHA20_POLY1305_SHA256\n\n - ECDHE-ECDSA-AES128-GCM-SHA256\n\n - ECDHE-RSA-AES128-GCM-SHA256\n\n - ECDHE-ECDSA-AES256-GCM-SHA384\n\n - ECDHE-RSA-AES256-GCM-SHA384\n\n - ECDHE-ECDSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-CHACHA20-POLY1305\n\n - DHE-RSA-AES128-GCM-SHA256\n\n - DHE-RSA-AES256-GCM-SHA384\n\n minTLSVersion: VersionTLS12",
"description": "intermediate is a TLS profile for use when you do not need compatibility with\nlegacy clients and want to remain highly secure while being compatible with\nmost clients currently in use.\n\nThe curve list includes by default the following curves:\nX25519, SecP256r1, SecP384r1, X25519MLKEM768.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS12\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305",
"type": "object",
"nullable": true
},
"modern": {
"description": "modern is a TLS security profile based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility\n\nand looks like this (yaml):\n\n ciphers:\n\n - TLS_AES_128_GCM_SHA256\n\n - TLS_AES_256_GCM_SHA384\n\n - TLS_CHACHA20_POLY1305_SHA256\n\n minTLSVersion: VersionTLS13",
"description": "modern is a TLS security profile for use with clients that support TLS 1.3 and\ndo not need backward compatibility for older clients.\nThe curve list includes by default the following curves:\nX25519, SecP256r1, SecP384r1, X25519MLKEM768.\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS13\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256",
"type": "object",
"nullable": true
},
"old": {
"description": "old is a TLS security profile based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility\n\nand looks like this (yaml):\n\n ciphers:\n\n - TLS_AES_128_GCM_SHA256\n\n - TLS_AES_256_GCM_SHA384\n\n - TLS_CHACHA20_POLY1305_SHA256\n\n - ECDHE-ECDSA-AES128-GCM-SHA256\n\n - ECDHE-RSA-AES128-GCM-SHA256\n\n - ECDHE-ECDSA-AES256-GCM-SHA384\n\n - ECDHE-RSA-AES256-GCM-SHA384\n\n - ECDHE-ECDSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-CHACHA20-POLY1305\n\n - DHE-RSA-AES128-GCM-SHA256\n\n - DHE-RSA-AES256-GCM-SHA384\n\n - DHE-RSA-CHACHA20-POLY1305\n\n - ECDHE-ECDSA-AES128-SHA256\n\n - ECDHE-RSA-AES128-SHA256\n\n - ECDHE-ECDSA-AES128-SHA\n\n - ECDHE-RSA-AES128-SHA\n\n - ECDHE-ECDSA-AES256-SHA384\n\n - ECDHE-RSA-AES256-SHA384\n\n - ECDHE-ECDSA-AES256-SHA\n\n - ECDHE-RSA-AES256-SHA\n\n - DHE-RSA-AES128-SHA256\n\n - DHE-RSA-AES256-SHA256\n\n - AES128-GCM-SHA256\n\n - AES256-GCM-SHA384\n\n - AES128-SHA256\n\n - AES256-SHA256\n\n - AES128-SHA\n\n - AES256-SHA\n\n - DES-CBC3-SHA\n\n minTLSVersion: VersionTLS10",
"description": "old is a TLS profile for use when services need to be accessed by very old\nclients or libraries and should be used only as a last resort.\n\nThe curve list includes by default the following curves:\nX25519, SecP256r1, SecP384r1, X25519MLKEM768.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS10\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-ECDSA-AES128-SHA256\n - ECDHE-RSA-AES128-SHA256\n - ECDHE-ECDSA-AES128-SHA\n - ECDHE-RSA-AES128-SHA\n - ECDHE-ECDSA-AES256-SHA\n - ECDHE-RSA-AES256-SHA\n - AES128-GCM-SHA256\n - AES256-GCM-SHA384\n - AES128-SHA256\n - AES128-SHA\n - AES256-SHA\n - DES-CBC3-SHA",
"type": "object",
"nullable": true
},
"type": {
"description": "type is one of Old, Intermediate, Modern or Custom. Custom provides\nthe ability to specify individual TLS security profile parameters.\nOld, Intermediate and Modern are TLS security profiles based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers\nare found to be insecure. Depending on precisely which ciphers are available to a process, the list may be\nreduced.\n\nNote that the Modern profile is currently not supported because it is not\nyet well adopted by common software libraries.",
"description": "type is one of Old, Intermediate, Modern or Custom. Custom provides the\nability to specify individual TLS security profile parameters.\n\nThe profiles are based on version 5.7 of the Mozilla Server Side TLS\nconfiguration guidelines. The cipher lists consist of the configuration's\n\"ciphersuites\" followed by the Go-specific \"ciphers\" from the guidelines.\nSee: https://ssl-config.mozilla.org/guidelines/5.7.json\n\nThe profiles are intent based, so they may change over time as new ciphers are\ndeveloped and existing ciphers are found to be insecure. Depending on\nprecisely which ciphers are available to a process, the list may be reduced.",
"type": "string",
"enum": [
"Old",
Expand Down
4 changes: 4 additions & 0 deletions deps/github.com/openshift/api-curves/.ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.24-openshift-4.22
197 changes: 197 additions & 0 deletions deps/github.com/openshift/api-curves/.claude/commands/api-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
name: api-review
description: Run strict OpenShift API review workflow for PR changes or local changes
parameters:
- name: pr_url
description: GitHub PR URL to review (optional - if not provided, reviews local changes against upstream master)
required: false
---

# Output Format Requirements
You MUST use this EXACT format for ALL review feedback:


+LineNumber: Brief description
**Current (problematic) code:**
```go
[exact code from the PR diff]
```

**Suggested change:**
```diff
- [old code line]
+ [new code line]
```

**Explanation:** [Why this change is needed]


I'll run a comprehensive API review for OpenShift API changes. This can review either a specific GitHub PR or local changes against upstream master.

## Step 1: Pre-flight checks and determine review mode

First, I'll check the arguments and determine whether to review a PR or local changes:

```bash
# Save current branch
CURRENT_BRANCH=$(git branch --show-current)
echo "📍 Current branch: $CURRENT_BRANCH"

# Check if a PR URL was provided
if [ -n "$ARGUMENTS" ] && [[ "$ARGUMENTS" =~ github\.com.*pull ]]; then
REVIEW_MODE="pr"
PR_NUMBER=$(echo "$ARGUMENTS" | grep -oE '[0-9]+$')
echo "🔍 PR review mode: Reviewing PR #$PR_NUMBER"

# For PR review, check for uncommitted changes
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "❌ ERROR: Uncommitted changes detected. Cannot proceed with PR review."
echo "Please commit or stash your changes before running the API review."
git status --porcelain
exit 1
fi
echo "✅ No uncommitted changes detected. Safe to proceed with PR review."
else
REVIEW_MODE="local"
echo "🔍 Local review mode: Reviewing local changes against upstream master"

# Find a remote pointing to openshift/api repository
OPENSHIFT_REMOTE=""
for remote in $(git remote); do
remote_url=$(git remote get-url "$remote" 2>/dev/null || echo "")
if [[ "$remote_url" =~ github\.com[/:]openshift/api(\.git)?$ ]]; then
OPENSHIFT_REMOTE="$remote"
echo "✅ Found OpenShift API remote: '$remote' -> $remote_url"
break
fi
done

# If no existing remote found, add upstream
if [ -z "$OPENSHIFT_REMOTE" ]; then
echo "⚠️ No remote pointing to openshift/api found. Adding upstream remote..."
git remote add upstream https://github.com/openshift/api.git
OPENSHIFT_REMOTE="upstream"
fi

# Fetch latest changes from the OpenShift API remote
echo "🔄 Fetching latest changes from $OPENSHIFT_REMOTE..."
git fetch "$OPENSHIFT_REMOTE" master
fi
```

## Step 2: Get changed files based on review mode

```bash
if [ "$REVIEW_MODE" = "pr" ]; then
# PR Review: Checkout the PR and get changed files
echo "🔄 Checking out PR #$PR_NUMBER..."
gh pr checkout "$PR_NUMBER"

echo "📁 Analyzing changed files in PR..."
CHANGED_FILES=$(gh pr view "$PR_NUMBER" --json files --jq '.files[].path' | grep '\.go$' | grep -E '/(v1|v1alpha1|v1beta1)/')
else
# Local Review: Get changed files compared to openshift remote master
echo "📁 Analyzing locally changed files compared to $OPENSHIFT_REMOTE/master..."
CHANGED_FILES=$(git diff --name-only "$OPENSHIFT_REMOTE/master...HEAD" | grep '\.go$' | grep -E '/(v1|v1alpha1|v1beta1)/')

# Also include staged changes
STAGED_FILES=$(git diff --cached --name-only | grep '\.go$' | grep -E '/(v1|v1alpha1|v1beta1)/' || true)
if [ -n "$STAGED_FILES" ]; then
CHANGED_FILES=$(echo -e "$CHANGED_FILES\n$STAGED_FILES" | sort -u)
fi
fi

echo "Changed API files:"
echo "$CHANGED_FILES"

if [ -z "$CHANGED_FILES" ]; then
echo "ℹ️ No API files changed. Nothing to review."
if [ "$REVIEW_MODE" = "pr" ]; then
git checkout "$CURRENT_BRANCH"
fi
exit 0
fi
```

## Step 3: Run linting checks on changes

```bash
echo "⏳ Running linting checks on changes..."
make lint

if [ $? -ne 0 ]; then
echo "❌ Linting checks failed. Please fix the issues before proceeding."
if [ "$REVIEW_MODE" = "pr" ]; then
echo "🔄 Switching back to original branch: $CURRENT_BRANCH"
git checkout "$CURRENT_BRANCH"
fi
exit 1
fi

echo "✅ Linting checks passed."
```

## Step 4: Documentation validation

For each changed API file, I'll validate:

1. **Field Documentation**: All struct fields must have documentation comments
2. **Optional Field Behavior**: Optional fields must explain what happens when they are omitted
3. **Validation Documentation**: Validation rules must be documented and match markers

Let me check each changed file for these requirements:

```thinking
I need to analyze the changed files to:
1. Find struct fields without documentation
2. Find optional fields without behavior documentation
3. Find validation annotations without corresponding documentation

For each Go file, I'll:
- Look for struct field definitions
- Check if they have preceding comment documentation
- For optional fields (those with `+kubebuilder:validation:Optional` or `+optional`), verify behavior is explained
- For fields with validation annotations, ensure the validation is documented
```

## Step 5: Generate comprehensive review report

I'll provide a comprehensive report showing:
- ✅ Files that pass all checks
- ❌ Files with documentation issues
- 📋 Specific lines that need attention
- 📚 Guidance on fixing any issues

The review will fail if any documentation requirements are not met for the changed files.

## Step 6: Switch back to original branch (PR mode only)

After completing the review, if we were reviewing a PR, I'll switch back to the original branch:

```bash
if [ "$REVIEW_MODE" = "pr" ]; then
echo "🔄 Switching back to original branch: $CURRENT_BRANCH"
git checkout "$CURRENT_BRANCH"
echo "✅ API review complete. Back on branch: $(git branch --show-current)"
else
echo "✅ Local API review complete."
fi
```

**CRITICAL WORKFLOW REQUIREMENTS:**

**For PR Review Mode:**
1. MUST check for uncommitted changes before starting
2. MUST abort if uncommitted changes are detected
3. MUST save current branch name before switching
4. MUST checkout the PR before running `make lint`
5. MUST switch back to original branch when complete
6. If any step fails, MUST attempt to switch back to original branch before exiting

**For Local Review Mode:**
1. MUST detect existing remotes pointing to openshift/api repository (supports any remote name)
2. MUST add upstream remote only if no existing openshift/api remote is found
3. MUST fetch latest changes from the detected openshift/api remote
4. MUST compare against the detected remote's master branch
5. MUST include both committed and staged changes in analysis
6. No branch switching required since we're reviewing local changes
29 changes: 29 additions & 0 deletions deps/github.com/openshift/api-curves/.coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: en-US
reviews:
profile: chill
high_level_summary: false
review_status: true
commit_status: true
collapse_walkthrough: true
changed_files_summary: false
sequence_diagrams: false
estimate_code_review_effort: false
poem: false
suggested_labels: false
path_filters:
- "!payload-manifests"
- "!**/zz_generated.crd-manifests/*" # Contains files
- "!**/zz_generated.featuregated-crd-manifests/**" # Contains folders
- "!openapi/**"
- "!**/vendor/**"
- "!vendor/**"
tools:
golangci-lint:
enabled: true
knowledge_base:
code_guidelines:
enabled: true
filePatterns:
- AGENTS.md
learnings:
scope: local
7 changes: 7 additions & 0 deletions deps/github.com/openshift/api-curves/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Set unix LF EOL for shell scripts
*.sh text eol=lf

**/zz_generated.*.go linguist-generated=true
**/types.generated.go linguist-generated=true
**/generated.pb.go linguist-generated=true
**/generated.proto linguist-generated=true
21 changes: 21 additions & 0 deletions deps/github.com/openshift/api-curves/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
.idea/
_output/
tests/bin/

models-schema
/render
/write-available-featuresets
Loading