italia / Satosa-Saml2Spid

SATOSA SAML-to-SAML proxy with Spid compliances
Apache License 2.0
42 stars 25 forks source link

Static page errors #82

Closed MdreW closed 9 months ago

MdreW commented 11 months ago

Hi @peppelinux and each others partecipants,

I would like to go back to talking about the error pages. With a simple script we can generate the SPID/CIE specific error pages from the generic error page (or also from the discovery page).

With single error pages we can redirect the errors to the right error page. Vantages:

example - in the new proposed discovery pages I have assigned an id 'main-errors' in the template:

from bs4 import BeautifulSoup 
soup = BeautifulSoup(open("static/error_page.html", "r").read()) 
errors = {'1.html': 'message_1', '2.html': 'message_2', '3.html': '<p>message 3</p>'} # or better a json file
for key in errors.keys():
  soup.find(id='main-error').string = errors[key]
  open(key, "w").write(soup.prettify())

With six code line we can create all errors pages and is simple add this function on startup script What don't you think? is it a solution or a complication?

peppelinux commented 11 months ago

Good hint @MdreW

I'd like to get you in the current developements with the following scopes:

  1. moving texts to .po files (gettext) and having i18n with at least italian and english
  2. creating a setup script that replaces the constants in the static discovery page, according to what defined in the proxy (and its configured backends ...)

then I have concerns about bs4, probably we have new libraries that does that better, but this is not a priority. I'll invite you in the next dev meeting

MdreW commented 9 months ago

issue withdrawn on favour of #88