Skip to content

Commit

Permalink
feat(api): add additional accessibility fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Collinbrown95 committed Nov 8, 2023
1 parent a32226d commit 4381ee0
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 10 deletions.
61 changes: 58 additions & 3 deletions api/src/graphql_types/input_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,73 @@ class GithubEndpointInput:


@strawberry.input
class AccessibilityScanInput:
class AccessibilityInput:
url: str
area_alt: Optional[CheckPassesInput] = None
aria_braille_equivalent: Optional[CheckPassesInput] = None
aria_command_name: Optional[CheckPassesInput] = None
aria_input_field: Optional[CheckPassesInput] = None
aria_hidden_focus: Optional[CheckPassesInput] = None
aria_input_field: Optional[CheckPassesInput] = None
aria_meter_name: Optional[CheckPassesInput] = None
aria_progressbar_name: Optional[CheckPassesInput] = None
aria_required_children: Optional[CheckPassesInput] = None
aria_required_parent: Optional[CheckPassesInput] = None
aria_roledescription: Optional[CheckPassesInput] = None
aria_toggle_field_name: Optional[CheckPassesInput] = None
aria_tooltip_name: Optional[CheckPassesInput] = None
audio_caption: Optional[CheckPassesInput] = None
blink: Optional[CheckPassesInput] = None
definition_list: Optional[CheckPassesInput] = None
dlitem: Optional[CheckPassesInput] = None
duplicate_id_aria: Optional[CheckPassesInput] = None
frame_focusable_content: Optional[CheckPassesInput] = None
frame_title_unique: Optional[CheckPassesInput] = None
frame_title: Optional[CheckPassesInput] = None
html_xml_lang_mismatch: Optional[CheckPassesInput] = None
imageAlt: Optional[CheckPassesInput] = None
input_button_name: Optional[CheckPassesInput] = None
input_image_alt: Optional[CheckPassesInput] = None
link_in_text_block: Optional[CheckPassesInput] = None
list: Optional[CheckPassesInput] = None
listitem: Optional[CheckPassesInput] = None
marquee: Optional[CheckPassesInput] = None
meta_refresh: Optional[CheckPassesInput] = None
object_alt: Optional[CheckPassesInput] = None
role_img_alt: Optional[CheckPassesInput] = None
scrollable_region_focusable: Optional[CheckPassesInput] = None
select_name: Optional[CheckPassesInput] = None
server_side_image_map: Optional[CheckPassesInput] = None
svg_img_alt: Optional[CheckPassesInput] = None
td_headers_attr: Optional[CheckPassesInput] = None
td_has_data_cells: Optional[CheckPassesInput] = None
valid_lang: Optional[CheckPassesInput] = None
video_caption: Optional[CheckPassesInput] = None
no_autoplay_audio: Optional[CheckPassesInput] = None
aria_allowed_attr: Optional[CheckPassesInput] = None
aria_conditional_attr: Optional[CheckPassesInput] = None
aria_deprecated_role: Optional[CheckPassesInput] = None
aria_hidden_body: Optional[CheckPassesInput] = None
aria_prohibited_attr: Optional[CheckPassesInput] = None
aria_required_attr: Optional[CheckPassesInput] = None
aria_roles: Optional[CheckPassesInput] = None
aria_valid_attr_value: Optional[CheckPassesInput] = None
aria_valid_attr: Optional[CheckPassesInput] = None
button_name: Optional[CheckPassesInput] = None
color_contrast: Optional[CheckPassesInput] = None
document_title: Optional[CheckPassesInput] = None
form_field_multiple_labels: Optional[CheckPassesInput] = None
html_has_lang: Optional[CheckPassesInput] = None
html_lang_valid: Optional[CheckPassesInput] = None
label: Optional[CheckPassesInput] = None
linkName: Optional[CheckPassesInput] = None
meta_viewport: Optional[CheckPassesInput] = None
nested_interactive: Optional[CheckPassesInput] = None
bypass: Optional[CheckPassesInput] = None


@strawberry.input
class WebEndpointInput:
url: str
kind: str
accessibility: Optional[List[AccessibilityScanInput]] = None
accessibility: Optional[List[AccessibilityInput]] = None

65 changes: 65 additions & 0 deletions api/src/graphql_types/typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,72 @@ class GithubEndpoint(Endpoint):
has_security_md: CheckPasses
has_dependabot_yaml: CheckPasses

@strawberry.type
class AccessibilityInput:
url: str
area_alt: Optional[CheckPasses]
aria_braille_equivalent: Optional[CheckPasses]
aria_command_name: Optional[CheckPasses]
aria_hidden_focus: Optional[CheckPasses]
aria_input_field: Optional[CheckPasses]
aria_meter_name: Optional[CheckPasses]
aria_progressbar_name: Optional[CheckPasses]
aria_required_children: Optional[CheckPasses]
aria_required_parent: Optional[CheckPasses]
aria_roledescription: Optional[CheckPasses]
aria_toggle_field_name: Optional[CheckPasses]
aria_tooltip_name: Optional[CheckPasses]
audio_caption: Optional[CheckPasses]
blink: Optional[CheckPasses]
definition_list: Optional[CheckPasses]
dlitem: Optional[CheckPasses]
duplicate_id_aria: Optional[CheckPasses]
frame_focusable_content: Optional[CheckPasses]
frame_title_unique: Optional[CheckPasses]
frame_title: Optional[CheckPasses]
html_xml_lang_mismatch: Optional[CheckPasses]
imageAlt: Optional[CheckPasses]
input_button_name: Optional[CheckPasses]
input_image_alt: Optional[CheckPasses]
link_in_text_block: Optional[CheckPasses]
list: Optional[CheckPasses]
listitem: Optional[CheckPasses]
marquee: Optional[CheckPasses]
meta_refresh: Optional[CheckPasses]
object_alt: Optional[CheckPasses]
role_img_alt: Optional[CheckPasses]
scrollable_region_focusable: Optional[CheckPasses]
select_name: Optional[CheckPassesInput]
server_side_image_map: Optional[CheckPassesInput]
svg_img_alt: Optional[CheckPassesInput]
td_headers_attr: Optional[CheckPassesInput]
td_has_data_cells: Optional[CheckPassesInput]
valid_lang: Optional[CheckPassesInput]
video_caption: Optional[CheckPassesInput]
no_autoplay_audio: Optional[CheckPassesInput]
aria_allowed_attr: Optional[CheckPassesInput]
aria_conditional_attr: Optional[CheckPassesInput]
aria_deprecated_role: Optional[CheckPassesInput]
aria_hidden_body: Optional[CheckPassesInput]
aria_prohibited_attr: Optional[CheckPassesInput]
aria_required_attr: Optional[CheckPassesInput]
aria_roles: Optional[CheckPassesInput]
aria_valid_attr_value: Optional[CheckPassesInput]
aria_valid_attr: Optional[CheckPassesInput]
button_name: Optional[CheckPassesInput]
color_contrast: Optional[CheckPassesInput]
document_title: Optional[CheckPassesInput]
form_field_multiple_labels: Optional[CheckPassesInput]
html_has_lang: Optional[CheckPassesInput]
html_lang_valid: Optional[CheckPassesInput]
label: Optional[CheckPassesInput]
linkName: Optional[CheckPassesInput]
meta_viewport: Optional[CheckPassesInput]
nested_interactive: Optional[CheckPassesInput]
bypass: Optional[CheckPassesInput]

@strawberry.type
class WebEndpoint(Endpoint):
url: str
kind: str
accessibility: Optional[List[AccessibilityInput]]
8 changes: 1 addition & 7 deletions scanners/web-endpoint-checks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ process.on('SIGINT', () => process.exit(0))
const accessibilityPages = Object.keys(webEndpointAxeResults).map(page => {
return {
url: page,
areaAlt: webEndpointAxeResults[page].areaAlt,
ariaBrailleEquivalent: webEndpointAxeResults[page].ariaBrailleEquivalent,
ariaCommandName: webEndpointAxeResults[page].ariaCommandName,
ariaHiddenFocus: webEndpointAxeResults[page].ariaHiddenFocus,
ariaInputField: webEndpointAxeResults[page].ariaInputField,
ariaMeterName: webEndpointAxeResults[page].ariaMeterName,
// ...webEndpointAxeResults[page],
...webEndpointAxeResults[page],
}
})
const mutation = gql`
Expand Down

0 comments on commit 4381ee0

Please sign in to comment.