Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
1ceb41d6
Commit
1ceb41d6
authored
Jun 21, 2022
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
In cmd/ verify confirm sending on verify-send flag
parent
e29d36b9
No related branches found
No related tags found
1 merge request
!510
Release
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/callbacks.go
+6
-3
6 additions, 3 deletions
cmd/callbacks.go
cmd/root.go
+5
-4
5 additions, 4 deletions
cmd/root.go
with
11 additions
and
7 deletions
cmd/callbacks.go
+
6
−
3
View file @
1ceb41d6
...
@@ -10,6 +10,7 @@ package cmd
...
@@ -10,6 +10,7 @@ package cmd
import
(
import
(
"fmt"
"fmt"
"github.com/spf13/viper"
"gitlab.com/elixxir/client/xxdk"
"gitlab.com/elixxir/client/xxdk"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
...
@@ -46,10 +47,12 @@ func (a *authCallbacks) Request(requestor contact.Contact,
...
@@ -46,10 +47,12 @@ func (a *authCallbacks) Request(requestor contact.Contact,
if
a
.
autoConfirm
{
if
a
.
autoConfirm
{
jww
.
INFO
.
Printf
(
"Channel Request: %s"
,
jww
.
INFO
.
Printf
(
"Channel Request: %s"
,
requestor
.
ID
)
requestor
.
ID
)
_
,
err
:=
a
.
client
.
GetAuth
()
.
Confirm
(
requestor
)
if
viper
.
GetBool
(
"verify-sends"
)
{
// Verify message sends were successful
if
err
!=
nil
{
acceptChannelVerified
(
a
.
client
,
requestor
.
ID
)
jww
.
FATAL
.
Panicf
(
"%+v"
,
err
)
}
else
{
acceptChannel
(
a
.
client
,
requestor
.
ID
)
}
}
a
.
confCh
<-
requestor
.
ID
a
.
confCh
<-
requestor
.
ID
}
}
...
...
This diff is collapsed.
Click to expand it.
cmd/root.go
+
5
−
4
View file @
1ceb41d6
...
@@ -263,12 +263,11 @@ var rootCmd = &cobra.Command{
...
@@ -263,12 +263,11 @@ var rootCmd = &cobra.Command{
// Accept auth request for this recipient
// Accept auth request for this recipient
authConfirmed
:=
false
authConfirmed
:=
false
paramsE2E
:=
e2e
.
GetDefaultParams
()
paramsE2E
:=
e2e
.
GetDefaultParams
()
roundTimeout
:=
paramsE2E
.
CMIXParams
.
SendTimeout
if
viper
.
GetBool
(
"accept-channel"
)
{
if
viper
.
GetBool
(
"accept-channel"
)
{
// Verify that the confirmation message makes it to the
// Verify that the confirmation message makes it to the
// original sender
// original sender
if
viper
.
GetBool
(
"verify-sends"
)
{
if
viper
.
GetBool
(
"verify-sends"
)
{
acceptChannelVerified
(
client
,
recipientID
,
roundTimeout
)
acceptChannelVerified
(
client
,
recipientID
)
}
else
{
}
else
{
// Accept channel, agnostic of round result
// Accept channel, agnostic of round result
acceptChannel
(
client
,
recipientID
)
acceptChannel
(
client
,
recipientID
)
...
@@ -832,8 +831,10 @@ func resetAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID,
...
@@ -832,8 +831,10 @@ func resetAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID,
}
}
}
}
func
acceptChannelVerified
(
client
*
xxdk
.
E2e
,
recipientID
*
id
.
ID
,
func
acceptChannelVerified
(
client
*
xxdk
.
E2e
,
recipientID
*
id
.
ID
)
{
roundTimeout
time
.
Duration
)
{
paramsE2E
:=
e2e
.
GetDefaultParams
()
roundTimeout
:=
paramsE2E
.
CMIXParams
.
SendTimeout
done
:=
make
(
chan
struct
{},
1
)
done
:=
make
(
chan
struct
{},
1
)
retryChan
:=
make
(
chan
struct
{},
1
)
retryChan
:=
make
(
chan
struct
{},
1
)
for
{
for
{
...
...
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