Skip to content

Conversation

chaehni
Copy link

@chaehni chaehni commented Oct 18, 2019

Fixes #2892


This change is Reviewable

@chaehni chaehni added the c/hidden paths Hidden paths service label Oct 18, 2019
@lukedirtwalker lukedirtwalker self-assigned this Oct 21, 2019
@lukedirtwalker lukedirtwalker self-requested a review October 21, 2019 05:53
Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a 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 r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @chaehni)


go/hidden_path_srv/internal/hpcfgreq/handler.go, line 29 at r1 (raw file):

)

type hpCfgReqHandler struct {

this can simply be called handler.


go/hidden_path_srv/internal/hpcfgreq/handler.go, line 37 at r1 (raw file):

// NewCfgReqHandler returns a hidden path configuration request handler
func NewCfgReqHandler(groups []*hiddenpath.Group, ia addr.IA) infra.Handler {

I think NewHandler would be enough, for callers it would now be hpcfgreq.NewCfgReqHandler, buthpcfgreq.NewHandler should be descriptive enough.


go/hidden_path_srv/internal/hpcfgreq/handler.go, line 89 at r1 (raw file):

	}

	reply := &path_mgmt.HPCfgReply{Cfgs: h.groupMap[snetPeer.IA]}

Hm so from the if condition above it seems that snetPeer.IA is always equal to h.localIA so I wonder why we even need a map? couldn't we just store the list for our IA?


go/hidden_path_srv/internal/hpcfgreq/handler_test.go, line 43 at r1 (raw file):

	as110 = xtest.MustParseAS("ff00:0:110")
	as111 = xtest.MustParseAS("ff00:0:111")
	ia110 = xtest.MustParseIA("1-ff00:0:110")

You could reuse this:

	ia110 = xtest.MustParseIA("1-ff00:0:110")
	ia111 = xtest.MustParseIA("1-ff00:0:111")
	as110 = ia110.A
	as111 = ia111.A

go/hidden_path_srv/internal/hpcfgreq/handler_test.go, line 69 at r1 (raw file):

	Id: hiddenpath.GroupId{
		OwnerAS: as111,
		Suffix:  0xacdc,

👍


go/hidden_path_srv/internal/hpcfgreq/handler_test.go, line 97 at r1 (raw file):

			peer := &snet.Addr{
				IA:   ia110,
				Host: addr.NewSVCUDPAppAddr(addr.SvcHPS),

Nit: It would not be the HPS but rather sciond or something that requests. I think you could leave the host part empty for this test.

@chaehni chaehni force-pushed the hidden_path_implementation branch from d927462 to b33b023 Compare October 22, 2019 11:59
Copy link
Author

@chaehni chaehni left a 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 3 files reviewed, 4 unresolved discussions (waiting on @lukedirtwalker)


go/hidden_path_srv/internal/hpcfgreq/handler.go, line 29 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

this can simply be called handler.

Done.


go/hidden_path_srv/internal/hpcfgreq/handler.go, line 37 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

I think NewHandler would be enough, for callers it would now be hpcfgreq.NewCfgReqHandler, buthpcfgreq.NewHandler should be descriptive enough.

Done.


go/hidden_path_srv/internal/hpcfgreq/handler.go, line 89 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

Hm so from the if condition above it seems that snetPeer.IA is always equal to h.localIA so I wonder why we even need a map? couldn't we just store the list for our IA?

True. I added the if-condition later and forgot to remove the map.


go/hidden_path_srv/internal/hpcfgreq/handler_test.go, line 43 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

You could reuse this:

	ia110 = xtest.MustParseIA("1-ff00:0:110")
	ia111 = xtest.MustParseIA("1-ff00:0:111")
	as110 = ia110.A
	as111 = ia111.A

Done.


go/hidden_path_srv/internal/hpcfgreq/handler_test.go, line 69 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

👍

:)

Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@lukedirtwalker lukedirtwalker merged commit 4128537 into scionproto:master Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/hidden paths Hidden paths service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HP: Add HPGCfgReqHandler
2 participants