-
Notifications
You must be signed in to change notification settings - Fork 173
TrustStore: Add TRC request handler #3499
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
Conversation
63c0bc3
to
9bbc143
Compare
9bbc143
to
d46df0a
Compare
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 4 of 4 files at r1.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @oncilla)
go/lib/infra/modules/trust/v2/handlers.go, line 28 at r1 (raw file):
// HandlerTimeout is the lifetime of the handlers. const HandlerTimeout = 3 * time.Second
Do we specifically care about the 3 seconds? isn't the default provided by the messenger "good enough" ?
go/lib/infra/modules/trust/v2/handlers.go, line 32 at r1 (raw file):
// trcReqHandler contains the state of a handler for a specific TRC Request // message, received via the Messenger's ListenAndServe method. type trcReqHandler struct {
I that is not public how can it be registered in the messenger in a main then?
go/lib/infra/modules/trust/v2/handlers.go, line 53 at r1 (raw file):
no Messenger found"
no ResponseWriter found
go/lib/infra/modules/trust/v2/handlers.go, line 53 at r1 (raw file):
logger.Warn
Make this an Error
log
go/lib/infra/modules/trust/v2/handlers.go, line 56 at r1 (raw file):
return infra.MetricsErrInternal } subCtx, cancelF := context.WithTimeout(h.request.Context(), HandlerTimeout)
I think it's good enough to just use the provided context.
At the top I would put:
ctx := request.Context()
logger := log.FromCtx(ctx)
go/lib/infra/modules/trust/v2/handlers.go, line 67 at r1 (raw file):
opts, h.request.Peer) if err != nil { logger.Error("[TrustStore:trcReqHandler] Unable to retrieve TRC", "err", err)
Shouldn't we reply with Nack
in this case?
d46df0a
to
04a3149
Compare
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 4 files reviewed, 6 unresolved discussions (waiting on @lukedirtwalker)
go/lib/infra/modules/trust/v2/handlers.go, line 28 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
Do we specifically care about the 3 seconds? isn't the default provided by the messenger "good enough" ?
copy-pasta from the old TS
Done.
go/lib/infra/modules/trust/v2/handlers.go, line 32 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
I that is not public how can it be registered in the messenger in a main then?
The trust store struct will have some factory methods that create the handlers.
As you will notice, this is not of type infra.Handler
go/lib/infra/modules/trust/v2/handlers.go, line 53 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
no Messenger found"
no ResponseWriter found
Done.
go/lib/infra/modules/trust/v2/handlers.go, line 53 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
logger.Warn
Make this an
Error
log
Done.
go/lib/infra/modules/trust/v2/handlers.go, line 56 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
I think it's good enough to just use the provided context.
At the top I would put:ctx := request.Context() logger := log.FromCtx(ctx)
Done.
go/lib/infra/modules/trust/v2/handlers.go, line 67 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
Shouldn't we reply with
Nack
in this case?
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 3 of 3 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
73ac675
to
978ae31
Compare
Add TRC request handler to the trust store. Currently, the PR is missing unit tests. fixes scionproto#3484
978ae31
to
878d221
Compare
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 3 of 3 files at r3.
Reviewable status:complete! all files reviewed, all discussions resolved
Add TRC request handler to the trust store.
fixes #3484
This change is