mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2025-10-24 17:27:35 +02:00
Updated version of /gamma
Tons of changes, included a new draft of the mobile version (still VERY rough)
This commit is contained in:
66
frontend/gamma/tests/tests/Clipperz/PM/PIN.html
Normal file
66
frontend/gamma/tests/tests/Clipperz/PM/PIN.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!--
|
||||
|
||||
Copyright 2008-2011 Clipperz Srl
|
||||
|
||||
This file is part of Clipperz Community Edition.
|
||||
Clipperz Community Edition is an online password manager.
|
||||
For further information about its features and functionalities please
|
||||
refer to http://www.clipperz.com.
|
||||
|
||||
* Clipperz Community Edition is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU Affero General Public
|
||||
License as published by the Free Software Foundation, either version
|
||||
3 of the License, or (at your option) any later version.
|
||||
|
||||
* Clipperz Community Edition is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Affero General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
License along with Clipperz Community Edition. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Clipperz.PM.Proxy - TEST</title>
|
||||
|
||||
<script type="text/javascript" src="../../../../js/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="../../../SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../../SimpleTest/test.css">
|
||||
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/YUI/Utils.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Base.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/ByteArray.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Logging.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Async.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/KeyValueObjectStore.js'></script>
|
||||
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/Base.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/BigInt.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/AES.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/SHA.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/PRNG.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/SRP.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/Proxy.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/Connection.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/Crypto.js'></script>
|
||||
<!--
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/Toll.js'></script>
|
||||
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/Proxy.js'></script>
|
||||
-->
|
||||
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/PIN.js'></script>
|
||||
|
||||
<script type="text/javascript" src="../../../SimpleTest/SimpleTest.Async.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="text/javascript" src="PIN.test.js"></script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
97
frontend/gamma/tests/tests/Clipperz/PM/PIN.test.js
Normal file
97
frontend/gamma/tests/tests/Clipperz/PM/PIN.test.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
|
||||
Copyright 2008-2011 Clipperz Srl
|
||||
|
||||
This file is part of Clipperz Community Edition.
|
||||
Clipperz Community Edition is an online password manager.
|
||||
For further information about its features and functionalities please
|
||||
refer to http://www.clipperz.com.
|
||||
|
||||
* Clipperz Community Edition is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU Affero General Public
|
||||
License as published by the Free Software Foundation, either version
|
||||
3 of the License, or (at your option) any later version.
|
||||
|
||||
* Clipperz Community Edition is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Affero General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
License along with Clipperz Community Edition. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose();
|
||||
|
||||
Clipperz.PM.PIN['CREDENTIALS'] = 'TEST.CLIPPERZ.CREDENTIALS';
|
||||
Clipperz.PM.PIN['FAILURE_COUNT'] = 'TEST.CLIPPERZ.FAILED_LOGIN_COUNT';
|
||||
|
||||
|
||||
var tests = {
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
'clearCredentials': function () {
|
||||
localStorage.removeItem(Clipperz.PM.PIN['CREDENTIALS']);
|
||||
localStorage.removeItem(Clipperz.PM.PIN['FAILURE_COUNT']);
|
||||
},
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
'isSet': function () {
|
||||
tests.clearCredentials();
|
||||
|
||||
is(false, Clipperz.PM.PIN.isSet(), "after cleaning all values, credentials should not be set");
|
||||
|
||||
Clipperz.PM.PIN.setCredentialsWithPIN("1234", {'username':'joe', 'passphrase':'eoj'});
|
||||
is(true, Clipperz.PM.PIN.isSet(), "once saved, they should be found");
|
||||
},
|
||||
|
||||
'recordFailedAttempt': function () {
|
||||
tests.clearCredentials();
|
||||
|
||||
Clipperz.PM.PIN.setCredentialsWithPIN("1234", {'username':'joe', 'passphrase':'eoj'});
|
||||
is(true, Clipperz.PM.PIN.isSet(), "once saved, they should be found");
|
||||
Clipperz.PM.PIN.recordFailedAttempt();
|
||||
is(true, Clipperz.PM.PIN.isSet(), "1st wrong PIN -> keep credentials");
|
||||
Clipperz.PM.PIN.recordFailedAttempt();
|
||||
is(true, Clipperz.PM.PIN.isSet(), "2nd wrong PIN -> keep credentials");
|
||||
Clipperz.PM.PIN.recordFailedAttempt();
|
||||
is(false, Clipperz.PM.PIN.isSet(), "3rd wrong PIN -> REMOVE credentials");
|
||||
|
||||
Clipperz.PM.PIN.setCredentialsWithPIN("1234", {'username':'joe', 'passphrase':'eoj'});
|
||||
is(true, Clipperz.PM.PIN.isSet(), "once saved, they should be found");
|
||||
Clipperz.PM.PIN.recordFailedAttempt();
|
||||
is(true, Clipperz.PM.PIN.isSet(), "1st wrong PIN -> keep credentials");
|
||||
Clipperz.PM.PIN.recordFailedAttempt();
|
||||
is(true, Clipperz.PM.PIN.isSet(), "2nd wrong PIN -> keep credentials");
|
||||
Clipperz.PM.PIN.resetFailedAttemptCount();
|
||||
Clipperz.PM.PIN.recordFailedAttempt();
|
||||
is(true, Clipperz.PM.PIN.isSet(), "3rd wrong PIN, but with a successful use in between -> keep credentials");
|
||||
},
|
||||
|
||||
'credentialsWithPIN': function () {
|
||||
var credentials;
|
||||
var pin;
|
||||
var decryptedCredentials;
|
||||
|
||||
tests.clearCredentials();
|
||||
|
||||
credentials = {'username': 'joe', 'passphrase':'foobar'};
|
||||
pin = '1234';
|
||||
Clipperz.PM.PIN.setCredentialsWithPIN(pin, credentials);
|
||||
decryptedCredentials = Clipperz.PM.PIN.credentialsWithPIN(pin);
|
||||
|
||||
is(decryptedCredentials['username'], credentials['username']);
|
||||
is(decryptedCredentials['passphrase'], credentials['passphrase']);
|
||||
},
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
'syntaxFix': MochiKit.Base.noop
|
||||
};
|
||||
|
||||
//#############################################################################
|
||||
|
||||
SimpleTest.runDeferredTests("Clipperz.PM.PIN", tests, {trace:false});
|
||||
@@ -45,6 +45,7 @@ TestRunner.runTests(
|
||||
// 'CryptoPerformance_ByteArrayHex.html',
|
||||
// 'CryptoPerformance_ByteArrayString.html',
|
||||
'Date.html',
|
||||
'PIN.html',
|
||||
'Proxy.html',
|
||||
'Toll.html'
|
||||
);
|
||||
|
||||
@@ -81,7 +81,7 @@ testData = {
|
||||
},
|
||||
*/
|
||||
/* tt/tt with "fixed" direct login */
|
||||
/* 'afaadd70f647886043b9196c861dc04f5605baeab3812ea23707fcba08c4a54f': {
|
||||
'afaadd70f647886043b9196c861dc04f5605baeab3812ea23707fcba08c4a54f': {
|
||||
s: 'df781ec363a380a0bb171d7d4c226248259272a964f04fa2340c77ff84bbc594',
|
||||
v: 'eca214d990ec971a61cd9c5082e62c2d241f8e1ec805a2c26b1d31612747bfb0',
|
||||
version: '0.2',
|
||||
@@ -120,7 +120,7 @@ testData = {
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
|
||||
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
@@ -25,19 +25,16 @@ refer to http://www.clipperz.com.
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Clipperz - online password manager - debug</title>
|
||||
<title>FullApp TEST - WEB</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../../../css/clipperz/clipperz.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../css/clipperz/compact.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../css/clipperz/ytheme-clipperz.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../css/web.css" />
|
||||
|
||||
<link rel="shortcut icon" href="./clipperz.ico" />
|
||||
|
||||
<meta name="description" content="Login to your web accounts with just one click. Never type a password again! Use multiple complex passwords and forget them. A password manager that enhances your online security." />
|
||||
<meta name="keywords" content="password manager,gestor de contraseñas,gerenciador de senhas,Kennwortmanager,passwords,security,privacy,cryptography" />
|
||||
|
||||
<script>
|
||||
Clipperz_IEisBroken = false;
|
||||
Clipperz_normalizedNewLine = '\n';
|
||||
@@ -50,8 +47,8 @@ Clipperz_normalizedNewLine = '\x0d\x0a';
|
||||
</script><![endif]-->
|
||||
|
||||
|
||||
<script type='text/javascript' src='../../../../js/bookmarklet.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/bookmarklet_ie.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Bookmarklet.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/Bookmarklet_IE.js'></script>
|
||||
|
||||
<script type='text/javascript' src='../../../../js/MochiKit/Base.js'></script>
|
||||
<script type='text/javascript' src='../../../../js/MochiKit/Iter.js'></script>
|
||||
@@ -196,45 +193,41 @@ Clipperz_normalizedNewLine = '\x0d\x0a';
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/UI/Canvas/Logo/normal.js'></script>
|
||||
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/UI/Canvas/GraphicFunctions.js'></script>
|
||||
<!-- script type='text/javascript' src='../../../../js/main.js'></script -->
|
||||
<script type='text/javascript' src='../../../../js/main.js'></script>
|
||||
|
||||
<script type='text/javascript' src='../../../../js/Clipperz/PM/Proxy/Proxy.Test.js'></script>
|
||||
<script type='text/javascript' src='./User.data.js'></script>
|
||||
<script type='text/javascript' src='./main_test.js'></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="mainDiv">
|
||||
<div id="loading">
|
||||
<a href="http://www.clipperz.com" target="_blank"><div id="logo"></div></a>
|
||||
<h5 class="clipperzPayoff">keep it to yourself!</h5>
|
||||
<h2>loading ...</h2>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="applicationVersionType" class="LIVE"></div>
|
||||
|
||||
<!-- -->
|
||||
<div id="javaScriptAlert">
|
||||
<div class="mask"></div>
|
||||
<div class="message">
|
||||
<div class="header"></div>
|
||||
<div class="body">
|
||||
<div class="alertLogo"></div>
|
||||
<div class="alert">
|
||||
<h1>Attention!</h1>
|
||||
<p>If you can read this message, the chances are that your browser does not properly support JavaScript? or you have disabled this functionality yourself.</p>
|
||||
<h3>Javascript is required to access Clipperz.</h3>
|
||||
<h5>Please enable scripting or upgrade your browser.</h5>
|
||||
</div>
|
||||
<div>
|
||||
<!-- a href="http://www.clipperz.com" target="_blank"><div id="logo"></div></a -->
|
||||
<h1>clipperz</h1>
|
||||
<h3 class="clipperzPayoff">keep it to yourself!</h3>
|
||||
<!-- h5>loading ...</h5 -->
|
||||
</div>
|
||||
<div class="footer"></div>
|
||||
</div>
|
||||
|
||||
@js_EMBEDDED@
|
||||
|
||||
</div>
|
||||
<!-- -->
|
||||
<!-- div id="applicationVersionType" class="@application.version.type@"></div -->
|
||||
|
||||
<script>
|
||||
// Clipperz.PM.Proxy.defaultProxy = new Clipperz.PM.Proxy.JSON({'url':'@request.path@', 'shouldPayTolls':@should.pay.toll@});
|
||||
/*offline_data_placeholder*/
|
||||
|
||||
MochiKit.DOM.addLoadEvent(function () {
|
||||
Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose();
|
||||
|
||||
var proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:false, isDefault:true, readOnly:false});
|
||||
proxy.dataStore().setupWithEncryptedData(testData['testData']);
|
||||
Clipperz.PM.Proxy.defaultProxy = proxy;
|
||||
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'doLogin', {username:'tt', passphrase:'tt'});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
|
||||
Copyright 2008-2011 Clipperz Srl
|
||||
|
||||
This file is part of Clipperz Community Edition.
|
||||
Clipperz Community Edition is an online password manager.
|
||||
For further information about its features and functionalities please
|
||||
refer to http://www.clipperz.com.
|
||||
|
||||
* Clipperz Community Edition is free software: you can redistribute
|
||||
it and/or modify it under the terms of the GNU Affero General Public
|
||||
License as published by the Free Software Foundation, either version
|
||||
3 of the License, or (at your option) any later version.
|
||||
|
||||
* Clipperz Community Edition is distributed in the hope that it will
|
||||
be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Affero General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
License along with Clipperz Community Edition. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
function _pm_logEvent(anEvent) {
|
||||
// console.log("####", anEvent);
|
||||
|
||||
anEvent.preventDefault();
|
||||
}
|
||||
|
||||
function handleGenericDeferredError(anError) {
|
||||
var result;
|
||||
|
||||
if (anError instanceof MochiKit.Async.CancelledError) {
|
||||
result = anError;
|
||||
} else {
|
||||
MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack);
|
||||
//console.log(anError);
|
||||
result = new MochiKit.Async.CancelledError(anError);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Clipperz.PM.RunTime = {};
|
||||
|
||||
|
||||
function run() {
|
||||
var shouldShowRegistrationForm;
|
||||
var useCompactDesign;
|
||||
var controllerParameters;
|
||||
// var iPhoneDesign;
|
||||
|
||||
// MochiKit.Signal.connect(document.body, 'onkeydown', _pm_logEvent);
|
||||
// MochiKit.Signal.connect(document.body, 'onkeypress', _pm_logEvent);
|
||||
// MochiKit.Signal.connect(document.body, 'onclick', _pm_logEvent);
|
||||
|
||||
controllerParameters = {};
|
||||
|
||||
MochiKit.DOM.removeElement('javaScriptAlert');
|
||||
Clipperz.PM.Strings.Languages.initSetup();
|
||||
|
||||
if (window.location.search.indexOf('registration') != -1) {
|
||||
shouldShowRegistrationForm = true;
|
||||
} else {
|
||||
shouldShowRegistrationForm = false;
|
||||
}
|
||||
|
||||
if (window.location.search.indexOf('autocomplete') != -1) {
|
||||
controllerParameters['autocomplete'] = 'on'
|
||||
}
|
||||
|
||||
// if ((window.location.search.indexOf('iPhone') != -1) || (navigator.userAgent.match('iPhone'))) {
|
||||
// iPhoneDesign = true;
|
||||
// } else {
|
||||
// iPhoneDesign = false;
|
||||
// }
|
||||
|
||||
if (window.location.search.indexOf('compact') != -1) {
|
||||
useCompactDesign = true;
|
||||
} else {
|
||||
useCompactDesign = false;
|
||||
}
|
||||
|
||||
if (useCompactDesign == true) {
|
||||
Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Compact.Controllers.MainController(controllerParameters);
|
||||
// } else if (iPhoneDesign == true) {
|
||||
// Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.iPhone.Controllers.MainController();
|
||||
} else {
|
||||
Clipperz.PM.RunTime.mainController = new Clipperz.PM.UI.Web.Controllers.MainController(controllerParameters);
|
||||
}
|
||||
|
||||
Clipperz.PM.RunTime.mainController.run(shouldShowRegistrationForm);
|
||||
|
||||
//Clipperz.log("HASH: " + window.location.hash);
|
||||
// if (window.location.hash != "") {
|
||||
// window.location.hash = ""
|
||||
// }
|
||||
//Clipperz.log("HASH cleaned");
|
||||
// #credentials=base64encoded({username:'joe', passphrase:'clipperz'})
|
||||
// MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'doLogin', {username:'joe', passphrase:'clipperz'});
|
||||
}
|
||||
|
||||
Clipperz.Crypto.PRNG.defaultRandomGenerator().fastEntropyAccumulationForTestingPurpose();
|
||||
|
||||
var proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:true, isDefault:true, readOnly:false});
|
||||
proxy.dataStore().setupWithEncryptedData(testData['testData']);
|
||||
|
||||
MochiKit.DOM.addLoadEvent(run);
|
||||
204
frontend/gamma/tests/tests/Components/FullApp/mobile.index.html
Normal file
204
frontend/gamma/tests/tests/Components/FullApp/mobile.index.html
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user