Skip to content

Commit

Permalink
intent: SessionAuthProof (#33)
Browse files Browse the repository at this point in the history
* intent: SessionAuthProof

* fix: unit tests

* add missing file to vendored go-sequence

* refactor session auth proof

* signSessionAuthProof remove redundant args

* move signSessionAuthProof to sessions_auth_proof.go

* bump: go-sequence to v0.29.4
  • Loading branch information
marino39 committed Mar 26, 2024
1 parent e1bf574 commit 0961c84
Show file tree
Hide file tree
Showing 17 changed files with 471 additions and 90 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.1

require (
github.com/0xsequence/ethkit v1.23.0
github.com/0xsequence/go-sequence v0.29.2
github.com/0xsequence/go-sequence v0.29.4
github.com/0xsequence/nitrocontrol v0.3.0
github.com/BurntSushi/toml v1.3.2
github.com/aws/aws-sdk-go-v2 v1.25.2
Expand Down
18 changes: 18 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ github.com/0xsequence/go-ethauth v0.13.0 h1:ZaqFEEqy574A2b1P7vjpcy5tb4W/izn+A3sw
github.com/0xsequence/go-ethauth v0.13.0/go.mod h1:f3kx39S9F+W+qvZEB6bkKKbpUstmyB7goUntO3wvlhg=
github.com/0xsequence/go-sequence v0.29.2 h1:lAiGRWXHAxwq6IXaItKnm3Aqxh7FZSbzHBoUCPUjKGw=
github.com/0xsequence/go-sequence v0.29.2/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240313102021-ead7cda0231d h1:cmzr1e9rhTq7AJ4Xk/VFIzeYr9F/Njwzwz9sJNXr3NE=
github.com/0xsequence/go-sequence v0.29.3-0.20240313102021-ead7cda0231d/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240315143513-e02f2487ead1 h1:hfn0tZkkbAIWB0iqDJVcH+5l6ibcKN/hJ50wNd0+JD8=
github.com/0xsequence/go-sequence v0.29.3-0.20240315143513-e02f2487ead1/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240319111049-3376d7253d4d h1:Aoa5lyZXVx2CKcp6YTkI8gQC+Hvl3L8S1b3ebru8k/M=
github.com/0xsequence/go-sequence v0.29.3-0.20240319111049-3376d7253d4d/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240319113425-85c3d2496b6d h1:beXEl66tzy1yzSlKbGw2cKz2SCcr7m2JcGiiFg1YEVw=
github.com/0xsequence/go-sequence v0.29.3-0.20240319113425-85c3d2496b6d/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240319133003-6b24a30cde30 h1:2owCgSy36FzShWVEDJ9uBXm9Xphpi7JH4HVHWfsGRlY=
github.com/0xsequence/go-sequence v0.29.3-0.20240319133003-6b24a30cde30/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240320093217-e493239d67cc h1:c3HktnlPxM0hM54cxnVMp3z4Kwr29dSpOK0/dcfPnXo=
github.com/0xsequence/go-sequence v0.29.3-0.20240320093217-e493239d67cc/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240320093947-6576d1bb898b h1:dLVfEAFkaaKYjXyslYZ80dHp4A91fbf0JOgc6HmjbEI=
github.com/0xsequence/go-sequence v0.29.3-0.20240320093947-6576d1bb898b/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.3-0.20240320103018-3e55215de6eb h1:Qdl9NF2DSacGupgJy2LTJUT2EAA6u+fnvssycZOLudA=
github.com/0xsequence/go-sequence v0.29.3-0.20240320103018-3e55215de6eb/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/go-sequence v0.29.4 h1:qUcmfNRPSPj++04p6/Fj4WIAvGfZav25XUBV4qLG9tU=
github.com/0xsequence/go-sequence v0.29.4/go.mod h1:gZnfEzmC67Fr6Tp1TKVQP9Ic+grjV7TSzDW26vvQ/J8=
github.com/0xsequence/nitrocontrol v0.3.0 h1:D0/gX576zQhitrJnBfBrOFFufEOzh6f2jO/+2ynwIUA=
github.com/0xsequence/nitrocontrol v0.3.0/go.mod h1:sTG5akVPzoVr3unv/7h9aZGaT+BVGmvUMOdwXFeIEEA=
github.com/0xsequence/nsm v0.1.0 h1:gVOViRWPUW/c5VEmGy2gCw1az/nqP3gY7VD9V2+069k=
Expand Down
105 changes: 71 additions & 34 deletions proto/waas/wallet.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion rpc/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,16 @@ type walletServiceMock struct {
registeredSessions map[string]struct{}
}

func (w walletServiceMock) ProjectParentWalletStatus(ctx context.Context, projectID uint64) ([]*proto_wallet.ParentWalletStatus, error) {
//TODO implement me
panic("implement me")
}

func (w walletServiceMock) SessionAuthProof(ctx context.Context, intent *proto_wallet.Intent, proof *proto_wallet.SessionAuthProof) (*proto_wallet.IntentResponse, error) {
//TODO implement me
panic("implement me")
}

func newWalletServiceMock(registeredSessions []string) *walletServiceMock {
m := &walletServiceMock{
registeredSessions: make(map[string]struct{}),
Expand All @@ -592,7 +602,7 @@ func (w walletServiceMock) ProjectParentWallet(ctx context.Context, projectId ui
panic("implement me")
}

func (w walletServiceMock) DeployProjectParentWallet(ctx context.Context, projectId uint64, chainID uint64) (string, string, error) {
func (w walletServiceMock) DeployProjectParentWallet(ctx context.Context, projectId uint64, chainID string) (string, string, error) {
//TODO implement me
panic("implement me")
}
Expand Down
7 changes: 7 additions & 0 deletions rpc/intents.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ func (s *RPC) SendIntent(ctx context.Context, protoIntent *proto.Intent) (*proto
}
return makeIntentResponse("sessionsListed", sessions), nil

case intents.IntentNameSessionAuthProof:
intentTyped, err := intents.NewIntentTypedFromIntent[intents.IntentDataSessionAuthProof](intent)
if err != nil {
return nil, err
}
return s.sessionAuthProof(ctx, sess, intentTyped)

case intents.IntentNameSignMessage:
intentTyped, err := intents.NewIntentTypedFromIntent[intents.IntentDataSignMessage](intent)
if err != nil {
Expand Down

0 comments on commit 0961c84

Please sign in to comment.