Closed
Description
Specification
With the recent crypto update in #446, we have found that the JOSE library is not longer compatible, and not even with the webcrypto polyfill.
Since JOSE is easier to replace than x509, we have decided to remove JOSE entirely.
This affects several domains:
sigchain
- claims here are general JWS structures, with multiple signaturesidentities
- claims are being put on identity providers, but this was developed before we understood JOSE and JWS, these can now use specialised tokensnotifications
- using JWS to send "signed" messages, the encryption of these notification messages are reliant on P2P E2E encryption, but we don't store the messages as encrypted, they are stored unencrypted, but subsequently disk-encrypted, however we retain the signature of the messages as they are usefulsessions
- using JWS MAC authenticated tokens as a short-lived session token for authentication (remember you always exchange long-lived credentials for short-lived credentials)- Our tokens should be based on the Ed25519 RFC for JWS: https://www.rfc-editor.org/rfc/rfc8037#appendix-A.4
This is the relationship of JOSE to what we are doing:
Additional context
- Updating Crypto to use WebCrypto API and to replace RSA with ECC #446 (comment) - discussing the incompatibility
- Updating Crypto to use WebCrypto API and to replace RSA with ECC #446 (comment) - notes on JWS
- Updating Crypto to use WebCrypto API and to replace RSA with ECC #446 (comment) - notes on sigchain API renovation
- https://datatracker.ietf.org/doc/html/rfc7515 - JWS spec
- https://www.rfc-editor.org/rfc/rfc8037 - JWS with ed25519 spec
- https://sodium-friends.github.io/docs/docs/sha - in case we need to replace the SHA algo
Tasks
- Renaming
claims
totokens
, we will have a generic "Token" structure - Specialised tokens like
TokenClaim
orTokenSession
can then be used by various domains like sigchain, identities and notifications and sessions - Claims are now just a specific variant of the more general token.
- We store our domain types in the DB, but we can choose arbitrary "representations" of our tokens based on the JWS spec as compact, flattened or general representations. Although if we have multiple signatures, compact and flattened representations may not really make any sense.
- The sigchain, notifications, sessions and identities will be going through some renovation of their API in accordance with the latest ways of doing things.
- At the same time, record all the "reactive" points where property subscription could be useful, so this can be done in a subsequent issue.