<commit_before>require(window.APT_OPTIONS.configObject,
	['underscore', 'js/quickvm_sup',
	 'js/lib/text!template/geni-login.html'],
function (_, sup, loginString)
{
    'use strict';

    function initialize()
    {
	window.APT_OPTIONS.initialize(sup);

	genilib.trustedHost = window.HOST;
	genilib.trustedPath = window.PATH;
	$('#page-body').html(loginString);

	$('#authorize').click(function (event) {
	    event.preventDefault();
	    genilib.authorize(window.ID, window.CERT, complete);
	    return false;
	});
    }

    function complete(credential)
    {
	$('#credential').show();
	$('#credential').val(credential);
    }
    $(document).ready(initialize);
});<commit_msg>Add a placeholder tool token and some debugging output for authentication<commit_after>require(window.APT_OPTIONS.configObject,
	['underscore', 'js/quickvm_sup',
	 'js/lib/text!template/geni-login.html'],
function (_, sup, loginString)
{
    'use strict';

    function initialize()
    {
	window.APT_OPTIONS.initialize(sup);

	genilib.trustedHost = window.HOST;
	genilib.trustedPath = window.PATH;
	$('#page-body').html(loginString);

	$('#authorize').click(function (event) {
	    event.preventDefault();
	    genilib.authorize({
		id: window.ID,
		toolCertificate: window.CERT,
		complete: complete,
		authenticate: authenticate
	    });
	    return false;
	});
    }

    function authenticate(userCertificate, success, failure)
    {
	// Some AJAX call that ends with success or failure based on the result
	// success should be called with the PKCS#7 string
	success('-----BEGIN PKCS7-----\n'+
		'MIIByQYJKoZIhvcNAQcDoIIBujCCAbYCAQAxggFcMIIBWAIBADCBwDCBuDELMAkG\n'+
		'A1UEBhMCVVMxDTALBgNVBAgTBFV0YWgxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5\n'+
		'<KEY>'+
		'<KEY>'+
		'<KEY>'+
		'<KEY>'+
		'<KEY>'+
		'<KEY>'+
		'<KEY>'+
		'<KEY>'+
		'-----END PKCS7-----\n');
    }

    function complete(credential, authenticationToken, encryptedCredential)
    {
	$('#credential').show();
	$('#credential').val(credential);
	console.log(authenticationToken, encryptedCredential);
    }
    $(document).ready(initialize);
});
{'fraction_non_alphanumeric': 0.16594930655188905, 'fraction_numerical': 0.0028694404591104736, 'mean_word_length': 4.256281407035176, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5294752', 'n_tokens_mistral': 777, 'n_tokens_neox': 735, 'n_words': 119}