parametres_application.html
59 lignes · 5498 octets
{% import "components/bouton.html" as b %} {# E023-C3 à C7 — modale d'application : nom, protocole, redirections OIDC, métadonnées SAML ou service CAS #} <form id="form-application" class="flex flex-col gap-md" hx-post="/install/parametres/lemonldap/applications" hx-target="#dialogue-application-corps" hx-swap="innerHTML" hx-disabled-elt="find button[type=submit]" novalidate x-data="protocoleApplication" x-on:change="lire"> <input type="hidden" name="ancien" value="{{ ancien }}"> {% macro erreur(champ) %}{% if let Some(e) = erreurs.get(champ) %}<p id="erreur-{{ champ }}" class="text-sm text-error-ink">{{ e }}</p>{% endif %}{% endmacro %} <div class="field flex flex-col gap-xs"> <label for="nom-application" class="text-sm text-foreground">Nom <span class="text-error-ink" aria-hidden="true">*</span></label> <input id="nom-application" name="nom" value="{{ nom }}" required aria-required="true" maxlength="60" autofocus class="h-10 rounded-xs border bg-background px-sm text-sm text-foreground {% if erreurs.get("nom").is_some() %}border-error{% else %}border-input{% endif %}" aria-describedby="{% if erreurs.get("nom").is_some() %}erreur-nom {% endif %}aide-nom-application"{% if erreurs.get("nom").is_some() %} aria-invalid="true"{% endif %}> {% call erreur("nom") %}{% endcall %} <p id="aide-nom-application" class="text-xs text-muted-foreground">2 à 60 caractères ; l'identifiant technique (client_id) en dérive : minuscules, chiffres et tirets.</p> </div> <fieldset class="flex flex-col gap-xs"> <legend class="text-sm text-foreground">Protocole</legend> <div class="flex flex-wrap gap-lg"> <label class="flex items-center gap-xs text-sm text-foreground"><input type="radio" name="protocole" value="oidc"{% if protocole == "oidc" %} checked{% endif %} class="accent-primary"> OpenID Connect</label> <label class="flex items-center gap-xs text-sm text-foreground"><input type="radio" name="protocole" value="saml"{% if protocole == "saml" %} checked{% endif %} class="accent-primary"> SAML</label> <label class="flex items-center gap-xs text-sm text-foreground"><input type="radio" name="protocole" value="cas"{% if protocole == "cas" %} checked{% endif %} class="accent-primary"> CAS</label> </div> </fieldset> <div class="field flex flex-col gap-xs" x-show="oidc"> <label for="redirections" class="text-sm text-foreground">Adresses de redirection</label> <textarea id="redirections" name="redirections" rows="3" spellcheck="false" class="rounded-xs border bg-background px-sm py-xs font-mono text-sm text-foreground {% if erreurs.get("redirections").is_some() %}border-error{% else %}border-input{% endif %}" aria-describedby="{% if erreurs.get("redirections").is_some() %}erreur-redirections {% endif %}aide-redirections">{{ redirections }}</textarea> {% call erreur("redirections") %}{% endcall %} <p id="aide-redirections" class="text-xs text-muted-foreground">Une par ligne, en https:// (http://localhost toléré pour un poste de test).</p> </div> <div class="flex flex-col gap-md" x-show="saml" x-cloak> <div class="field flex flex-col gap-xs"> <label for="metadonnees" class="text-sm text-foreground">Métadonnées SAML (XML)</label> <textarea id="metadonnees" name="metadonnees" rows="5" spellcheck="false" class="rounded-xs border bg-background px-sm py-xs font-mono text-xs text-foreground {% if erreurs.get("metadonnees").is_some() %}border-error{% else %}border-input{% endif %}" aria-describedby="{% if erreurs.get("metadonnees").is_some() %}erreur-metadonnees {% endif %}aide-metadonnees">{{ metadonnees }}</textarea> {% call erreur("metadonnees") %}{% endcall %} <p id="aide-metadonnees" class="text-xs text-muted-foreground">L'EntityDescriptor fourni par l'application, ou bien son URL ci-dessous.</p> </div> <div class="field flex flex-col gap-xs"> <label for="metadonnees_url" class="text-sm text-foreground">ou URL des métadonnées</label> <input id="metadonnees_url" name="metadonnees_url" value="{{ metadonnees_url }}" spellcheck="false" inputmode="url" class="h-10 rounded-xs border bg-background px-sm font-mono text-sm text-foreground {% if erreurs.get("metadonnees_url").is_some() %}border-error{% else %}border-input{% endif %}" {% if erreurs.get("metadonnees_url").is_some() %}aria-invalid="true" aria-describedby="erreur-metadonnees_url"{% endif %}> {% call erreur("metadonnees_url") %}{% endcall %} </div> </div> <div class="field flex flex-col gap-xs" x-show="cas" x-cloak> <label for="url" class="text-sm text-foreground">URL du service CAS</label> <input id="url" name="url" value="{{ url }}" spellcheck="false" inputmode="url" class="h-10 rounded-xs border bg-background px-sm font-mono text-sm text-foreground {% if erreurs.get("url").is_some() %}border-error{% else %}border-input{% endif %}" aria-describedby="{% if erreurs.get("url").is_some() %}erreur-url {% endif %}aide-url"> {% call erreur("url") %}{% endcall %} <p id="aide-url" class="text-xs text-muted-foreground">Dès qu'un service CAS est déclaré, le portail refuse les services non déclarés.</p> </div> <div class="flex justify-end gap-sm"> <button type="submit" class="{% call b::classes("default") %}{% endcall %}">Enregistrer l'application</button> </div> </form>
GitRust