`deck gateway validate` fails with unknown field `config.client_jwk[0].false` when OIDC client_jwk contains an unquoted n key
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
Bắt đầu từ điểm vào deck gateway validate và tái hiện lỗi bằng YAML tối thiểu trong issue, tập trung vào cách các khóa client_jwk được phân tích và xác thực. Công việc được xem là hoàn tất khi n không đặt trong dấu nháy được xử lý như trường JWK thay vì bị báo cáo là false, đồng thời có một bài kiểm thử hồi quy bao quát ví dụ này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When validating a decK YAML file that contains an OpenID Connect plugin configuration with client_jwk, deck gateway validate --verbose 9 fails with the following error:
{
"code": 3,
"details": [
{
"@type": "type.googleapis.com/kong.admin.model.v1.ErrorDetail",
"field": "config.client_jwk[0].false",
"messages": ["unknown field"],
"type": "ERROR_TYPE_FIELD"
}
],
"message": "validation error: unknown field"
}
The original YAML does not contain a false field.
It contains a JWK field named n, which is a standard RSA JWK parameter representing the modulus.
It looks like the YAML parser interprets the unquoted key n as the boolean value false, resulting in the field being sent or validated as:
false: <modulus value>
instead of:
n: <modulus value>
This is problematic because n is a valid JWK field and is required for RSA keys.
Minimal example
_format_version: "3.0"
plugins:
- name: openid-connect
config:
client_id:
- example-client
client_jwk:
- kty: RSA
alg: RS256
kid: example-key
e: AQAB
n: example-modulus-value
Actual behavior
Validation fails with:
{
"field": "config.client_jwk[0].false",
"messages": ["unknown field"]
}
Expected behavior
n should be treated as a string key, not as a boolean false.
The following should validate as a normal JWK field:
n: example-modulus-value
Alternatively, if decK requires quoting for YAML 1.1 compatibility, the error message should clearly indicate that the n key was interpreted as a boolean key and suggest quoting it:
"n": example-modulus-value
Workaround
Quoting the n field avoids the issue:
client_jwk:
- kty: RSA
alg: RS256
kid: example-key
e: AQAB
"n": example-modulus-value
The y field should probably also be quoted for the same reason, since it may be interpreted as boolean true by YAML 1.1 parsers:
"y": null
It may also be safer to quote fields containing special characters, such as:
"x5t#S256": null
Why this matters
JWK uses short field names such as n, e, x, and y.
In particular, RSA JWKs commonly include n and e.
If decK accepts YAML as input for Kong configuration, JWK field names should be handled safely, or decK should provide a clearer validation error when YAML boolean key coercion occurs.
Environment
- decK version: 1.64
- Command:
deck gateway validate kong.yaml - Plugin:
openid-connect - Field:
config.client_jwk
- Ngôn ngữ chính
- Go
- Star
- 507
- Fork
- 142
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Kong/deck
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
DECK_SKIP_DEFAULTS_FILL: nested blocks such as upstream healthchecks must be written in fullĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Cojekt/LibreDental#258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cmd/podiomd: permission MCP stalls the turn when a tool input exceeds the 64KB scanner limitĐang mởgo good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
opensro-dev/opensro#4949 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 3 ngày
-
agent-execution/02 row 4: consumers Verify row lacks delivery/base binding, cannot pass post-mergeĐang mởbug effort:s impact:low raised-by:verifier risk:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
medici-finance/assay#7946 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày