Commit graph

6 commits

Author SHA1 Message Date
Elle Mouton
949c0bf7e2
multi: move macaroon helpers to macaroons dir
... and out of the `sessions` directory. This is to avoid import cycles
when we start explicitly linking accounts to sessions.
2025-02-09 10:37:40 +02:00
Elle Mouton
c8b78bd10d
session: add new ID-to-key index
This commit does a few things:

1. Instead of deriving IDs using the first 4 bytes of the session's
   serialised local pub key, we instead use bytes [1:5] in order to skip
   the first byte which is either 0x02 or 0x03. This results in a
   greater entropy set.
2. We also add a new index from ID to key and we write to this index
   each time a new session is added.
3. We add a `ReserveNewSessionID` method to the session store which will
   grind through private keys until it finds one that does not clash
   with the current ID set.
4. A migration is added to back-fill the ID-to-key index. If any old
   sessions are found that _do_ have a colliding ID, they are sorted by
   created time and all but the newest session is revoked. Only an entry
   for the newest session will be added to the ID-to-key index.
2023-08-30 11:46:33 +02:00
Elle Mouton
b59888cfa4
multi: let request logger persist Actions 2023-01-27 06:47:12 +02:00
Elle Mouton
78c996a7a1
multi: add Session ID to struct
This commit adds an ID to the Session struct. The ID is not persisted
but is instead derived from the macaroon used for the session.
2023-01-27 06:47:10 +02:00
Oliver Gugger
5d4ae278ef
multi: add super mac validator to proxy 2022-02-17 15:00:41 +01:00
Oliver Gugger
1ff2411cfe
session: add super macaroon root key ID
Whenever we bake a supermacaroon, we want it to be recognizable as such.
For that we use the 64bit unsigned integer that is used as the
macaroon's storage ID (or root key ID) and set the first 4 bytes to a
specific value that we can detect later on.
2022-02-15 10:41:43 +00:00