From 7ac1644563cbd1e7c82a5931cf5eb3eb6aa9067b Mon Sep 17 00:00:00 2001 From: rudy Date: Fri, 18 Nov 2022 15:18:23 +0100 Subject: [PATCH] maj pa11y: ajout de cookie poour choix de langue --- Makefile | 8 ++++++++ resources/com/cadoles/pa11y/patty.json.tmpl | 5 ++++- resources/com/cadoles/pa11y/run-audit.sh | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ca43026..faf1b9f 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ LIGHTHOUSE_COMMAND ?= LIGHTHOUSE_URL ?= PA11Y_URL ?= PA11Y_REPORTER ?= +PA11Y_USERNAME ?= +PA11Y_PASSWORD ?= +PA11Y_STANDARD ?= +PA11Y_COOKIE ?= image-w3af: docker build \ @@ -73,6 +77,10 @@ pa11y: -e https_proxy=$(https_proxy) \ -e PA11Y_URL='$(PA11Y_URL)' \ -e PA11Y_REPORTER='$(PA11Y_REPORTER)' \ + -e PA11Y_USERNAME='$(PA11Y_USERNAME)' \ + -e PA11Y_PASSWORD='$(PA11Y_PASSWORD)' \ + -e PA11Y_STANDARD='$(PA11Y_STANDARD)' \ + -e PA11Y_COOKIE='$(PA11Y_COOKIE)' \ -u $(shell id -u $(USER)):$(shell id -g $(USER)) \ -v "$(PWD)/data/pa11y/reports:/home/pa11y/reports" \ $(DOCKER_ARGS) \ diff --git a/resources/com/cadoles/pa11y/patty.json.tmpl b/resources/com/cadoles/pa11y/patty.json.tmpl index 919bfa9..ec0bf0d 100644 --- a/resources/com/cadoles/pa11y/patty.json.tmpl +++ b/resources/com/cadoles/pa11y/patty.json.tmpl @@ -6,7 +6,10 @@ "headers": { {{if not (empty .PA11Y_USERNAME)}} {{ $credentials := print .PA11Y_USERNAME ":" .PA11Y_PASSWORD }} - "Authorization": "Basic {{b64enc $credentials}}" + "Authorization": "Basic {{b64enc $credentials}}" {{if not (empty .PA11Y_COOKIE)}},{{end}} + {{end}} + {{if not (empty .PA11Y_COOKIE)}} + "Cookie": "{{print .PA11Y_COOKIE}}" {{end}} } } \ No newline at end of file diff --git a/resources/com/cadoles/pa11y/run-audit.sh b/resources/com/cadoles/pa11y/run-audit.sh index 1784545..793280d 100644 --- a/resources/com/cadoles/pa11y/run-audit.sh +++ b/resources/com/cadoles/pa11y/run-audit.sh @@ -9,7 +9,8 @@ cd reports export PUPPETEER_EXECUTABLE_PATH=$(which chromium-browser) export PA11Y_REPORTER="${PA11Y_REPORTER:-html}" -export PA11Y_STANDARD=${PA11Y_STANDARD:-WCAG2AA} +export PA11Y_STANDARD="${PA11Y_STANDARD:-WCAG2AA}" +export PA11Y_IGNORE="${PA11Y_IGNORE:-'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail;WCAG2AA.Principle1.Guideline1_4.1_4_3.G145.Fail'}" PA11Y_ARGS="" @@ -26,4 +27,5 @@ pa11y \ ${PA11Y_ARGS} \ --reporter "${PA11Y_REPORTER}" \ --standard "${PA11Y_STANDARD}" \ + --ignore "${PA11Y_IGNORE}" \ "$PA11Y_URL" || exit 0