Commit graph

23 commits

Author SHA1 Message Date
bitromortac
1e83df2225
session: add privacy flags to session tlvs
Privacy flags are stored within the session.
2024-04-25 14:49:45 +02:00
Elle Mouton
71cac8672f
session: add a CheckSessionGroupPredicate method
This method can be used to check that each session in a group passes for
a given predicate.
2023-08-30 12:34:29 +02:00
Elle Mouton
cc95a01923
session: add GetGroupID and GetSessionIDs methods
This commit adds new getters: `GetGroupID` and `GetSessionIDs` to the
session store which can be used to query the newly added indexes to get
the associated group ID for a session ID or the associated set of
session IDs for a group ID.
2023-08-30 12:34:28 +02:00
Elle Mouton
4bd8a5c03a
session: add GroupID field to Session
Add the new `GroupID1` field to the `Session` struct and ensure that the
new fields are properly serialised and deserialised.  The `GroupID` is
the ID of the first Session in a set of linked sessions.
2023-08-30 11:46:33 +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
d3a262600f
session: separate methods for creating vs updating a session 2023-08-25 16:02:13 +02:00
Elle Mouton
92575c8ed7
session: update the session Store interface 2023-08-25 14:20:12 +02:00
Elle Mouton
3b67325360
multi: implement lit-autopilot rpc server 2023-01-27 06:47:13 +02:00
Elle Mouton
5255e952d8
session: add WithPrivacy to Session type 2023-01-27 06:47:13 +02:00
Elle Mouton
4639e7e5ba
session+rpcserver: add feature config to session type 2023-01-27 06:47:13 +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
Elle Mouton
b73c3699d6
session: add RevokedAt field
This commit adds a RevokedAt field to the Session structure and sets the
value of the field to the current time when RevokeSession is called.
2023-01-10 10:43:26 +02:00
Elle Mouton
0311de1cb7
multi: change account session type and reserve type 4
In this commit, the Account session type is changed to be type 5 in
both the session proto and in the persisted Session. This is done so
that type 4 can be reserved for future use.
2022-12-06 12:50:27 +02:00
Oliver Gugger
fc4f4a4cca
multi: add account based LNC sessions 2022-12-02 10:10:02 +01:00
Oliver Gugger
cd741091be
session+accounts: add RPC server 2022-12-02 10:06:51 +01:00
Elle Mouton
d23073f8b0
litrpc+session: add CreatedAt member to Session 2022-08-18 18:37:44 +02:00
Oliver Gugger
1444e7a180
multi: bump all dependencies to latest versions 2022-06-24 16:18:14 +02:00
Oliver Gugger
472d8f4602
multi: persist remote static key for handshakev2
This commit re-enables the second handshake for LNC.
2022-06-23 10:32:43 +02:00
Oliver Gugger
30d13ff7bb
Revert "multi: persist remote static key for handshakev2"
This reverts commit 31713c6e3d.
We will bump LNC to the latest version once the Terminal Web UI is ready
to persist the keys as well.
2022-04-20 14:42:26 +02:00
Elle Mouton
31713c6e3d
multi: persist remote static key for handshakev2
In this commit, we update the go mod to point to the version of LNC that
contains the logic for handshake version 2. This requires that we pass
in a call back that LNC can call to persist the remote static key once
it is received. This then needs to be provided each time we start up the
session again.
2022-04-19 09:49:08 +02: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
Elle Mouton
72faf765a1
session: store macaroon recipe instead of macaroon
In this commit, the `macaroon` field of `Session` is removed and instead
a `MacaroonRecipe` is added.
2022-02-15 10:40:15 +00:00
Oliver Gugger
f6568ab8e8
session: add session package 2021-11-24 13:44:25 -05:00