Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request diff. #12

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bb4d4b1
Merge pull request #5 from trimble-oss/further_cleanup
joel-rieke Jul 11, 2023
4373747
AskFlume Changes for server initialization
meghan-bailey Jul 26, 2023
c3bdd65
grpc server client initialization changes
meghan-bailey Aug 15, 2023
a1dfe94
Removing Chatupsertelements
meghan-bailey Aug 15, 2023
2af8e4c
Add instructions for protoc installation.
joel-rieke Aug 18, 2023
2ab3958
Client initiating handshake with server
meghan-bailey Aug 22, 2023
a0b58b9
Messy version of Remote Server/Client initialization
meghan-bailey Aug 23, 2023
22474ec
Cleaned up version of remote client/server initialization
meghan-bailey Aug 23, 2023
d818b60
Fixed a comment
meghan-bailey Aug 23, 2023
abb3c2c
Merge pull request #7 from trimble-oss/askflumeChanges
meghan-bailey Aug 25, 2023
e78bc81
Fixing caller token formatting
meghan-bailey Aug 25, 2023
fec9103
Merge pull request #8 from trimble-oss/additionalAskFlumeChange
meghan-bailey Aug 25, 2023
8dc46e5
Added Flume Client initialization
meghan-bailey Aug 31, 2023
2935f01
Merge pull request #9 from trimble-oss/ignorantServerChange
joel-rieke Aug 31, 2023
b9262c1
Combined Remote and Flume client initialization
meghan-bailey Sep 7, 2023
218adcc
Combined Remote and Flume client initialization
meghan-bailey Sep 7, 2023
820cac2
Merge pull request #10 from trimble-oss/commonClientBootstrapChange
joel-rieke Sep 7, 2023
24b9990
Fixed method title and added comments
meghan-bailey Sep 8, 2023
bb44a14
Merge pull request #11 from trimble-oss/variableChange
joel-rieke Sep 8, 2023
54a0c55
Make condition more specific.
joel-rieke Sep 18, 2023
4ec3aba
Bump google.golang.org/grpc from 1.48.0 to 1.56.3
dependabot[bot] Oct 28, 2023
382d573
Merge pull request #14 from trimble-oss/dependabot/go_modules/google.…
joel-rieke Oct 28, 2023
decdc34
Bump golang.org/x/net from 0.7.0 to 0.17.0
dependabot[bot] Oct 28, 2023
81d0a5b
Bump golang.org/x/image from 0.0.0-20220601225756-64ec528b34cd to 0.10.0
dependabot[bot] Nov 2, 2023
f50d853
Merge pull request #13 from trimble-oss/dependabot/go_modules/golang.…
joel-rieke Dec 15, 2023
8661093
Merge branch 'main' into dependabot/go_modules/golang.org/x/image-0.10.0
joel-rieke Dec 15, 2023
f41bd16
Merge pull request #15 from trimble-oss/dependabot/go_modules/golang.…
joel-rieke Dec 15, 2023
7464f62
Simplify releases.
joel-rieke Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.png diff=exif
.* export-ignore
Makefile export-ignore
*.mp4 export-ignore
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
To run nute, use the following commands:
go mod download

Grpc layer enhancements, install protoc
https://grpc.io/docs/protoc-installation/

Build common components:
make mashupsdk

Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
gioui.org v0.0.0-20220318070519-8833a6738a3b
github.com/g3n/engine v0.2.0
golang.org/x/mobile v0.0.0-20220307220422-55113b94f09c
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.0
google.golang.org/grpc v1.56.3
google.golang.org/protobuf v1.30.0
)

require (
Expand All @@ -27,18 +27,18 @@ require (
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.3 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 // indirect
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 // indirect
github.com/stretchr/testify v1.7.2 // indirect
github.com/tevino/abool v1.2.0 // indirect
github.com/yuin/goldmark v1.4.0 // indirect
github.com/yuin/goldmark v1.4.13 // indirect
//golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20220714211235-042d03aeabc9 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect
Expand All @@ -47,16 +47,16 @@ require (
require (
fyne.io/fyne/v2 v2.1.3
golang.org/x/exp v0.0.0-20210722180016-6781d3edade3 // indirect
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/image v0.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
)

//require github.com/go-gl/glfw/v3.3.2/glfw v0.0.0-20211213063430-748e38ca8aec

require (
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b
golang.org/x/net v0.7.0 // indirect
golang.org/x/net v0.17.0 // indirect
)

// Uncomment for local development
Expand Down
40 changes: 22 additions & 18 deletions mashupsdk/client/apiimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ import (
"time"

"github.com/trimble-oss/tierceron-nute/mashupsdk"
sdk "github.com/trimble-oss/tierceron-nute/mashupsdk"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)

var clientDialOptions grpc.DialOption = grpc.EmptyDialOption{}

type MashupClient struct {
sdk.UnimplementedMashupServerServer
mashupsdk.UnimplementedMashupServerServer
mashupApiHandler mashupsdk.MashupApiHandler
}

Expand All @@ -37,7 +36,7 @@ func GetServerAuthToken() string {
}

// Shutdown -- handles request to shut down the mashup.
func (s *MashupClient) Shutdown(ctx context.Context, in *sdk.MashupEmpty) (*sdk.MashupEmpty, error) {
func (s *MashupClient) Shutdown(ctx context.Context, in *mashupsdk.MashupEmpty) (*mashupsdk.MashupEmpty, error) {
log.Println("Shutdown called")
if in.GetAuthToken() != serverConnectionConfigs.AuthToken {
return nil, errors.New("Auth failure")
Expand All @@ -48,28 +47,31 @@ func (s *MashupClient) Shutdown(ctx context.Context, in *sdk.MashupEmpty) (*sdk.
}()

log.Println("Shutdown initiated.")
return &sdk.MashupEmpty{}, nil
return &mashupsdk.MashupEmpty{}, nil
}

// CollaborateInit - Implementation of the handshake. During the callback from
// the mashup, construct new more permanent set of credentials to be shared.
func (c *MashupClient) CollaborateInit(ctx context.Context, in *sdk.MashupConnectionConfigs) (*sdk.MashupConnectionConfigs, error) {
func (c *MashupClient) CollaborateInit(ctx context.Context, in *mashupsdk.MashupConnectionConfigs) (*mashupsdk.MashupConnectionConfigs, error) {
log.Printf("CollaborateInit called")
if in.GetAuthToken() != handshakeConnectionConfigs.AuthToken {
return nil, errors.New("Auth failure")
return nil, errors.New("auth failure")
}
serverConnectionConfigs = &sdk.MashupConnectionConfigs{
serverConnectionConfigs = &mashupsdk.MashupConnectionConfigs{
AuthToken: in.CallerToken,
Server: in.Server,
Port: in.Port,
}

if mashupCertBytes == nil {
log.Fatalf("Cert not initialized.")
log.Printf("Cert not initialized.")
return nil, errors.New("cert initialization failure")
}
mashupBlock, _ := pem.Decode([]byte(mashupCertBytes))
mashupClientCert, err := x509.ParseCertificate(mashupBlock.Bytes)
if err != nil {
log.Fatalf("failed to serve: %v", err)
log.Printf("failed to serve: %v", err)
return nil, err
}

// Connect to the server for purposes of mashup api calls.
Expand All @@ -78,9 +80,10 @@ func (c *MashupClient) CollaborateInit(ctx context.Context, in *sdk.MashupConnec

log.Printf("Initiating connection to server with insecure: %t\n", *insecure)
// Connect to it.
conn, err := grpc.Dial("localhost:"+strconv.Itoa(int(serverConnectionConfigs.Port)), clientDialOptions, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ServerName: "", RootCAs: mashupCertPool, InsecureSkipVerify: *insecure})))
conn, err := grpc.Dial(serverConnectionConfigs.Server+":"+strconv.Itoa(int(serverConnectionConfigs.Port)), clientDialOptions, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ServerName: "", RootCAs: mashupCertPool, InsecureSkipVerify: *insecure})))
if err != nil {
log.Fatalf("did not connect: %v", err)
log.Printf("did not connect: %v", err)
return nil, err
}
log.Printf("Connection to server established.\n")

Expand All @@ -89,7 +92,7 @@ func (c *MashupClient) CollaborateInit(ctx context.Context, in *sdk.MashupConnec
// 1. If current application shuts down, mashup
// will also be told to shut down through Shutdown() api
// call before this app exits.
mashupContext.Client = sdk.NewMashupServerClient(conn)
mashupContext.Client = mashupsdk.NewMashupServerClient(conn)
log.Printf("Initiate signal handler.\n")

initSignalProcessor(mashupContext)
Expand All @@ -99,8 +102,9 @@ func (c *MashupClient) CollaborateInit(ctx context.Context, in *sdk.MashupConnec
handshakeCompleteChan <- true
}()

clientConnectionConfigs = &sdk.MashupConnectionConfigs{
AuthToken: sdk.GenAuthToken(), // client token.
clientConnectionConfigs = &mashupsdk.MashupConnectionConfigs{
AuthToken: mashupsdk.GenAuthToken(), // client token.
Server: handshakeConnectionConfigs.Server,
Port: handshakeConnectionConfigs.Port,
}
log.Printf("CollaborateInit complete.\n")
Expand All @@ -109,7 +113,7 @@ func (c *MashupClient) CollaborateInit(ctx context.Context, in *sdk.MashupConnec
}

// Shutdown -- handles request to shut down the mashup.
func (c *MashupClient) GetElements(ctx context.Context, in *sdk.MashupEmpty) (*sdk.MashupDetailedElementBundle, error) {
func (c *MashupClient) GetElements(ctx context.Context, in *mashupsdk.MashupEmpty) (*mashupsdk.MashupDetailedElementBundle, error) {
log.Printf("GetElements called")
if in.GetAuthToken() != serverConnectionConfigs.AuthToken {
return nil, errors.New("Auth failure")
Expand All @@ -123,7 +127,7 @@ func (c *MashupClient) GetElements(ctx context.Context, in *sdk.MashupEmpty) (*s
return nil, nil
}

func (c *MashupClient) TweakStates(ctx context.Context, in *sdk.MashupElementStateBundle) (*sdk.MashupElementStateBundle, error) {
func (c *MashupClient) TweakStates(ctx context.Context, in *mashupsdk.MashupElementStateBundle) (*mashupsdk.MashupElementStateBundle, error) {
log.Printf("TweakStates called")
if in.GetAuthToken() != serverConnectionConfigs.AuthToken {
log.Printf("Auth failure.")
Expand All @@ -138,7 +142,7 @@ func (c *MashupClient) TweakStates(ctx context.Context, in *sdk.MashupElementSta
return nil, nil
}

func (c *MashupClient) UpsertElements(ctx context.Context, in *sdk.MashupDetailedElementBundle) (*sdk.MashupDetailedElementBundle, error) {
func (c *MashupClient) UpsertElements(ctx context.Context, in *mashupsdk.MashupDetailedElementBundle) (*mashupsdk.MashupDetailedElementBundle, error) {
log.Printf("UpsertElements called")
if in.GetAuthToken() != serverConnectionConfigs.AuthToken {
return nil, errors.New("Auth failure")
Expand All @@ -152,7 +156,7 @@ func (c *MashupClient) UpsertElements(ctx context.Context, in *sdk.MashupDetaile
return nil, nil
}

func (c *MashupClient) OnDisplayChange(ctx context.Context, in *sdk.MashupDisplayBundle) (*sdk.MashupDisplayHint, error) {
func (c *MashupClient) OnDisplayChange(ctx context.Context, in *mashupsdk.MashupDisplayBundle) (*mashupsdk.MashupDisplayHint, error) {
log.Printf("OnDisplayChange called")
if in.GetAuthToken() != serverConnectionConfigs.AuthToken {
log.Printf("OnDisplayChange auth failure.")
Expand Down
Loading