github / github/accessibility-scanner

Support configurable login form selectors for non-standard label names

Đang mở
#202 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
369
Fork
40
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

## Problem

The auth action finds login fields using `getByLabel(/user ?name/i)` and `getByLabel(/password/i)`. This misses common login forms:

- **Email-based login**: "Email", "E-Mail" don't match `/user ?name/i`
- **Non-English apps**: "Benutzername", "Mot de passe" don't match
- **No visible labels**: Forms using only `placeholder` attributes

When no match is found, the login form is not detected and the scanner proceeds unauthenticated.

## Suggested fix

1. **Fall back to input types** when label matching fails: `input[type="password"]` for the password field, and the closest preceding `input[type="text"]` or `input[type="email"]` for the username field.
2. **Make selectors configurable** via optional inputs like `username_selector` and `password_selector`, so users can specify their own labels, placeholders, or CSS selectors for non-standard forms.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu tại auth action, nơi getByLabel(/user ?name/i) và getByLabel(/password/i) định vị các trường đăng nhập, sau đó kiểm tra cách các input tùy chọn được định nghĩa. Hỗ trợ các giá trị username_selector và password_selector có thể cấu hình cùng với các fallback theo input-type được đề xuất, đồng thời xác minh rằng các biểu mẫu không theo tiêu chuẩn hoặc không có nhãn được phát hiện và quét trong trạng thái đã xác thực.

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

Đánh giá

Công nghệ
typescript
Lĩnh vực
accessibility, authentication
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

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.