-
Notifications
You must be signed in to change notification settings - Fork 13
Refactor Voucher Persistence Interfaces #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Voucher Persistence Interfaces #151
Conversation
03c3b8a to
ba89fa3
Compare
ba89fa3 to
2d37c54
Compare
b3d9cf9 to
5b70e31
Compare
499c50d to
ff7f8c0
Compare
Signed-off-by: Ben Krieger <[email protected]>
ff7f8c0 to
630d15f
Compare
|
TinyGo tests are failing. Once tinygo-org/tinygo#5058 is merged, the container hash in |
630d15f to
d8b4a55
Compare
Signed-off-by: Ben Krieger <[email protected]>
d8b4a55 to
8c77019
Compare
is that a requirement for this PR? or we can go ahead and review/merge this one? |
Let's start reviewing. The TinyGo fix can be separate. One thing about this PR is that it doesn't actually track onboarded state, because that's a bit nebulous. One concrete example we might wonder about is how might an owner service know to stop TO0 when using the Credential Reuse Protocol? |
I think there are specific things to look for in https://fidoalliance.org/specs/FDO/FIDO-Device-Onboard-PS-v1.1-20220419/FIDO-Device-Onboard-PS-v1.1-20220419.html#credreuse in order to make the right call (however complex).
Something like the above, the implementation can decide what to support anyway right? here we need to make sure we can tell we're in these cases I guess (or provide useful callback to inspect where we're at) |
|
I guess it's totally our call in the Owner service implementation to decide to actually support the reuse protocol at all (via a knob for instance)
|
| // compatibility. Therefore, it is an allowed state to have both the | ||
| // replacement voucher and the previous voucher. An implementation that | ||
| // does not need to work with Cloudflare D1 should use a transaction. | ||
| if err := db.AddVoucher(ctx, ov); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own education - not requesting a change or anything like that - but won't this fail if the GUIDs are the same rather than add an additional voucher with the same GUID? I'm no expert on sqlite but I thought that an INSERT would fail by default if there's already a record present with the same key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nm - I missed the fact that the passed guid is the guid of the voucher to be replaced (d'oh!) and is not the same guid used in the AddVoucher call. So yeah - this LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
test was an hiccup, re-run and now it's green, merging |
Fixes #140