[coverage] Conformance findings: AUTH-019

Đang mở
#546 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
databases

Hướng nghiên cứu

Start by reading the Go driver’s OAuth M2M scope handling and locate the tests for TestOAuthM2MTokenRequestUsesConfiguredScopes; the issue does not name their paths. Compare configured, whitespace-padded, blank, and unset scopes against the expected token request in the issue. Done when both Thrift and SEA send one sql token for sloppy scopes, and blank or unset scopes request all-apis and complete successfully.

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

Mô tả

Summary

Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-go. Each finding is committed as an expected-failure (xfail) test in the coverage PR — the test asserts the CORRECT (post-fix) behavior and stays red until THIS driver (databricks/databricks-sql-go) is fixed, then flips green as a tripwire.

Findings

  • AUTH-019 [thrift]: Thrift OAuth M2M forwards configured scopes verbatim: inner whitespace is not split and duplicates are not dropped (" sql sql " -> two sql tokens), and a whitespace-only entry is sent as-is so the token endpoint rejects the client_credentials grant with invalid_scope instead of falling back to all-apis
    • failing test: TestOAuthM2MTokenRequestUsesConfiguredScopes (see the coverage PR diff under tests/)
  • AUTH-019 [sea]: SEA/kernel OAuth M2M forwards configured scopes verbatim: a scope entry's inner whitespace is not split and duplicates are not dropped, so " sql sql " is sent as two sql tokens instead of one
    • failing test: TestOAuthM2MTokenRequestUsesConfiguredScopes (see the coverage PR diff under tests/)
  • AUTH-019: OAuth M2M forwards configured scopes verbatim: a scope entry's inner whitespace is not split and duplicates are not dropped (" sql sql " is sent as two sql tokens on both thrift and sea), and on the Thrift path a whitespace-only entry is sent as-is so the workspace token endpoint rejects the client_credentials grant with invalid_scope instead of falling back to all-apis (the kernel/SEA path handles the blank entry correctly)

Reproduce & Expected

AUTH-019 — Verifies that the driver's OAuth scopes option decides what the client-credentials (M2M) token request asks for, instead of always requesting all-apis, so a service principal whose secret is scoped…

Reproduce:

SELECT CURRENT_USER() AS user
SELECT CURRENT_USER() AS user
SELECT CURRENT_USER() AS user
SELECT CURRENT_USER() AS user

Expected (per the shared spec):

  • result has exactly 1 row(s)
  • result has exactly 1 row(s)
  • result has exactly 1 row(s)
  • result has exactly 1 row(s)
  • full assertion contract:
result:
- label: configured_scopes
  oauth_token_request_scope_tokens:
    grant_type: client_credentials
    equals:
    - sql
- label: configured_scopes
  row_count: 1
- label: sloppy_scopes
  oauth_token_request_scope_tokens:
    grant_type: client_credentials
    equals:
    - sql
- label: sloppy_scopes
  row_count: 1
- label: blank_scopes
  oauth_token_request_scope_tokens:
    grant_type: client_credentials
    equals:
    - all-apis
- label: blank_scopes
  row_count: 1
- label: unset_scopes
  oauth_token_request_scope_tokens:
    grant_type: client_credentials
    equals:
    - all-apis
- label: unset_scopes
  row_count: 1
protocol:
  thrift:
  - call_min:
      method: OpenSession
      min: 1
  sea:
  - call_min:
      operation: CreateSession
      min: 1

Context

Ngôn ngữ chính
Go
Star
54
Fork
71
Merge trung bình
16 giờ 3 phút
Pull request đã merge (30 ngày)
21

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 databricks/databricks-sql-go

Tất cả issue của databricks/databricks-sql-go

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.