Skip to content

Commit

Permalink
send auth and proof notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya committed Aug 15, 2023
1 parent 0200e3b commit dee1e57
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/iden3/go-rapidsnark/types v0.0.3
github.com/iden3/go-rapidsnark/verifier v0.0.5
github.com/iden3/go-schema-processor v1.3.1
github.com/iden3/iden3comm v1.1.0
github.com/iden3/iden3comm v1.1.1-0.20230810141028-42068fe8ad57
github.com/ipfs/go-ipfs-api v0.6.0
github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f
github.com/pkg/errors v0.9.1
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ github.com/iden3/go-schema-processor v1.3.1 h1:LJfFInfYGMOp0bTKKC17R8q4XI+VtqhFL
github.com/iden3/go-schema-processor v1.3.1/go.mod h1:NwJ1nuGdRlCFaN1/V6mS0AOAdvpLcGf4KKq0mluLG7U=
github.com/iden3/iden3comm v1.1.0 h1:feWurfGJV6YZyxi4J3U2jqQ+RUo0mo36Aoqyck1ZnHg=
github.com/iden3/iden3comm v1.1.0/go.mod h1:1bJHz0xNhwbQGDxYfVwMVYsdsMjFQRkHJF/eq5Rc9wE=
github.com/iden3/iden3comm v1.1.1-0.20230810101037-f49961bb9e6c h1:JSsDSdkhkZNPD6dwNG3jua1QWbTERmA+oALrcy+Q3aU=
github.com/iden3/iden3comm v1.1.1-0.20230810101037-f49961bb9e6c/go.mod h1:1bJHz0xNhwbQGDxYfVwMVYsdsMjFQRkHJF/eq5Rc9wE=
github.com/iden3/iden3comm v1.1.1-0.20230810105009-6a98a9309fed h1:2aBuvK/GPWiqMDu2NoNKp8X2Wrm6xEiQC0uH6oeyz7Y=
github.com/iden3/iden3comm v1.1.1-0.20230810105009-6a98a9309fed/go.mod h1:1bJHz0xNhwbQGDxYfVwMVYsdsMjFQRkHJF/eq5Rc9wE=
github.com/iden3/iden3comm v1.1.1-0.20230810141028-42068fe8ad57 h1:+UukNLBWlCIvUqDA79pHBCXYarGt6VQH2WsNJv9dUYs=
github.com/iden3/iden3comm v1.1.1-0.20230810141028-42068fe8ad57/go.mod h1:1bJHz0xNhwbQGDxYfVwMVYsdsMjFQRkHJF/eq5Rc9wE=
github.com/iden3/wasmer-go v0.0.1 h1:TZKh8Se8B/73PvWrcu+FTU9L1k5XYAmtFbioj7l0Uog=
github.com/iden3/wasmer-go v0.0.1/go.mod h1:ZnZBAO012M7o+Q1INXLRIxKQgEcH2FuwL0Iga8A4ufg=
github.com/ipfs/boxo v0.8.0 h1:UdjAJmHzQHo/j3g3b1bAcAXCj/GM6iTwvSlBDvPBNBs=
Expand Down
45 changes: 45 additions & 0 deletions transport/notification.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package transport

import (
"context"
"encoding/json"

"github.com/iden3/go-schema-processor/verifiable"
"github.com/iden3/iden3comm/protocol"
"github.com/iden3/iden3comm/transport/notification"
"github.com/pkg/errors"
)

func SendAuthRequest(

Check failure on line 13 in transport/notification.go

View workflow job for this annotation

GitHub Actions / lint

exported: exported function SendAuthRequest should have comment or be unexported (revive)
ctx context.Context,
diddoc verifiable.DIDDocument,
authMsg protocol.AuthorizationRequestMessage,
) (*notification.UserNotificationResult, error) {
authMsgBytes, err := json.Marshal(authMsg)
if err != nil {
return nil, errors.WithStack(err)
}
return notification.Notify(
ctx,
authMsgBytes,
diddoc,
nil,
)
}

func SendContractInvokeRequest(

Check failure on line 30 in transport/notification.go

View workflow job for this annotation

GitHub Actions / lint

exported: exported function SendContractInvokeRequest should have comment or be unexported (revive)
ctx context.Context,
diddoc verifiable.DIDDocument,
contractInvokeMsg protocol.ContractInvokeRequestMessage,
) (*notification.UserNotificationResult, error) {
ciMsgBytes, err := json.Marshal(contractInvokeMsg)
if err != nil {
return nil, errors.WithStack(err)
}
return notification.Notify(
ctx,
ciMsgBytes,
diddoc,
nil,
)
}

0 comments on commit dee1e57

Please sign in to comment.