go-tpm-tools
go-tpm-tools copied to clipboard
Refactor verifier for issue #418
trafficstars
See Issue #418
This PR makes the following changes:
- move package verifier out of package launcher. Package verifier is responsible to request to Verifier services, thus it is not only useful to package launcher.
- remove cloudLogger in package agent. Package agent is responsible for setting up evidence management for launcher, and launcher does not need the cloudLog flag option.
- refactor token command to depend on package verifier and remove its dependency on agent package.
- move rest_network_test.go test to agent_test. Not doing so lead to cyclic dependencies.
- move package oci to package verifier. Because oci is part of request to Verifier services.
- create package util for hosting common functions related to package verifier
- move fake_attestation_server, fake_metadata, fake_oauth2_server to package util. Because they are common functions for unit testing related to Google verifier service.
- extract common functions, GetAttestation function, GetRegion, GetRESTClient, to util. Because token command and package agent have these duplicate functions. And add unit test for the extracted functions.
/gcbrun
/gcbrun
/gcbrun
Hi @alexmwu ! Could you take a look?
Hi @alexmwu , I have added the description. Thanks for the comment!
/gcbrun
/gcbrun
/gcbrun
/gcbrun