Commit graph

5 commits

Author SHA1 Message Date
ffranr
a0e63124c0
multi: reformat long lines for readability
- Replace occurrences of `// nolint:lll` with `// nolint:ll` across
  files for consistency.
- Reformat multiline strings, comments, and function parameters to
  improve clarity and adhere to style guidelines.
- Add `// nolint:ll` comments where necessary to prevent linter
  warnings.
2025-12-09 16:12:03 +00:00
Viktor Torstensson
5d8f03e241
sqlc+firewalldb: add GetAction SQL query
Add a new SQL query `GetAction` to retrieve a single action by its ID.
This query will be needed for the kvdb to SQL migration of actions
store.
2025-10-07 02:13:14 +02:00
Viktor Torstensson
01bc36ca41
multi: remove AddActionReq MacaroonIdentifier
As the `MacaroonRootKeyID` field of the `AddActionReq` struct also
contains the 4 bytes of the `MacaroonIdentifier`, we change all
call sites to instead use the last 4 bytes of the `MacaroonRootKeyID`
field. As the `MacaroonIdentifier` field therefore becomes redundant,
we also remove it.
2025-10-03 11:44:05 +02:00
Viktor Torstensson
651cc678fc
multi: persist full mac root key in sql actions db
When migrating the actions store from kvdb to sql, we will update the
existing actions to include the full mac root key, instead of just the
last 4 bytes (currently called `MacaroonIdentifier`). In order to do so,
we change the sql implementation of the `actions` store to persist the
full mac root key, instead of just the last 4 bytes. As no production
data in the sql actions store exists for users yet, it's fine for us to
change this without having to address old sql actions which only stored
the last 4 bytes.

Note though that since old actions stored in the kvdb implementation
only have the last 4 bytes of the mac root key persisted, we will only
ever persist the last 4 byte of the mac root key ID for kvdb actions.
When the actions are later read back from the kvdb store, the first 4
bytes of the mac root key ID will be padded with zeroes to make up the
full 8 bytes.
As no call site currently utilizes the full 8 bytes of the mac root key
ID, this is okay for now. When we later deprecate and remove the kvdb
implementation, we can then update the rest of `litd` to also use the
full mac root key ID.
2025-10-03 11:44:04 +02:00
Elle Mouton
3f7ae5b6c8
firewalldb: add SQL impl of Actions store
In this commit we let the firewalldb.SQLDB implement the ActionsDB. We
also ensure that all the action unit tests now run against the SQL impl.
2025-05-30 10:56:58 +02:00