Commit graph

10 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
Elle Mouton
89b807c3bb
lit: plug the SQL actions DB into the dev build 2025-05-30 10:57:00 +02:00
Elle Mouton
642a69f1c2
firewalldb: best effort link from actions to accounts
In this commit, we do our best to ensure that at least at the time of
action creation, if the account ID is set, then our bbolt actions store
impl will at least first check that the account really does exist. This
also forces us to update our tests in preparation for the SQL store
which will tightly couple the actions and accounts.
2025-05-21 14:14:13 +02:00
Elle Mouton
297313e9c1
firewalldb: add clock.Clock to firewalldb DB impls
In preparation for using the clock to get an Action's AttemptedAt time
in an upcoming commit, we let both the bbolt and SQL impls of the
firewalldb take a clock.
2025-05-13 08:06:16 +02:00
Elle Mouton
34620f84a1
lit: plug into dev build
Plug the new SQL version of the RulesDB into LiT for `dev` flag builds.
2025-04-16 09:43:02 +02:00
Elle Mouton
71718e8868
lit: make sure to always close stores on errored start-up
Ensure that if any store init in the `stores` struct creation fails,
then any successful stores are still closed during shutdown.
2025-04-03 16:27:02 +02:00
Elle Mouton
261c547622
firewalldb: add DB struct and Start/Stop methods
In this commit, we add a `DB` struct in the `firewalldb` package. This
struct will be responsible for housing abstract implementations of the
various stores in the `firewalldb`. For now, we start with just the
RulesDB. We also add Start&Stop methods for the struct in preparation
for future additions here - for now, these do nothing.

In the main LiT setup, we move the firewall.BoltDB and the new
firewalldb.DB to the `stores` struct and implement them in the two
`config_` files. For now, both varients create the Bbolt version of the
firewallDB and this is used to init the `firewalldb.DB` struct. This
will be changed in future commits where we will add a sql
implementation.
2025-04-03 09:02:47 +02:00
Elle Mouton
6dbf880341
multi: plug in sessions SQL DB
Let LiTd support a SQL db for the sessions store under the `dev` build
tag. This can be used via itests.
2025-03-25 16:58:02 +02:00
Elle Mouton
381d7d1776
config: Postgres and SQLite config options for accounts to dev build
In this commit, we expand the dev build's DevConfig options struct with
Postgres and SQL backend options that can be used to initialise the
account store.
2025-02-21 11:17:54 -03:00
Elle Mouton
7a091fc773
config: introduce the concept of DevConfig
In this commit, we introduce a DevConfig struct which is embedded in the
main lit Config struct. It is defined in two separate files that are
made mutually exclusive using the `dev` build tag. The idea of this
struct is that it allows us to expose additional config options to LiT
if we build in a development environment such as our itests. In other
words, we will be able to start developing features and testing them
before making them available to users via the production build.

As of this commit, both implementations of the struct are the same.
2025-02-21 11:17:21 -03:00