Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
comms
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
comms
Commits
c0f0882d
Commit
c0f0882d
authored
4 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Turn on auth for gateway to gateway connections
parent
bce804ea
No related branches found
No related tags found
1 merge request
!58
Revert "Modify waiting lock"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
network/instance.go
+10
-1
10 additions, 1 deletion
network/instance.go
network/instance_test.go
+2
-0
2 additions, 0 deletions
network/instance_test.go
with
12 additions
and
1 deletion
network/instance.go
+
10
−
1
View file @
c0f0882d
...
@@ -587,6 +587,10 @@ func (i *Instance) GetPermissioningId() *id.ID {
...
@@ -587,6 +587,10 @@ func (i *Instance) GetPermissioningId() *id.ID {
}
}
func
(
i
*
Instance
)
connectGatewayToGateway
()
{
}
// Update host helper
// Update host helper
func
(
i
*
Instance
)
updateConns
(
def
*
ndf
.
NetworkDefinition
,
isGateway
,
isNode
bool
)
error
{
func
(
i
*
Instance
)
updateConns
(
def
*
ndf
.
NetworkDefinition
,
isGateway
,
isNode
bool
)
error
{
if
isGateway
{
if
isGateway
{
...
@@ -608,8 +612,13 @@ func (i *Instance) updateConns(def *ndf.NetworkDefinition, isGateway, isNode boo
...
@@ -608,8 +612,13 @@ func (i *Instance) updateConns(def *ndf.NetworkDefinition, isGateway, isNode boo
return
errors
.
Errorf
(
"Gateway ID invalid, collides with a "
+
return
errors
.
Errorf
(
"Gateway ID invalid, collides with a "
+
"hard coded ID. Invalid ID: %v"
,
gwid
.
Marshal
())
"hard coded ID. Invalid ID: %v"
,
gwid
.
Marshal
())
}
}
// If this entity is a gateway, other gateway hosts
// should have auth enabled. Otherwise, disable auth
gwParams
:=
connect
.
GetDefaultHostParams
()
gwParams
:=
connect
.
GetDefaultHostParams
()
if
i
.
comm
.
Id
.
GetType
()
!=
id
.
Gateway
{
gwParams
.
AuthEnabled
=
false
gwParams
.
AuthEnabled
=
false
}
_
,
err
:=
i
.
comm
.
AddHost
(
gwid
,
addr
,
[]
byte
(
gateway
.
TlsCertificate
),
gwParams
)
_
,
err
:=
i
.
comm
.
AddHost
(
gwid
,
addr
,
[]
byte
(
gateway
.
TlsCertificate
),
gwParams
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
WithMessagef
(
err
,
"Could not add gateway host %s"
,
gwid
)
return
errors
.
WithMessagef
(
err
,
"Could not add gateway host %s"
,
gwid
)
...
...
This diff is collapsed.
Click to expand it.
network/instance_test.go
+
2
−
0
View file @
c0f0882d
...
@@ -202,6 +202,7 @@ func setupComm(t *testing.T) (*Instance, *mixmessages.NDF) {
...
@@ -202,6 +202,7 @@ func setupComm(t *testing.T) (*Instance, *mixmessages.NDF) {
err
=
signature
.
Sign
(
f
,
privKey
)
err
=
signature
.
Sign
(
f
,
privKey
)
testManager
:=
connect
.
NewManagerTesting
(
t
)
testManager
:=
connect
.
NewManagerTesting
(
t
)
pc
:=
&
connect
.
ProtoComms
{
pc
:=
&
connect
.
ProtoComms
{
Id
:
id
.
NewIdFromString
(
"User"
,
id
.
User
,
t
),
Manager
:
testManager
,
Manager
:
testManager
,
}
}
i
,
err
:=
NewInstance
(
pc
,
baseNDF
,
baseNDF
,
nil
)
i
,
err
:=
NewInstance
(
pc
,
baseNDF
,
baseNDF
,
nil
)
...
@@ -363,6 +364,7 @@ func TestInstance_UpdateGatewayConnections(t *testing.T) {
...
@@ -363,6 +364,7 @@ func TestInstance_UpdateGatewayConnections(t *testing.T) {
secured
,
_
:=
NewSecuredNdf
(
testutils
.
NDF
)
secured
,
_
:=
NewSecuredNdf
(
testutils
.
NDF
)
testManager
:=
connect
.
NewManagerTesting
(
t
)
testManager
:=
connect
.
NewManagerTesting
(
t
)
pc
:=
&
connect
.
ProtoComms
{
pc
:=
&
connect
.
ProtoComms
{
Id
:
id
.
NewIdFromString
(
"User"
,
id
.
User
,
t
),
Manager
:
testManager
,
Manager
:
testManager
,
}
}
i
:=
Instance
{
i
:=
Instance
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment