Skip to content

Commit fd7cd23

Browse files
author
Jonathon Duerig
committed
First release candidate version with attached documentation.
1 parent 795cc02 commit fd7cd23

18 files changed

+352
-162
lines changed

README.md

+71-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,72 @@
1-
xml-signer
2-
==========
1+
=GENI Authorization Tool=
32

4-
xmldsig signatures in a browser
3+
This tool will sign credentials that allow a tool to act on behalf of
4+
a user. Aside from direct user interaction, there are two kinds of
5+
entities that interact with this tool: Member Authorities and Tool
6+
frontends.
7+
8+
As a federation-wide utility, this tool will reside at a trusted
9+
location accessible via SSL connection. Any tool frontend can invoke a
10+
JavaScript function which will popup an authorization window for the
11+
user.
12+
13+
==Test Environment==
14+
15+
To try out GENI Authorization, you will need a GENI certificate and
16+
key bundle in PEM format, and the ability to host the source files on
17+
a webhost. For testing, you need not host them via SSL.
18+
19+
Upload all of the files in the repository to your chosen
20+
destination. You may need to tweak geni-auth.js. The 'trustedHost'
21+
variable at the top is intended to point to the final trusted hostname
22+
for added security. But for testing, you will need to point it at the
23+
hostname and port of your test server.
24+
25+
Once you have the files hosted, you can visit index.html by itself to
26+
simply load and clear your certificate. Or you can visit tool.html to
27+
try out the example tool and get a signed credential.
28+
29+
==Tool API==
30+
31+
To use the GENI Authorization Tool in your tool, you will need to
32+
include geni-auth.js into the web frontend of your tool. In your event
33+
function that handles the user's authorization, invoke the
34+
genilib.authorize method.
35+
36+
===genilib.authorize (id, cert, callback)===
37+
38+
This method pops up an authorization window allowing the user to
39+
create a speaks-for credential for your tool. This should only be
40+
invoked in response to a user-driven event such as a click or the
41+
browser's popup blocker may interfere.
42+
43+
Parameters:
44+
- id: An opaque string, usually the URN of the tool
45+
- cert: PEM-encoded certificate of the tool. Should be valid for any authority your tool needs to establish trust with.
46+
- callback: This method will be invoked with a string containing the XML GENI credential. There is no timeout and this method may never be called if the user closes the authorization window.
47+
48+
Returns: Nothing
49+
50+
==Member Authority API==
51+
52+
Member Authorities may optionally present a web interface that lets
53+
the user pass their certificate to the GENI Authorization Tool. If
54+
they do not present a web interface, it will be up to the user to
55+
manually paste in their certificate file.
56+
57+
Once the user's identity has been verified, the member authority
58+
invokes genilib.sendCertificate to pass the certificate to the trusted
59+
signer.
60+
61+
===genilib.sendCertificate (cert)===
62+
63+
This method sends a user's GENI certificate to the GENI Authorization
64+
Tool which is presumed to live in the browser window that opened the
65+
current one. After sending the message, it will close the current
66+
window or tab. If this function is invoked in some other circumstance,
67+
it simply closes the current window or tab.
68+
69+
Parameters:
70+
- cert: A pem-encoded certificate and private key belonging to the logged in user.
71+
72+
Returns: Nothing

emulab.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
<link rel="shortcut icon" href="favicon.ico"/>
88
<link rel="stylesheet" style="text/css"
9-
href="lib/bootstrap/css/bootstrap.min.css">
10-
<link rel="stylesheet" style="text/css"
11-
href="lib/bootstrap/css/bootstrap-responsive.min.css">
9+
href="lib/amelia.min.css">
1210
<script src="geni-auth.js"></script>
1311
<script data-main="emulab" src="require-jquery.js"></script>
1412
</head>

emulab.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*global require: true */
22

3-
require(['jquery', 'text!example.pem'],
3+
require(['jquery', 'text!cred/user.pem'],
44
function ($, cert) {
55
'use strict';
66

geni-auth.js

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11

22
var genilib = {};
3-
//genilib.trustedHost = 'http://localhost:8080';
4-
genilib.trustedHost = 'https://www.emulab.net';
3+
genilib.trustedHost = 'http://localhost:8080';
4+
//genilib.trustedHost = 'https://www.emulab.net';
55

6-
genilib.authorize = function(id, callback)
6+
genilib.authorize = function(id, cert, callback)
77
{
88
var wrapper = {};
99

1010
wrapper.other = window.open('index.html?id=' + encodeURIComponent(id), 'GENI Tool Authorization',
11-
'height=400,width=600');
11+
'height=400,width=800');
1212

1313
wrapper.listener = function (event) {
14+
var data;
1415
if (event.source === wrapper.other &&
1516
event.origin === genilib.trustedHost &&
16-
event.data.id && event.data.id === id && event.data.credential)
17+
event.data.ready)
18+
{
19+
data = {
20+
certificate: cert
21+
};
22+
wrapper.other.postMessage(data, genilib.trustedHost);
23+
}
24+
else if (event.source === wrapper.other &&
25+
event.origin === genilib.trustedHost &&
26+
event.data.id && event.data.id === id && event.data.credential)
1727
{
1828
window.removeEventListener('message', wrapper.listener, false);
1929
wrapper.other.removeEventListener('close', wrapper.close, false);
2030

21-
var data = {
31+
data = {
2232
id: event.data.id,
2333
ack: true
2434
};

index.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Credential Signer</title>
5+
<title>GENI Authorization Tool</title>
66

77
<link rel="shortcut icon" href="favicon.ico"/>
88
<link rel="stylesheet" style="text/css"
9-
href="lib/bootstrap/css/bootstrap.min.css">
10-
<link rel="stylesheet" style="text/css"
11-
href="lib/bootstrap/css/bootstrap-responsive.min.css">
9+
href="lib/cyborg.min.css">
1210
<script src="lib/jsrsasign/asn1hex-1.1.js"></script>
1311
<script src="lib/jsrsasign/base64.js"></script>
1412
<script src="lib/jsrsasign/jsbn.js"></script>
@@ -34,6 +32,7 @@
3432
</head>
3533
<body>
3634
<div class="container" id="main-content">
35+
<h1>Initializing...</h1>
3736
</div>
3837
</body>
3938
</html>

lib/amelia.min.css

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bootstrap/css/bootstrap-responsive.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
22
* Bootstrap Responsive v2.3.2
33
*
4-
* Copyright 2012 Twitter, Inc
4+
* Copyright 2013 Twitter, Inc
55
* Licensed under the Apache License v2.0
66
* http://www.apache.org/licenses/LICENSE-2.0
77
*
8-
* Designed and built with all the love in the world @twitter by @mdo and @fat.
8+
* Designed and built with all the love in the world by @mdo and @fat.
99
*/
1010

1111
.clearfix {

lib/bootstrap/css/bootstrap-responsive.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bootstrap/css/bootstrap.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
22
* Bootstrap v2.3.2
33
*
4-
* Copyright 2012 Twitter, Inc
4+
* Copyright 2013 Twitter, Inc
55
* Licensed under the Apache License v2.0
66
* http://www.apache.org/licenses/LICENSE-2.0
77
*
8-
* Designed and built with all the love in the world @twitter by @mdo and @fat.
8+
* Designed and built with all the love in the world by @mdo and @fat.
99
*/
1010

1111
.clearfix {

lib/bootstrap/css/bootstrap.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bootstrap/js/bootstrap.js

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* ===================================================
22
* bootstrap-transition.js v2.3.2
3-
* http://twitter.github.com/bootstrap/javascript.html#transitions
3+
* http://getbootstrap.com/2.3.2/javascript.html#transitions
44
* ===================================================
5-
* Copyright 2012 Twitter, Inc.
5+
* Copyright 2013 Twitter, Inc.
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -59,9 +59,9 @@
5959

6060
}(window.jQuery);/* ==========================================================
6161
* bootstrap-alert.js v2.3.2
62-
* http://twitter.github.com/bootstrap/javascript.html#alerts
62+
* http://getbootstrap.com/2.3.2/javascript.html#alerts
6363
* ==========================================================
64-
* Copyright 2012 Twitter, Inc.
64+
* Copyright 2013 Twitter, Inc.
6565
*
6666
* Licensed under the Apache License, Version 2.0 (the "License");
6767
* you may not use this file except in compliance with the License.
@@ -157,9 +157,9 @@
157157

158158
}(window.jQuery);/* ============================================================
159159
* bootstrap-button.js v2.3.2
160-
* http://twitter.github.com/bootstrap/javascript.html#buttons
160+
* http://getbootstrap.com/2.3.2/javascript.html#buttons
161161
* ============================================================
162-
* Copyright 2012 Twitter, Inc.
162+
* Copyright 2013 Twitter, Inc.
163163
*
164164
* Licensed under the Apache License, Version 2.0 (the "License");
165165
* you may not use this file except in compliance with the License.
@@ -261,9 +261,9 @@
261261

262262
}(window.jQuery);/* ==========================================================
263263
* bootstrap-carousel.js v2.3.2
264-
* http://twitter.github.com/bootstrap/javascript.html#carousel
264+
* http://getbootstrap.com/2.3.2/javascript.html#carousel
265265
* ==========================================================
266-
* Copyright 2012 Twitter, Inc.
266+
* Copyright 2013 Twitter, Inc.
267267
*
268268
* Licensed under the Apache License, Version 2.0 (the "License");
269269
* you may not use this file except in compliance with the License.
@@ -467,9 +467,9 @@
467467

468468
}(window.jQuery);/* =============================================================
469469
* bootstrap-collapse.js v2.3.2
470-
* http://twitter.github.com/bootstrap/javascript.html#collapse
470+
* http://getbootstrap.com/2.3.2/javascript.html#collapse
471471
* =============================================================
472-
* Copyright 2012 Twitter, Inc.
472+
* Copyright 2013 Twitter, Inc.
473473
*
474474
* Licensed under the Apache License, Version 2.0 (the "License");
475475
* you may not use this file except in compliance with the License.
@@ -633,9 +633,9 @@
633633

634634
}(window.jQuery);/* ============================================================
635635
* bootstrap-dropdown.js v2.3.2
636-
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
636+
* http://getbootstrap.com/2.3.2/javascript.html#dropdowns
637637
* ============================================================
638-
* Copyright 2012 Twitter, Inc.
638+
* Copyright 2013 Twitter, Inc.
639639
*
640640
* Licensed under the Apache License, Version 2.0 (the "License");
641641
* you may not use this file except in compliance with the License.
@@ -802,9 +802,9 @@
802802
}(window.jQuery);
803803
/* =========================================================
804804
* bootstrap-modal.js v2.3.2
805-
* http://twitter.github.com/bootstrap/javascript.html#modals
805+
* http://getbootstrap.com/2.3.2/javascript.html#modals
806806
* =========================================================
807-
* Copyright 2012 Twitter, Inc.
807+
* Copyright 2013 Twitter, Inc.
808808
*
809809
* Licensed under the Apache License, Version 2.0 (the "License");
810810
* you may not use this file except in compliance with the License.
@@ -1049,10 +1049,10 @@
10491049
}(window.jQuery);
10501050
/* ===========================================================
10511051
* bootstrap-tooltip.js v2.3.2
1052-
* http://twitter.github.com/bootstrap/javascript.html#tooltips
1052+
* http://getbootstrap.com/2.3.2/javascript.html#tooltips
10531053
* Inspired by the original jQuery.tipsy by Jason Frame
10541054
* ===========================================================
1055-
* Copyright 2012 Twitter, Inc.
1055+
* Copyright 2013 Twitter, Inc.
10561056
*
10571057
* Licensed under the Apache License, Version 2.0 (the "License");
10581058
* you may not use this file except in compliance with the License.
@@ -1410,9 +1410,9 @@
14101410
}(window.jQuery);
14111411
/* ===========================================================
14121412
* bootstrap-popover.js v2.3.2
1413-
* http://twitter.github.com/bootstrap/javascript.html#popovers
1413+
* http://getbootstrap.com/2.3.2/javascript.html#popovers
14141414
* ===========================================================
1415-
* Copyright 2012 Twitter, Inc.
1415+
* Copyright 2013 Twitter, Inc.
14161416
*
14171417
* Licensed under the Apache License, Version 2.0 (the "License");
14181418
* you may not use this file except in compliance with the License.
@@ -1524,9 +1524,9 @@
15241524
}(window.jQuery);
15251525
/* =============================================================
15261526
* bootstrap-scrollspy.js v2.3.2
1527-
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
1527+
* http://getbootstrap.com/2.3.2/javascript.html#scrollspy
15281528
* =============================================================
1529-
* Copyright 2012 Twitter, Inc.
1529+
* Copyright 2013 Twitter, Inc.
15301530
*
15311531
* Licensed under the Apache License, Version 2.0 (the "License");
15321532
* you may not use this file except in compliance with the License.
@@ -1685,9 +1685,9 @@
16851685

16861686
}(window.jQuery);/* ========================================================
16871687
* bootstrap-tab.js v2.3.2
1688-
* http://twitter.github.com/bootstrap/javascript.html#tabs
1688+
* http://getbootstrap.com/2.3.2/javascript.html#tabs
16891689
* ========================================================
1690-
* Copyright 2012 Twitter, Inc.
1690+
* Copyright 2013 Twitter, Inc.
16911691
*
16921692
* Licensed under the Apache License, Version 2.0 (the "License");
16931693
* you may not use this file except in compliance with the License.
@@ -1828,9 +1828,9 @@
18281828

18291829
}(window.jQuery);/* =============================================================
18301830
* bootstrap-typeahead.js v2.3.2
1831-
* http://twitter.github.com/bootstrap/javascript.html#typeahead
1831+
* http://getbootstrap.com/2.3.2/javascript.html#typeahead
18321832
* =============================================================
1833-
* Copyright 2012 Twitter, Inc.
1833+
* Copyright 2013 Twitter, Inc.
18341834
*
18351835
* Licensed under the Apache License, Version 2.0 (the "License");
18361836
* you may not use this file except in compliance with the License.
@@ -2163,9 +2163,9 @@
21632163
}(window.jQuery);
21642164
/* ==========================================================
21652165
* bootstrap-affix.js v2.3.2
2166-
* http://twitter.github.com/bootstrap/javascript.html#affix
2166+
* http://getbootstrap.com/2.3.2/javascript.html#affix
21672167
* ==========================================================
2168-
* Copyright 2012 Twitter, Inc.
2168+
* Copyright 2013 Twitter, Inc.
21692169
*
21702170
* Licensed under the Apache License, Version 2.0 (the "License");
21712171
* you may not use this file except in compliance with the License.

lib/bootstrap/js/bootstrap.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/cyborg.min.css

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

template/authorize.html

+26-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
<div class="hero-unit">
2-
<h1>GENI Tool Authorization</h1>
3-
<p>To authorize, enter the passphrase for your GENI certificate below. Once you authorize, the tool will be able to act on your behalf when talking to GENI infrastructure. Only authorize if you trust the tool.</p>
4-
<h3>Tool URN: <%= id %></h3>
5-
<div id="error-box"></div>
6-
<form id="private">
7-
<input id="password" type="password" placeholder="Passphrase" class="span8">
8-
<fieldset>
9-
<button id="sign" class="btn btn-primary">Authorize</button>
10-
</fieldset>
2+
<h1>GENI Authorization Tool</h1>
3+
<p>The GENI Authorization Tool allows you to authorize applications to speak on your behalf to allocate slices or slivers. Your credentials are stored locally in your browser and your passphrase is never transmitted over the network.</p>
4+
<p class="tool-info">To authorize, enter the passphrase for your GENI certificate below. Once you authorize, the tool will be able to act on your behalf when talking to GENI infrastructure. Only authorize if you trust the tool.</p>
5+
<h5 class="tool-info">Tool URN: <%= id %></h5>
6+
<div class="tool-info" id="error-box"></div>
7+
<form class="tool-info form-horizontal" role="form" id="private">
8+
<div class="form-group">
9+
<label class="col-lg-2 control-label" for="time">Duration (days)</label>
10+
<div class="col-lg-10">
11+
<input id="time" class="form-control" type="text" value="30">
12+
</div>
13+
</div>
14+
<div class="form-group">
15+
<label class="control-label col-lg-2" for="password">Passphrase</label>
16+
<div class="col-lg-10">
17+
<input id="password" class="form-control" type="password" placeholder="Passphrase">
18+
</div>
19+
</div>
20+
<div class="form-group">
21+
<div class="col-offset-2 col-lg-10">
22+
<button id="sign" class="btn btn-primary">Authorize</button>
23+
</div>
24+
</div>
1125
</form>
26+
<h3 class="no-tool-info">Your Certificate is Saved.</h3>
27+
<p class="no-tool-info">When you choose to authorize a tool, you will be redirected here to complete the process.</p>
28+
<button id="logout" class="btn btn-default pull-right">Delete Certificate</button>
1229
</div>

0 commit comments

Comments
 (0)