Skip to content

refactor: adapt database structure for openbao#1873

Draft
noaccOS wants to merge 1 commit intoastarte-platform:masterfrom
noaccOS:push-ysokpwovzkxz
Draft

refactor: adapt database structure for openbao#1873
noaccOS wants to merge 1 commit intoastarte-platform:masterfrom
noaccOS:push-ysokpwovzkxz

Conversation

@noaccOS
Copy link
Copy Markdown
Collaborator

@noaccOS noaccOS commented Mar 24, 2026

What this PR does / why we need it:

rework the database in preparation for openbao-based api/to2

Additional documentation e.g. usage docs, diagrams, reviewer notes, etc.:

depends on #1868


Thanks for sending a pull request! If this is your first time, here are some tips for you:
  1. You can take a look at our developer guide for an introduction on Astarte development!
  2. Make sure to read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  3. If the PR is unfinished or you're actively working on it, mark it as draft

When fixing existing issues, use github's syntax to link your pull request to it

fixes #<issue number>

We also have a syntax to signal dependencies to other open pull requests

depends on #<pr number>
depends on https://github.com/...

In case of stacked PRs, you may add the PR number in the last commit's title instead:

gitGraph
    commit id: "Current master"
    branch feat1
    checkout feat1
    commit id: "feat: add something"
    commit id: "feat: add something else (#100)"
    branch feat2
    checkout feat2
    commit id: "refactor: do something"
    commit id: "fix: solve issue"
    commit id: "feat: add a feature (#101)"
    branch feat3
    checkout feat3
    commit id: "feat: feat without pr number"
Loading

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.81%. Comparing base (7234b63) to head (1f5f425).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1873      +/-   ##
==========================================
- Coverage   83.82%   83.81%   -0.01%     
==========================================
  Files         572      572              
  Lines       10040    10040              
==========================================
- Hits         8416     8415       -1     
- Misses       1624     1625       +1     
Files with missing lines Coverage Δ
...keeping/lib/astarte_housekeeping/realms/queries.ex 90.84% <ø> (ø)
..._access/lib/astarte_data_access/fdo/to2_session.ex 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

Flag Coverage Δ
astarte_fdo_core 60.63% <ø> (ø)
astarte_generators 97.56% <ø> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +35 to +40
field :voucher_data, :binary
field :user_id, :binary
field :key_name, :string
field :replacement_guid, :binary
field :replacement_rv_info, CBOREncoded, using: RendezvousInfo
field :replacement_pub_key, CBOREncoded, using: PublicKey
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following irl discussion, we agreed that an optional "key_description" field would reasonable to have, in order to being able to differentiante without using super long key names. Not sure where to put it since we're not saving anything key related

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid openbao does not allow adding descriptions to the keys, and I don't think it's worth going through the trouble of having a local cache of the keys just to be able to add a description

Copy link
Copy Markdown
Contributor

@frossq frossq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💾

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it make sense to add also a field for the 'key_type'? It may ease some TO2 internal lookups

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo it's easy enough by reading ownershipvoucher.ovheader.ovpubkey.pktype

Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
@noaccOS noaccOS force-pushed the push-ysokpwovzkxz branch from 3b9355c to 1f5f425 Compare April 1, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants