Ryan gave us a new awesome template for Ipsilon. Put to prod

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2015-12-16 19:13:42 +00:00
parent 0be7818268
commit 0e24306da6
14 changed files with 314 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{% extends "layout.html" %}
{% block toptext %}
This is the Federated Open Authentication provider homepage.
{% endblock %}
{% block main %}
You will be redirected to this application whenever another application requires you to authenticate.
{% endblock %}

View file

@ -0,0 +1,15 @@
{% extends "layout.html" %}
{% block toptext %}
500 - Internal Server Error
{% endblock %}
{% block main %}
{% if message: %}
<p>{{ message }}</p>
{% else %}
<p>Ipsilon encountered an unexpected internal error while trying to
fulfill your request.</p>
{% endif %}
<p>Please retry again.</p>
<p>If the error persists, contact the server administrator to resolve
the problem.</p>
{% endblock %}

View file

@ -0,0 +1,63 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>{{ title }}</title>
<link rel="shortcut icon" type="image/vnd.microsoft.icon"
href="//fedoraproject.org/static/images/favicon.ico"/>
<!--<link rel="stylesheet" href="{{ basepath }}/ui/fedora/fedora.css">-->
<link href="https://apps.fedoraproject.org/global/fedora-bootstrap-1.0/fedora-bootstrap.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700,400italic,700italic,300italic' rel='stylesheet' type='text/css'>
<meta name="generator" content="Ipsilon">
{%- if heads %}
{%- for group, value in heads.items() %}
{%- for head in value %}
{{ head | safe }}
{%- endfor %}
{%- endfor %}
{%- endif %}
</head>
<body>
<div class="masthead">
<div class="container text-center">
<img alt="logo" src="{{ basepath }}/ui/fedora/fedora-authn-logo-white.png" height=40px />
</div>
</div>
<div class="bodycontent p-t-lg">
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="row">
<div class="col-xs-12 text-center">
{% block toptext %}{% endblock %}
</div>
</div>
<div class="row p-b-lg">
<div class="{% block cardwidths %}{% endblock %}">
<div class="card">
<div class="card-header small">
{% block maintitle %}{% endblock %}
</div>
<div class="card-block">
{% block main %}{% endblock %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer p-t p-b text-center">
<div class="container">
<p class="text-muted credit">
Fedora FAS Login uses OpenID powered by Ipsilon
</p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,35 @@
{% extends "layout.html" %}
{% block title %}Login{% endblock %}
{% block toptext %}
<p>
<small><strong>{{ login_target }}</strong> wants to use your Fedora Account System (FAS) credentials</small>
</p>
{% endblock %}
{% if error %}<p>{{error}}</p>{% endif %}
{% block cardwidths %}col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2{% endblock %}
{% block maintitle %}
login with FAS
{% endblock %}
{% block main %}
<form method="post" action="{{ action }}" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="ipsilon_transaction_id" id="ipsilon_transaction_id" value="{{ ipsilon_transaction_id}}"/>
<div class="form-group row">
<div class="col-xs-12">
<input class="form-control" id="username" name="login_name" placeholder="Username" autofocus value="{{ username | e }}" />
</div>
</div>
<div class="form-group row">
<div class="col-xs-12">
<input class="form-control" id="password" name="login_password" type="password" placeholder="Password" />
</div>
</div>
<div class="form-group row m-b-0">
<div class="col-xs-12">
<input class="btn btn-primary" type="submit" id="loginbutton" value="Allow" />
<span class="btn btn-link small"><small><a target="_blank" href="https://admin.fedoraproject.org/accounts/user/new">create a FAS account</a></small></span>
</div>
</div>
</form>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends "layout.html" %}
{% block title %}Login{% endblock %}
{% block toptext %}
{{ login_target }} is asking to authenticate using Ipsilon
{% endblock %}
{% block main %}
<div>
Redirecting... {{ redirect }}
</div>
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends "master.html" %}
{% block toptext %}
Logged out
{% endblock %}
{% block main %}
{% if user.name %}
<p>Something prevented a successful logout</p>
<p>You are still logged in as {{ user.fullname }}</p>
{% else %}
<p>Successfully logged out.</p>
<p>Return to <a href="{{ basepath }}/">Home</a> page</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends "layout.html" %}
{% block toptext %}
404 - Not Found
{% endblock %}
{% block main %}
{% if message: %}
<p>{{ message }}</p>
{% else %}
<p>This page does not exist.</p>
{% endif %}
<p>If you think this is an error, contact the server administrator to resolve
the problem.</p>
{% endblock %}

View file

@ -0,0 +1,37 @@
{% extends "layout.html" %}
{% block toptext %}
<p><small><strong>{{trustroot}}</strong> requests to use the following details from your FAS Account</small></p>
{% endblock %}
{% block cardwidths %}col-md-10 col-md-offset-1{% endblock %}
{% block maintitle %}Review the authorization details{% endblock %}
{% block main %}
<div class="small">
<form method="post" action="{{action}}" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="ipsilon_transaction_id" id="ipsilon_transaction_id" value="{{ ipsilon_transaction_id }}" />
{% for entry in authz_details|dictsort %}
<div class="row m-b">
<div class="col-sm-5"><strong>{{ entry[0] }}</strong></div>
{%- if entry[1] is iterable and not entry[1] is string -%}
<div class="col-sm-7">{{ entry[1] | join(', ') }}</div>
{%- else -%}
<div class="col-sm-7">{{ entry[1] }}</div>
{%- endif -%}
</div>
{% endfor %}
<div class="row m-b">
<div class="col-sm-5"><strong>Remember&nbsp;approval</strong></div>
<div class="col-sm-7"><select name="remember_for_days" class="c-select-sm c-select">
<option value="0">never</option>
<option value="3">3 days</option>
<option value="7">7 days</option>
</select>
</div>
</div>
<p class="form_item">
<input class="btn btn-primary" name="decided_allow" type="submit" value="Approve" />
<input class="btn btn-link" name="decided_deny" type="submit" value="Reject" />
</p>
</form>
</div>
{% endblock %}

View file

@ -0,0 +1,7 @@
{% extends "layout.html" %}
{% block toptext %}
This is the OpenID page for {{username}}.
{% endblock %}
{% block main %}
This page is primarily used internally
{% endblock %}

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">
<XRD>
<Service>
{%- for t in types %}
<Type>{{ t }}</Type>
{%- endfor %}
{%- if uri %}
<URI>{{ uri }}</URI>
{%- endif %}
{%- if localid %}
<LocalID>{{ localid }}</LocalID>
{%- endif %}
</Service>
</XRD>
</xrds:XRDS>

View file

@ -0,0 +1,59 @@
{% extends "layout.html" %}
{% block toptext %}
This page is used internally
{% endblock %}
{% block main %}
<script type="text/javascript" src="https://login.persona.org/provisioning_api.js"></script>
<script type="text/javascript">
var xmlhttp = new XMLHttpRequest()
var loggedin = {{ loggedin|lower }};
xmlhttp.onreadystatechange = function()
{
if(xmlhttp.readyState == 4)
{
if(xmlhttp.status == 200)
{
navigator.id.registerCertificate(xmlhttp.responseText);
}
else if((xmlhttp.status == 401) || (xmlhttp.status == 403))
{
navigator.id.raiseProvisioningFailure('Error in provisioning!');
}
else
{
alert("Response code: " + xmlhttp.status);
alert("Response text: " + xmlhttp.responseText);
}
}
}
function generateServerSide(email, publicKey, certDuration, callback)
{
xmlhttp.open("POST", "Sign/", true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("email=" + encodeURIComponent(email)
+ "&publicKey=" + encodeURIComponent(publicKey)
+ "&certDuration=" + encodeURIComponent(certDuration));
}
function startProvisioning()
{
navigator.id.beginProvisioning(function(email, certDuration)
{
if(loggedin)
{
navigator.id.genKeyPair(function(publicKey)
{
generateServerSide(email, publicKey, certDuration);
});
} else {
navigator.id.raiseProvisioningFailure('user is not authenticated');
}
});
}
startProvisioning();
</script>
{% endblock %}

View file

@ -0,0 +1,19 @@
{% extends "layout.html" %}
{% block toptext %}
This page is used internally
{% endblock %}
{% block main %}
<script type="text/javascript" src="https://login.persona.org/authentication_api.js"></script>
<script type="text/javascript">
var loggedin = {{ loggedin|lower }};
if(loggedin)
{
navigator.id.beginAuthentication(function(email) {
navigator.id.completeAuthentication();
});
} else {
navigator.id.raiseAuthenticationFailure('User cancelled signon');
}
</script>
{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends "layout.html" %}
{% block maintitle %}
401 - Unauthorized
{% endblock %}
{% block main %}
{% if message: %}
<p>{{ message }}</p>
{% else %}
<p>Authentication was not succesful</p>
{% endif %}
<p><a href="{{ basepath }}/login" title="Login">Try to login again</a></p>
{% endblock %}

View file

@ -33,6 +33,13 @@
copy: src=templates/
dest=/usr/share/ipsilon/templates-fedora
owner=ipsilon group=ipsilon mode=0666
when: env != "staging"
- name: copy STAGING ipsilon templates
copy: src=templates-new/
dest=/usr/share/ipsilon/templates-fedora
owner=ipsilon group=ipsilon mode=0666
when: env == "staging"
- name: copy ipsilon ui assets
copy: src=ui-fedora/