Commit graph

17 commits

Author SHA1 Message Date
Viktor Torstensson
c16ff48da6
migstreams: rename package to migsets 2026-05-14 11:39:12 +02:00
Viktor Torstensson
f78ddf1702
multi: rename MigrationStream names to MigrationSet 2026-05-14 11:39:09 +02:00
Viktor Torstensson
f90f468a32
multi: add dev kvdb to sql code migration
Add the necessary code to trigger the kvdb to sql code migration in dev
builds.
2026-05-14 11:38:35 +02:00
Viktor Torstensson
83f3e223fb
migstreams: introduce migstreams package
The upcoming kvdb to sql code migration will be added to as part of the
`sqldb/v2` migration stream. However, since the kvdb to sql migration
will need to use the migration functions present in the `accounts`,
`firewalldb`, and `session` packages, the migration will need to
referernce those packages. That would lead to a circular dependency
though if the migration stream was defined in the `db` package, as those
packages need to import the `db` package.

To avoid this, we introduce a new `migstreams` package that
contains the migration streams, and ensure that the `db` package doesn't
import the `migstreams` package.
2026-05-14 11:38:26 +02:00
Viktor Torstensson
297d203db2
firewalldb: use sqldb/v2 in firewalldb package
Update the firewalldb package to use the `sqldb/v2` package instead of
the older version.
2026-05-14 11:37:50 +02:00
Viktor Torstensson
252d1206b6
multi: use sqldb/v2 in session package
Update the session package to use the `sqldb/v2` package instead of the
older version.
2026-05-14 11:37:43 +02:00
Viktor Torstensson
b7ee351cb0
multi: use sqldb/v2 in accounts package
Update the accounts package to use the `sqldb/v2` package instead of the
older version.
2026-05-14 11:37:41 +02:00
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