mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-08-07 07:14:50 +00:00
NOISSUE - Introduce a dedicated attestation service and refactor agent to use its gRPC client (#558)
* feat: introduce a dedicated attestation service and refactor agent to use its gRPC client Signed-off-by: Sammy Oina <sammyoina@gmail.com> * feat: Source attestation-service from GitHub, updating its build and installation process. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix: update protoc version to 33.1 in CI workflow Signed-off-by: Sammy Oina <sammyoina@gmail.com> * refactor: Update Go build tag syntax, octal literals, and simplify agent attestation logic. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * chore: update igvmmeasure script's subdirectory path to tools/igvmmeasure Signed-off-by: Sammy Oina <sammyoina@gmail.com> * refactor: rename AttestationService RPC methods from `Get` to `Fetch` and update corresponding service implementation. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * refactor: rename attestation client methods from `GetX` to `FetchX` Signed-off-by: Sammy Oina <sammyoina@gmail.com> --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3f06971976
commit
c422afe0a6
@@ -0,0 +1,362 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.8
|
||||
// protoc v6.33.1
|
||||
// source: internal/proto/attestation/v1/attestation.proto
|
||||
|
||||
package attestation
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type PlatformType int32
|
||||
|
||||
const (
|
||||
PlatformType_PLATFORM_TYPE_UNSPECIFIED PlatformType = 0
|
||||
PlatformType_PLATFORM_TYPE_SNP PlatformType = 1
|
||||
PlatformType_PLATFORM_TYPE_TDX PlatformType = 2
|
||||
PlatformType_PLATFORM_TYPE_VTPM PlatformType = 3
|
||||
PlatformType_PLATFORM_TYPE_SNP_VTPM PlatformType = 4
|
||||
PlatformType_PLATFORM_TYPE_AZURE PlatformType = 5
|
||||
PlatformType_PLATFORM_TYPE_NO_CC PlatformType = 6
|
||||
)
|
||||
|
||||
// Enum value maps for PlatformType.
|
||||
var (
|
||||
PlatformType_name = map[int32]string{
|
||||
0: "PLATFORM_TYPE_UNSPECIFIED",
|
||||
1: "PLATFORM_TYPE_SNP",
|
||||
2: "PLATFORM_TYPE_TDX",
|
||||
3: "PLATFORM_TYPE_VTPM",
|
||||
4: "PLATFORM_TYPE_SNP_VTPM",
|
||||
5: "PLATFORM_TYPE_AZURE",
|
||||
6: "PLATFORM_TYPE_NO_CC",
|
||||
}
|
||||
PlatformType_value = map[string]int32{
|
||||
"PLATFORM_TYPE_UNSPECIFIED": 0,
|
||||
"PLATFORM_TYPE_SNP": 1,
|
||||
"PLATFORM_TYPE_TDX": 2,
|
||||
"PLATFORM_TYPE_VTPM": 3,
|
||||
"PLATFORM_TYPE_SNP_VTPM": 4,
|
||||
"PLATFORM_TYPE_AZURE": 5,
|
||||
"PLATFORM_TYPE_NO_CC": 6,
|
||||
}
|
||||
)
|
||||
|
||||
func (x PlatformType) Enum() *PlatformType {
|
||||
p := new(PlatformType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x PlatformType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (PlatformType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_internal_proto_attestation_v1_attestation_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (PlatformType) Type() protoreflect.EnumType {
|
||||
return &file_internal_proto_attestation_v1_attestation_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x PlatformType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PlatformType.Descriptor instead.
|
||||
func (PlatformType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_internal_proto_attestation_v1_attestation_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type AttestationRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ReportData []byte `protobuf:"bytes,1,opt,name=report_data,json=reportData,proto3" json:"report_data,omitempty"` // 64 bytes for SNP/TDX
|
||||
Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` // Nonce for vTPM
|
||||
PlatformType PlatformType `protobuf:"varint,3,opt,name=platform_type,json=platformType,proto3,enum=attestation.v1.PlatformType" json:"platform_type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AttestationRequest) Reset() {
|
||||
*x = AttestationRequest{}
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AttestationRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AttestationRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AttestationRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AttestationRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AttestationRequest) Descriptor() ([]byte, []int) {
|
||||
return file_internal_proto_attestation_v1_attestation_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AttestationRequest) GetReportData() []byte {
|
||||
if x != nil {
|
||||
return x.ReportData
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AttestationRequest) GetNonce() []byte {
|
||||
if x != nil {
|
||||
return x.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AttestationRequest) GetPlatformType() PlatformType {
|
||||
if x != nil {
|
||||
return x.PlatformType
|
||||
}
|
||||
return PlatformType_PLATFORM_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type AttestationResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Quote []byte `protobuf:"bytes,1,opt,name=quote,proto3" json:"quote,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AttestationResponse) Reset() {
|
||||
*x = AttestationResponse{}
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AttestationResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AttestationResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AttestationResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AttestationResponse.ProtoReflect.Descriptor instead.
|
||||
func (*AttestationResponse) Descriptor() ([]byte, []int) {
|
||||
return file_internal_proto_attestation_v1_attestation_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *AttestationResponse) GetQuote() []byte {
|
||||
if x != nil {
|
||||
return x.Quote
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AzureTokenRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AzureTokenRequest) Reset() {
|
||||
*x = AzureTokenRequest{}
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AzureTokenRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AzureTokenRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AzureTokenRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AzureTokenRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AzureTokenRequest) Descriptor() ([]byte, []int) {
|
||||
return file_internal_proto_attestation_v1_attestation_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *AzureTokenRequest) GetNonce() []byte {
|
||||
if x != nil {
|
||||
return x.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AzureTokenResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Token []byte `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AzureTokenResponse) Reset() {
|
||||
*x = AzureTokenResponse{}
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AzureTokenResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AzureTokenResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AzureTokenResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_internal_proto_attestation_v1_attestation_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AzureTokenResponse.ProtoReflect.Descriptor instead.
|
||||
func (*AzureTokenResponse) Descriptor() ([]byte, []int) {
|
||||
return file_internal_proto_attestation_v1_attestation_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *AzureTokenResponse) GetToken() []byte {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_internal_proto_attestation_v1_attestation_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_internal_proto_attestation_v1_attestation_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"/internal/proto/attestation/v1/attestation.proto\x12\x0eattestation.v1\"\x8e\x01\n" +
|
||||
"\x12AttestationRequest\x12\x1f\n" +
|
||||
"\vreport_data\x18\x01 \x01(\fR\n" +
|
||||
"reportData\x12\x14\n" +
|
||||
"\x05nonce\x18\x02 \x01(\fR\x05nonce\x12A\n" +
|
||||
"\rplatform_type\x18\x03 \x01(\x0e2\x1c.attestation.v1.PlatformTypeR\fplatformType\"+\n" +
|
||||
"\x13AttestationResponse\x12\x14\n" +
|
||||
"\x05quote\x18\x01 \x01(\fR\x05quote\")\n" +
|
||||
"\x11AzureTokenRequest\x12\x14\n" +
|
||||
"\x05nonce\x18\x01 \x01(\fR\x05nonce\"*\n" +
|
||||
"\x12AzureTokenResponse\x12\x14\n" +
|
||||
"\x05token\x18\x01 \x01(\fR\x05token*\xc1\x01\n" +
|
||||
"\fPlatformType\x12\x1d\n" +
|
||||
"\x19PLATFORM_TYPE_UNSPECIFIED\x10\x00\x12\x15\n" +
|
||||
"\x11PLATFORM_TYPE_SNP\x10\x01\x12\x15\n" +
|
||||
"\x11PLATFORM_TYPE_TDX\x10\x02\x12\x16\n" +
|
||||
"\x12PLATFORM_TYPE_VTPM\x10\x03\x12\x1a\n" +
|
||||
"\x16PLATFORM_TYPE_SNP_VTPM\x10\x04\x12\x17\n" +
|
||||
"\x13PLATFORM_TYPE_AZURE\x10\x05\x12\x17\n" +
|
||||
"\x13PLATFORM_TYPE_NO_CC\x10\x062\xcb\x01\n" +
|
||||
"\x12AttestationService\x12[\n" +
|
||||
"\x10FetchAttestation\x12\".attestation.v1.AttestationRequest\x1a#.attestation.v1.AttestationResponse\x12X\n" +
|
||||
"\x0fFetchAzureToken\x12!.attestation.v1.AzureTokenRequest\x1a\".attestation.v1.AzureTokenResponseBJZHgithub.com/ultravioletrs/cocos/internal/proto/attestation/v1;attestationb\x06proto3"
|
||||
|
||||
var (
|
||||
file_internal_proto_attestation_v1_attestation_proto_rawDescOnce sync.Once
|
||||
file_internal_proto_attestation_v1_attestation_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_internal_proto_attestation_v1_attestation_proto_rawDescGZIP() []byte {
|
||||
file_internal_proto_attestation_v1_attestation_proto_rawDescOnce.Do(func() {
|
||||
file_internal_proto_attestation_v1_attestation_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_internal_proto_attestation_v1_attestation_proto_rawDesc), len(file_internal_proto_attestation_v1_attestation_proto_rawDesc)))
|
||||
})
|
||||
return file_internal_proto_attestation_v1_attestation_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_internal_proto_attestation_v1_attestation_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_internal_proto_attestation_v1_attestation_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_internal_proto_attestation_v1_attestation_proto_goTypes = []any{
|
||||
(PlatformType)(0), // 0: attestation.v1.PlatformType
|
||||
(*AttestationRequest)(nil), // 1: attestation.v1.AttestationRequest
|
||||
(*AttestationResponse)(nil), // 2: attestation.v1.AttestationResponse
|
||||
(*AzureTokenRequest)(nil), // 3: attestation.v1.AzureTokenRequest
|
||||
(*AzureTokenResponse)(nil), // 4: attestation.v1.AzureTokenResponse
|
||||
}
|
||||
var file_internal_proto_attestation_v1_attestation_proto_depIdxs = []int32{
|
||||
0, // 0: attestation.v1.AttestationRequest.platform_type:type_name -> attestation.v1.PlatformType
|
||||
1, // 1: attestation.v1.AttestationService.FetchAttestation:input_type -> attestation.v1.AttestationRequest
|
||||
3, // 2: attestation.v1.AttestationService.FetchAzureToken:input_type -> attestation.v1.AzureTokenRequest
|
||||
2, // 3: attestation.v1.AttestationService.FetchAttestation:output_type -> attestation.v1.AttestationResponse
|
||||
4, // 4: attestation.v1.AttestationService.FetchAzureToken:output_type -> attestation.v1.AzureTokenResponse
|
||||
3, // [3:5] is the sub-list for method output_type
|
||||
1, // [1:3] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_internal_proto_attestation_v1_attestation_proto_init() }
|
||||
func file_internal_proto_attestation_v1_attestation_proto_init() {
|
||||
if File_internal_proto_attestation_v1_attestation_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_internal_proto_attestation_v1_attestation_proto_rawDesc), len(file_internal_proto_attestation_v1_attestation_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_internal_proto_attestation_v1_attestation_proto_goTypes,
|
||||
DependencyIndexes: file_internal_proto_attestation_v1_attestation_proto_depIdxs,
|
||||
EnumInfos: file_internal_proto_attestation_v1_attestation_proto_enumTypes,
|
||||
MessageInfos: file_internal_proto_attestation_v1_attestation_proto_msgTypes,
|
||||
}.Build()
|
||||
File_internal_proto_attestation_v1_attestation_proto = out.File
|
||||
file_internal_proto_attestation_v1_attestation_proto_goTypes = nil
|
||||
file_internal_proto_attestation_v1_attestation_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user