Update dependencies, start work on editor, add hidden admin page

This commit is contained in:
2024-10-22 00:40:51 +02:00
parent 33a9cdb33a
commit 700d4c872e
13 changed files with 314 additions and 91 deletions

View File

@ -8,6 +8,10 @@ vaNp2PerVDzUvdLlZKazGYIHXb5xduSnRp4HRHU9TMzSyuP5fr9XohcCAwEAAQ==`,
var signatureScheme = 'RSASSA-PKCS1-v1_5';
var encryptionType = {name: signatureScheme, hash: {name: "SHA-256"}};
function ensureRequirements () {
return SpaccDotWeb.requireScript('./forge.min.js', { useCurrentPath: true });
}
async function makeSignedScript (scriptText, keyIndex, pemPrivateKey) {
return ('1,'
+ keyIndex + ','
@ -111,11 +115,15 @@ function verificationKeyFromPublicKeyPEM (pemPublicKey) {
["verify"]);
}
window.OcttRuntime = { makeSignedScript, verifyAndRunScript };
window.OcttRuntime = { ensureRequirements, verifyAndRunScript, makeSignedScript };
var scriptCipher = (new URLSearchParams(location.search)).get('octtRuntime');
if (scriptCipher) {
verifyAndRunScript(scriptCipher);
}
window.addEventListener('load', (function(){
var scriptCipher = (new URLSearchParams(location.search)).get('octtRuntime');
if (scriptCipher) {
ensureRequirements().then(function(){
verifyAndRunScript(scriptCipher);
});
}
}));
})();