Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

fix(crd): AgentRuntime.spec.auth.outbound[].destination.hostRegex should be documented as glob, not regex

Đang mở Phù hợp với người mới
#520 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
65/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, kubernetes
Lĩnh vực
devops, documentation

Hướng nghiên cứu

Xác định kiểu CRD AgentRuntime và tài liệu về trường hostRegex của nó, sau đó đọc authbridge/authlib/routing/router.go và cảnh báo trong PR #517 để xác nhận cú pháp glob. Xác định xem nên lập tài liệu cho hostRegex ngay tại chỗ hay sử dụng đề xuất ngừng dùng và đổi tên, rồi cập nhật phần mô tả bị ảnh hưởng và các ví dụ để CRD phản ánh rõ ràng cú pháp được hỗ trợ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

The AgentRuntime CRD field spec.auth.outbound[].destination.hostRegex is documented as accepting regex patterns, but AuthBridge's routing engine expects glob patterns.

Current CRD documentation:

// HostRegex is a regex pattern to match hostnames.
// Example: ".*\\.team1\\.svc\\.cluster\\.local"

AuthBridge reality:

// authbridge/authlib/routing/router.go
g, err := glob.Compile(r.Host, '.')  // Uses github.com/gobwas/glob, not regexp

Users who follow the CRD documentation and provide regex syntax (e.g., .*\.team1\.svc\.cluster\.local) will get routes that don't match because glob syntax is different from regex.

Impact

  • Silent mismatch: Routes silently fail to match because regex metacharacters are interpreted as literal characters in glob matching
  • Wrong examples: The CRD example shows regex syntax that won't work
  • Confusing field name: hostRegex implies regex when it should be glob

Proposed Solution

Option A: Rename field + deprecate (breaking change)
// HostGlob is a glob pattern to match hostnames.
// Supports * (any chars) and ? (single char).
// Example: "*.team1.svc.cluster.local"
HostGlob string `json:"hostGlob,omitempty"`

// HostRegex is deprecated - use HostGlob instead.
// This field was misnamed; it expects glob syntax, not regex.
// +deprecated
HostRegex string `json:"hostRegex,omitempty"`
Option B: Fix documentation only (non-breaking)
// HostRegex is a glob pattern to match hostnames (name is misleading).
// Supports * (any chars) and ? (single char), NOT regex syntax.
// Example: "*.team1.svc.cluster.local"
HostRegex string `json:"hostRegex,omitempty"`

Workaround

PR #517 added a warning log when hostRegex is used:

mutatorLog.Info("hostRegex field is mapped to AuthBridge glob pattern (not regex)",
    "note", "use glob syntax like '*.team1.svc.cluster.local', not regex")

This helps users discover the issue but doesn't fix the root cause.

Related

  • PR #517 discovered this while implementing routes generation
  • No examples currently use hostRegex (all use exact host matches)
  • AuthBridge glob implementation: https://github.com/gobwas/glob

/cc @alantech

Ngôn ngữ chính
Go
Star
19
Fork
50
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rossoctl/operator

Tất cả issue của rossoctl/operator

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.