fixed some old TODOs
This commit is contained in:
parent
ac87fdff97
commit
6cc12528b3
9 changed files with 15 additions and 8 deletions
|
@ -58,7 +58,6 @@ export default function(state, emitter) {
|
|||
emitter.on('changeLimit', async ({ file, value }) => {
|
||||
const ok = await file.changeLimit(value, state.user);
|
||||
if (!ok) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
state.storage.writeFile(file);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* global AUTH_CONFIG */
|
||||
import { arrayToB64, b64ToArray } from './utils';
|
||||
|
||||
const encoder = new TextEncoder();
|
||||
|
@ -175,6 +176,6 @@ export async function deriveFileListKey(ikm) {
|
|||
|
||||
export async function getFileListKey(storage, bundle) {
|
||||
const jwks = await decryptBundle(storage, bundle);
|
||||
const jwk = jwks['https://identity.mozilla.com/apps/send'];
|
||||
const jwk = jwks[AUTH_CONFIG.key_scope];
|
||||
return deriveFileListKey(jwk.k);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ export default function initialize(state, emitter) {
|
|||
cm6: storage.files.length,
|
||||
cm7: storage.totalDownloads
|
||||
});
|
||||
//TODO restart handlers... somewhere
|
||||
});
|
||||
emitter.on('exit', exitEvent);
|
||||
emitter.on('experiment', experimentEvent);
|
||||
|
|
|
@ -112,7 +112,7 @@ self.onfetch = event => {
|
|||
const req = event.request;
|
||||
if (req.method !== 'GET') return;
|
||||
const url = new URL(req.url);
|
||||
const dlmatch = DOWNLOAD_URL.exec(url.pathname); // TODO use #hashkey
|
||||
const dlmatch = DOWNLOAD_URL.exec(url.pathname);
|
||||
if (dlmatch) {
|
||||
event.respondWith(decryptStream(dlmatch[1]));
|
||||
} else if (VERSIONED_ASSET.test(url.pathname)) {
|
||||
|
|
|
@ -73,7 +73,7 @@ export default class User {
|
|||
code_challenge,
|
||||
code_challenge_method: 'S256',
|
||||
response_type: 'code',
|
||||
scope: 'profile https://identity.mozilla.com/apps/send', //TODO param
|
||||
scope: `profile ${AUTH_CONFIG.key_scope}`,
|
||||
state,
|
||||
keys_jwk
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue