Skip to content

Commit

Permalink
Addressed review feedback; removed getter, merged into action. Rename…
Browse files Browse the repository at this point in the history
…d and regenerated protobufs to reflect. Some tests to make codecov happy.

Signed-off-by: Matthew Burns <[email protected]>
  • Loading branch information
mattcburns committed Jan 3, 2024
1 parent a6e127b commit 98a1172
Show file tree
Hide file tree
Showing 12 changed files with 529 additions and 235 deletions.
276 changes: 137 additions & 139 deletions api/v1/diagnostic.pb.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions api/v1/diagnostic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import "api/v1/common.proto";
service Diagnostic {
rpc Screenshot (ScreenshotRequest) returns (ScreenshotResponse);
rpc ClearSystemEventLog (ClearSystemEventLogRequest) returns (ClearSystemEventLogResponse);
rpc GetSystemEventLog (GetSystemEventLogRequest) returns (GetSystemEventLogResponse);
rpc GetSystemEventLogRaw (GetSystemEventLogRawRequest) returns (GetSystemEventLogRawResponse);
rpc SystemEventLog (SystemEventLogRequest) returns (SystemEventLogResponse);
rpc SystemEventLogRaw (SystemEventLogRawRequest) returns (SystemEventLogRawResponse);
}

message ScreenshotRequest {
Expand All @@ -33,7 +33,7 @@ message ClearSystemEventLogResponse {
string task_id = 1;
}

message GetSystemEventLogRequest {
message SystemEventLogRequest {
v1.Authn authn = 1;
v1.Vendor vendor = 2;
}
Expand All @@ -45,15 +45,15 @@ message SystemEventLogEntry {
string message = 4;
}

message GetSystemEventLogResponse {
message SystemEventLogResponse {
repeated SystemEventLogEntry events = 1;
}

message GetSystemEventLogRawRequest {
message SystemEventLogRawRequest {
v1.Authn authn = 1;
v1.Vendor vendor = 2;
}

message GetSystemEventLogRawResponse {
message SystemEventLogRawResponse {
string log = 1;
}
8 changes: 4 additions & 4 deletions api/v1/diagnostic.validator.pb.go

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

56 changes: 28 additions & 28 deletions api/v1/diagnostic_grpc.pb.go

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

12 changes: 6 additions & 6 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func ClearSystemEventLog(ctx context.Context, client v1.DiagnosticClient, taskCl
return statusResp, nil
}

// GetSystemEventLog retrieves the System Event Log of the server.
func GetSystemEventLog(ctx context.Context, client v1.DiagnosticClient, request *v1.GetSystemEventLogRequest) (*v1.GetSystemEventLogResponse, error) {
return client.GetSystemEventLog(ctx, request)
// SystemEventLog retrieves the System Event Log of the server.
func SystemEventLog(ctx context.Context, client v1.DiagnosticClient, request *v1.SystemEventLogRequest) (*v1.SystemEventLogResponse, error) {
return client.SystemEventLog(ctx, request)
}

// GetSystemEventLogRaw retrieves the System Event Log of the server.
func GetSystemEventLogRaw(ctx context.Context, client v1.DiagnosticClient, request *v1.GetSystemEventLogRawRequest) (*v1.GetSystemEventLogRawResponse, error) {
return client.GetSystemEventLogRaw(ctx, request)
// SystemEventLogRaw retrieves the System Event Log of the server.
func SystemEventLogRaw(ctx context.Context, client v1.DiagnosticClient, request *v1.SystemEventLogRawRequest) (*v1.SystemEventLogRawResponse, error) {
return client.SystemEventLogRaw(ctx, request)
}
4 changes: 2 additions & 2 deletions cmd/sel.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var (
defer conn.Close()
client := v1.NewDiagnosticClient(conn)

resp, err := v1Client.GetSystemEventLog(ctx, client, &v1.GetSystemEventLogRequest{
resp, err := v1Client.SystemEventLog(ctx, client, &v1.SystemEventLogRequest{
Authn: &v1.Authn{
Authn: &v1.Authn_DirectAuthn{
DirectAuthn: &v1.DirectAuthn{
Expand Down Expand Up @@ -123,7 +123,7 @@ var (
defer conn.Close()
client := v1.NewDiagnosticClient(conn)

resp, err := v1Client.GetSystemEventLogRaw(ctx, client, &v1.GetSystemEventLogRawRequest{
resp, err := v1Client.SystemEventLogRaw(ctx, client, &v1.SystemEventLogRawRequest{
Authn: &v1.Authn{
Authn: &v1.Authn_DirectAuthn{
DirectAuthn: &v1.DirectAuthn{
Expand Down
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/coocood/freecache v1.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -74,6 +75,7 @@ require (
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/philippgille/gokv/encoding v0.6.0 // indirect
github.com/philippgille/gokv/util v0.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
Expand All @@ -83,6 +85,8 @@ require (
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stmcginnis/gofish v0.15.1-0.20231121142100-22a60a77be91 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ github.com/stmcginnis/gofish v0.15.1-0.20231121142100-22a60a77be91/go.mod h1:BLD
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
Expand All @@ -345,6 +346,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
8 changes: 4 additions & 4 deletions grpc/oob/diagnostic/diagnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

type Action struct {
common.Accessory
ScreenshotRequest *v1.ScreenshotRequest
ClearSystemEventLogRequest *v1.ClearSystemEventLogRequest
GetSystemEventLogRequest *v1.GetSystemEventLogRequest
GetSystemEventLogRawRequest *v1.GetSystemEventLogRawRequest
ScreenshotRequest *v1.ScreenshotRequest
ClearSystemEventLogRequest *v1.ClearSystemEventLogRequest
SystemEventLogRequest *v1.SystemEventLogRequest
SystemEventLogRawRequest *v1.SystemEventLogRawRequest
}

// WithLogger adds a logr to an Action struct.
Expand Down
Loading

0 comments on commit 98a1172

Please sign in to comment.