Commit graph

18 commits

Author SHA1 Message Date
Elle Mouton
a89b3502e4
firewall: extract SessionID from gRPC metadata
In this commit, we update our various firewall interceptors so that they
rely on the session ID passed via gRPC metadata to extract a session ID.
For the PrivacyMapper and RuleEnforcer, these _MUST_ always contain a
session ID and so we error out if one was not found. For the request
logger, the session ID is optional and so we pass it to the new
SessionID field in the AddActionReq - our bbolt actions DB will not make
use of this field on persistence (but our incoming SQL version will).
2025-05-16 11:57:39 +02:00
Elle Mouton
c1ee884626
multi: let most ActionDB methods take a context 2025-05-09 16:16:34 +02:00
Elle Mouton
b9ad66471d
multi+refactor: remove unnecessary type alias
Remove the `NewPrivacyMapDB` type alias. It is not needed.
2025-04-22 06:10:48 +02:00
Elle Mouton
7ce36d7e7d
multi: thread contexts through privacy map interfaces
Update the PrivacyMapDB interface methods to take contexts (both the
methods themselves and the call-back params) and then ensure all
implementations are updated and all call-sites pass contexts through
correctly.
2025-03-25 18:10:52 +02:00
Elle Mouton
190d3dc828
multi: rename GetSessionByID to GetSession
By default, we fetch records by an ID.
2025-03-04 17:34:31 +02:00
Elle Mouton
9642ce1656
session+firewall: pass context to GetSessionByID 2025-02-28 09:26:02 +02:00
Elle Mouton
21983bab75
rules: thread context through 2025-01-13 09:23:20 +02:00
bitromortac
7489f0a0b2
rules: pass in lnd connection identifier
We pass a random lnd connection identifier to the rule enforcer that is
unique per lnd connection lifetime. It is used to generate unique
request identifiers that amend the non-unique request identifiers that
are passed from lnd.
2024-07-02 15:04:26 +02:00
bitromortac
916ddec0d7
firewall: return altered intercepted message
This allows us to rewrite a request.
2024-07-02 15:04:25 +02:00
bitromortac
962d6667a8
firewall: error back for streaming rpcs 2024-07-02 15:04:25 +02:00
bitromortac
8f2ab273bb
rules: handle interfering rule violations
We collect errors of all rule enforcers, handling errors in all of them
should an error occur. This is to roll back state consistently.
2024-07-02 15:04:25 +02:00
bitromortac
1636bb2bd6
firewall+rules: map with privacy flags
We change the rule mapping to accept the newly added privacy flags. Peer
and channel restrictions can be controlled with privacy flags.
2024-04-25 14:49:46 +02:00
bitromortac
cb542a5015
firewall+firewalldb: add SessionDB interface
SessionDB is an interface that gives helper methods for how privacy
mapping should be done. A mock for SessionDB is added to save on some
code repetition, the privacy flags functionality is used in a later
test.
2024-04-25 14:49:45 +02:00
Elle Mouton
3c837a9bc6
firewall: map session ID to group ID 2023-08-30 12:34:29 +02:00
Elle Mouton
921874608c
firewall: update ActionsReadDB to get group actions 2023-08-30 12:34:29 +02:00
Elle Mouton
a7c5e97401
multi: implement rule-enforcer 2023-01-27 06:47:13 +02:00
Elle Mouton
edf195ebd9
firewall: changes to initial structure 2023-01-27 06:47:11 +02:00
Oliver Gugger
3f8789fb3e
firewall: implement firewall 2023-01-27 06:47:11 +02:00