Skip to content

Commit

Permalink
Incoporate further review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Mar 20, 2024
1 parent e6a08b1 commit baa4b19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
15 changes: 7 additions & 8 deletions handler/store_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type StoreRPCServer struct {
Impl IStoreHandler
}


func (s *StoreRPCServer) GetName(args interface{}, resp *string) error {
*resp = s.Impl.GetName()
return nil
Expand All @@ -57,15 +56,15 @@ type SynthKeysArgs struct {
func (s *StoreRPCServer) SynthKeysFromRefValue(args SynthKeysArgs, resp *[]string) error {
var (
err error
swComp Endorsement
refVal Endorsement
)

err = json.Unmarshal(args.EndorsementJSON, &swComp)
err = json.Unmarshal(args.EndorsementJSON, &refVal)
if err != nil {
return fmt.Errorf("unmarshaling software component: %w", err)
return fmt.Errorf("unmarshaling reference value: %w", err)
}

*resp, err = s.Impl.SynthKeysFromRefValue(args.TenantID, &swComp)
*resp, err = s.Impl.SynthKeysFromRefValue(args.TenantID, &refVal)

return err
}
Expand Down Expand Up @@ -165,7 +164,7 @@ func (c StoreRPCClient) GetSupportedMediaTypes() []string {
return resp
}

func (s *StoreRPCClient) SynthKeysFromRefValue(tenantID string, swComp *Endorsement) ([]string, error) {
func (s *StoreRPCClient) SynthKeysFromRefValue(tenantID string, refVal *Endorsement) ([]string, error) {
var (
err error
resp []string
Expand All @@ -174,9 +173,9 @@ func (s *StoreRPCClient) SynthKeysFromRefValue(tenantID string, swComp *Endorsem

args.TenantID = tenantID

args.EndorsementJSON, err = json.Marshal(swComp)
args.EndorsementJSON, err = json.Marshal(refVal)
if err != nil {
return nil, fmt.Errorf("marshaling software component: %w", err)
return nil, fmt.Errorf("marshaling reference value: %w", err)
}

err = s.client.Call("Plugin.SynthKeysFromRefValue", args, &resp)
Expand Down
6 changes: 3 additions & 3 deletions vts/cmd/vts-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ func main() {
loader, log.Named("builtin"),
"evidence-handler")
if err != nil {
log.Fatalf("could not create BuiltinManagerWithLoader: %v", err)
log.Fatalf("could not create evidence BuiltinManagerWithLoader: %v", err)
}
endPluginManager, err = builtin.CreateBuiltinManagerWithLoader[handler.IEndorsementHandler](
loader, log.Named("builtin"),
"endorsement-handler")
if err != nil {
log.Fatalf("could not create BuiltinManagerWithLoader: %v", err)
log.Fatalf("could not create endorsement BuiltinManagerWithLoader: %v", err)
}
storePluginManager, err = builtin.CreateBuiltinManagerWithLoader[handler.IStoreHandler](
loader, log.Named("builtin"),
"store-handler")
if err != nil {
log.Fatalf("could not create BuiltinManagerWithLoader: %v", err)
log.Fatalf("could not create store BuiltinManagerWithLoader: %v", err)
}
} else {
log.Panicw("invalid SchemeLoader value", "SchemeLoader", config.SchemeLoader)
Expand Down

0 comments on commit baa4b19

Please sign in to comment.