/flaming-service

:fire: Firebase backend for My Shared Air distributed contact tracing.

Primary LanguageTypeScriptMIT LicenseMIT

🔥 flaming-server Build Status

Firebase backend for My Shared Air

Install and emulate locally

Needs Node 10 to work.

(cd function && yarn && yarn build)
firebase emulators:start

Collections

contactEvents

Collection for contact events from people who've got infected.

Document Structure

{
  token: string,      // Id from Bluetooth handshake
}

Permissions

Get Create Update Delete
Anyone Anyone with an document in dataAuthorizations, i.e. confirmed infection Nobody Nobody

dataAuthorizations

Authorizations of users that are allowed to share their data in the network. Issues by licensed healthcare practitioners.

Document Structure

{
  _id: string                 // App ID of infected user
  bankIdCompletionData: {
    cert: {
      notAfter: string,       // End of BankID validity, Unix ms
      notBefore: string,      // Start of BankID validity, Unix ms
    },
    device: {
      ipAddress: string       // IP address of the user agent
    },
    ocspResponse: string,     // Base64-encoded signned OCSP response
    signature: string,        // Base64-encoded XML signature
    user: {
      givenName: string,
      name: string,
      personalNumber: string,
      surname: string,
    },
  },
  type: 'hcp'                 // Healthcare practicer
}

Permissions

Get Create Update Delete
Nobody Nobody Nobody Nobody

hcps

Licensed healthcare practitioners.

Document Structure

{
  _id: string,
  personalNumberHash: string  // SHA-3-512 encoded
}

Permissions

Get Create Update Delete
Nobody Nobody Nobody Nobody

deviceRegistrationTokens

Device registration tokens.

Document Structure

{
  _id: string,    // User ID
  token: string
}

Permissions

Get Create Update Delete
Nobody Anyone, if _id = auth.uid Nobody Nobody