-
Notifications
You must be signed in to change notification settings - Fork 162
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
TrustStore: Implement inserter #3225
Conversation
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.
Reviewed 1 of 6 files at r1.
Reviewable status: 1 of 6 files reviewed, all discussions resolved (waiting on @scrye)
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.
Reviewed 5 of 6 files at r1.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @oncilla)
a discussion (no related file):
Replace all the common.NewBasicError
with serrors
calls.
go/lib/infra/modules/trust/v2/export_test.go, line 32 at r1 (raw file):
// inserter for black-box testing. NewFwdInserter = newTestFwdInserter // NewInserter allows instantiating the private forwarding inserter for
extra forwarding
.
go/lib/infra/modules/trust/v2/export_test.go, line 65 at r1 (raw file):
} // newTestFwdInserter returns a new inserter for testing.
missing forwarding
.
go/lib/infra/modules/trust/v2/inserter.go, line 116 at r1 (raw file):
// InsertChain verifies the signed certificate chain and inserts it into the // database. The issuing TRC is queried through the provider function, when // necessary.Before insertion, the certificate chain is forwarded to the
Add a space before Before
.
go/lib/infra/modules/trust/v2/inserter_test.go, line 85 at r1 (raw file):
mctrl := gomock.NewController(t) defer mctrl.Finish() // Prepare the test.
Nit: You can delete the comments and leave a new line instead, it's less clutter. Code is self-explanatory.
go/lib/infra/modules/trust/v2/router.go, line 41 at r1 (raw file):
} // ChooseServer always routs to the local CS.
s/routs/routes
go/lib/infra/modules/trust/v2/router.go, line 88 at r1 (raw file):
info, err := r.db.GetTRCInfo(ctx, destination, scrypto.Version(scrypto.LatestVer)) notFound := xerrors.Is(err, ErrNotFound) switch {
Convert to cascaded if
, the fact that all cases are for err != nil
is a bit weird. Also, this gets rid of a notFound
predicate:
if err != nil {
if notFound {
return r.isd
}
return err
}
Adds: - Implement TRC verification and insertion logic. - The forwarding inserter registers the new trust material with the local certificate server before inserting into the database. It is supposed to be used by the beacon and path server.
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.
Reviewable status: 1 of 6 files reviewed, 6 unresolved discussions (waiting on @scrye)
a discussion (no related file):
Previously, scrye (Sergiu Costea) wrote…
Replace all the
common.NewBasicError
withserrors
calls.
Ah, cherry-picking without making sure it uses serrors :sad-panda:
go/lib/infra/modules/trust/v2/export_test.go, line 32 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
extra
forwarding
.
Done.
go/lib/infra/modules/trust/v2/export_test.go, line 65 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
missing
forwarding
.
Done.
go/lib/infra/modules/trust/v2/inserter.go, line 116 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
Add a space before
Before
.
Done.
go/lib/infra/modules/trust/v2/router.go, line 41 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
s/routs/routes
Done.
go/lib/infra/modules/trust/v2/router.go, line 88 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
Convert to cascaded
if
, the fact that all cases are forerr != nil
is a bit weird. Also, this gets rid of anotFound
predicate:if err != nil { if notFound { return r.isd } return err }
Done.
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.
Reviewed 5 of 5 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Adds:
local certificate server before inserting into the database.
It is supposed to be used by the beacon and path server.
This change is