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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
20c206ea
Commit
20c206ea
authored
4 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
added a function to the api to lookup received request
parent
a17cd6a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/authenticatedChannel.go
+9
-1
9 additions, 1 deletion
api/authenticatedChannel.go
with
9 additions
and
1 deletion
api/authenticatedChannel.go
+
9
−
1
View file @
20c206ea
...
...
@@ -52,6 +52,14 @@ func (c *Client) RegisterAuthCallbacks(request auth.RequestCallback,
return
nil
}
// GetAuthenticatedChannelRequest returns the contact received in a request if
// one exists for the given userID. Returns an error if no contact is found.
func
(
c
*
Client
)
GetAuthenticatedChannelRequest
(
partner
*
id
.
ID
)
(
contact
.
Contact
,
error
)
{
jww
.
INFO
.
Printf
(
"GetAuthenticatedChannelRequest(%s)"
,
partner
)
return
c
.
storage
.
Auth
()
.
GetReceivedRequestData
(
partner
)
}
// ConfirmAuthenticatedChannel creates an authenticated channel out of a valid
// received request and sends a message to the requestor that the request has
// been confirmed
...
...
@@ -60,7 +68,7 @@ func (c *Client) RegisterAuthCallbacks(request auth.RequestCallback,
// exist, or if the passed in contact does not exactly match the received
// request
func
(
c
*
Client
)
ConfirmAuthenticatedChannel
(
recipient
contact
.
Contact
)
error
{
jww
.
INFO
.
Printf
(
"
Request
AuthenticatedChannel(%s)"
,
recipient
.
ID
)
jww
.
INFO
.
Printf
(
"
Confirm
AuthenticatedChannel(%s)"
,
recipient
.
ID
)
if
!
c
.
network
.
GetHealthTracker
()
.
IsHealthy
()
{
return
errors
.
New
(
"Cannot request authenticated channel "
+
...
...
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