github / github/accessibility-scanner
Support configurable login form selectors for non-standard label names
- 主要语言
- TypeScript
- 星标
- 369
- 派生
- 40
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 10
描述
## 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.
贡献指南
调研方向
从 auth action 入手,其中 getByLabel(/user ?name/i) 和 getByLabel(/password/i) 会定位登录字段,然后检查可选输入是如何定义的。支持可配置的 username_selector 和 password_selector 值以及提议的 input-type 回退方案,并验证能够检测到非标准表单或没有标签的表单,并在已认证状态下对其进行扫描。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- accessibility, authentication
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100