Merge branch 'spencer/update-cic-meta' into 'master'

Add changes from stand-alone cic-meta repo.

See merge request grassrootseconomics/cic-internal-integration!41
This commit is contained in:
Spencer Ofwiti 2021-02-24 12:29:41 +00:00
commit 6fe87652ce
4 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,6 @@
node_modules
dist
dist-web
dist-server
scratch
tests

View File

@ -101,6 +101,18 @@ function parseDigest(url) {
async function processRequest(req, res) {
let digest = undefined;
const headers = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "OPTIONS, POST, GET, PUT",
"Access-Control-Max-Age": 2592000, // 30 days
"Access-Control-Allow-Headers": 'Access-Control-Allow-Origin, Content-Type, x-cic-automerge'
};
if (req.method === "OPTIONS") {
res.writeHead(200, headers);
res.end();
return;
}
if (!['PUT', 'GET', 'POST'].includes(req.method)) {
res.writeHead(405, {"Content-Type": "text/plain"});
@ -201,6 +213,7 @@ async function processRequest(req, res) {
const responseContentLength = (new TextEncoder().encode(content)).length;
res.writeHead(200, {
"Access-Control-Allow-Origin": "*",
"Content-Type": contentType,
"Content-Length": responseContentLength,
});

View File

@ -1,4 +1,4 @@
export { PGPSigner, PGPKeyStore } from './auth';
export { PGPSigner, PGPKeyStore, Signer } from './auth';
export { Envelope, Syncable } from './sync';
export { User } from './assets/user';
export { Phone } from './assets/phone';

View File

@ -93,7 +93,7 @@ function orderDict(src) {
return dst;
}
class Syncable implements JSONSerializable, Authoritative {
class Syncable implements JSONSerializable, Authoritative, Signable {
id: string
timestamp: number