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
6155ebae
Commit
6155ebae
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
move defaultauthcallbacks
parent
d2f2814d
No related branches found
No related tags found
1 merge request
!510
Release
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/e2e.go
+3
-26
3 additions, 26 deletions
bindings/e2e.go
xxdk/e2e.go
+22
-0
22 additions, 0 deletions
xxdk/e2e.go
with
25 additions
and
26 deletions
bindings/e2e.go
+
3
−
26
View file @
6155ebae
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
package
bindings
package
bindings
import
(
import
(
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/rounds"
"gitlab.com/elixxir/client/cmix/rounds"
"gitlab.com/elixxir/client/xxdk"
"gitlab.com/elixxir/client/xxdk"
...
@@ -49,7 +48,7 @@ func LoginE2e(cmixId int, callbacks AuthCallbacks, identity []byte) (*E2e, error
...
@@ -49,7 +48,7 @@ func LoginE2e(cmixId int, callbacks AuthCallbacks, identity []byte) (*E2e, error
var
authCallbacks
xxdk
.
AuthCallbacks
var
authCallbacks
xxdk
.
AuthCallbacks
if
callbacks
==
nil
{
if
callbacks
==
nil
{
authCallbacks
=
d
efaultAuthCallbacks
{}
authCallbacks
=
xxdk
.
D
efaultAuthCallbacks
{}
}
else
{
}
else
{
authCallbacks
=
&
authCallback
{
bindingsCbs
:
callbacks
}
authCallbacks
=
&
authCallback
{
bindingsCbs
:
callbacks
}
}
}
...
@@ -78,7 +77,7 @@ func LoginE2eEphemeral(cmixId int, callbacks AuthCallbacks, identity []byte) (*E
...
@@ -78,7 +77,7 @@ func LoginE2eEphemeral(cmixId int, callbacks AuthCallbacks, identity []byte) (*E
var
authCallbacks
xxdk
.
AuthCallbacks
var
authCallbacks
xxdk
.
AuthCallbacks
if
callbacks
==
nil
{
if
callbacks
==
nil
{
authCallbacks
=
d
efaultAuthCallbacks
{}
authCallbacks
=
xxdk
.
D
efaultAuthCallbacks
{}
}
else
{
}
else
{
authCallbacks
=
&
authCallback
{
bindingsCbs
:
callbacks
}
authCallbacks
=
&
authCallback
{
bindingsCbs
:
callbacks
}
}
}
...
@@ -103,7 +102,7 @@ func LoginE2eLegacy(cmixId int, callbacks AuthCallbacks) (*E2e, error) {
...
@@ -103,7 +102,7 @@ func LoginE2eLegacy(cmixId int, callbacks AuthCallbacks) (*E2e, error) {
var
authCallbacks
xxdk
.
AuthCallbacks
var
authCallbacks
xxdk
.
AuthCallbacks
if
callbacks
==
nil
{
if
callbacks
==
nil
{
authCallbacks
=
d
efaultAuthCallbacks
{}
authCallbacks
=
xxdk
.
D
efaultAuthCallbacks
{}
}
else
{
}
else
{
authCallbacks
=
&
authCallback
{
bindingsCbs
:
callbacks
}
authCallbacks
=
&
authCallback
{
bindingsCbs
:
callbacks
}
}
}
...
@@ -162,25 +161,3 @@ func (a *authCallback) Reset(partner contact.Contact,
...
@@ -162,25 +161,3 @@ func (a *authCallback) Reset(partner contact.Contact,
receptionID
receptionID
.
EphemeralIdentity
,
round
rounds
.
Round
,
_
*
xxdk
.
E2e
)
{
receptionID
receptionID
.
EphemeralIdentity
,
round
rounds
.
Round
,
_
*
xxdk
.
E2e
)
{
a
.
bindingsCbs
.
Reset
(
convertAuthCallbacks
(
partner
,
receptionID
,
round
))
a
.
bindingsCbs
.
Reset
(
convertAuthCallbacks
(
partner
,
receptionID
,
round
))
}
}
// defaultAuthCallbacks is a simple structure for providing a default Callbacks implementation
// It should generally not be used.
type
defaultAuthCallbacks
struct
{}
// Confirm will be called when an auth Confirm message is processed.
func
(
a
defaultAuthCallbacks
)
Confirm
(
contact
.
Contact
,
receptionID
.
EphemeralIdentity
,
rounds
.
Round
,
*
xxdk
.
E2e
)
{
jww
.
ERROR
.
Printf
(
"No valid auth callback assigned!"
)
}
// Request will be called when an auth Request message is processed.
func
(
a
defaultAuthCallbacks
)
Request
(
contact
.
Contact
,
receptionID
.
EphemeralIdentity
,
rounds
.
Round
,
*
xxdk
.
E2e
)
{
jww
.
ERROR
.
Printf
(
"No valid auth callback assigned!"
)
}
// Reset will be called when an auth Reset operation occurs.
func
(
a
defaultAuthCallbacks
)
Reset
(
contact
.
Contact
,
receptionID
.
EphemeralIdentity
,
rounds
.
Round
,
*
xxdk
.
E2e
)
{
jww
.
ERROR
.
Printf
(
"No valid auth callback assigned!"
)
}
This diff is collapsed.
Click to expand it.
xxdk/e2e.go
+
22
−
0
View file @
6155ebae
...
@@ -432,3 +432,25 @@ func (aca *authCallbacksAdapter) Reset(partner contact.Contact,
...
@@ -432,3 +432,25 @@ func (aca *authCallbacksAdapter) Reset(partner contact.Contact,
receptionID
receptionID
.
EphemeralIdentity
,
round
rounds
.
Round
)
{
receptionID
receptionID
.
EphemeralIdentity
,
round
rounds
.
Round
)
{
aca
.
ac
.
Reset
(
partner
,
receptionID
,
round
,
aca
.
e2e
)
aca
.
ac
.
Reset
(
partner
,
receptionID
,
round
,
aca
.
e2e
)
}
}
// DefaultAuthCallbacks is a simple structure for providing a default Callbacks implementation
// It should generally not be used.
type
DefaultAuthCallbacks
struct
{}
// Confirm will be called when an auth Confirm message is processed.
func
(
a
DefaultAuthCallbacks
)
Confirm
(
contact
.
Contact
,
receptionID
.
EphemeralIdentity
,
rounds
.
Round
,
*
E2e
)
{
jww
.
ERROR
.
Printf
(
"No valid auth callback assigned!"
)
}
// Request will be called when an auth Request message is processed.
func
(
a
DefaultAuthCallbacks
)
Request
(
contact
.
Contact
,
receptionID
.
EphemeralIdentity
,
rounds
.
Round
,
*
E2e
)
{
jww
.
ERROR
.
Printf
(
"No valid auth callback assigned!"
)
}
// Reset will be called when an auth Reset operation occurs.
func
(
a
DefaultAuthCallbacks
)
Reset
(
contact
.
Contact
,
receptionID
.
EphemeralIdentity
,
rounds
.
Round
,
*
E2e
)
{
jww
.
ERROR
.
Printf
(
"No valid auth callback assigned!"
)
}
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