mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
f77ec5644a
CI / checkproto (push) Has been cancelled
CI / lint (push) Has been cancelled
Rust CI Pipeline / rust-check (push) Has been cancelled
CI / test (agent) (push) Has been cancelled
CI / test (cli) (push) Has been cancelled
CI / test (cmd) (push) Has been cancelled
CI / test (internal) (push) Has been cancelled
CI / test (manager, true) (push) Has been cancelled
CI / test (pkg) (push) Has been cancelled
CI / upload-coverage (push) Has been cancelled
* feat: Add Confidential Containers attestation agent as an alternative attestation backend with new proto definitions and build system integration. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix: Update protoc-gen-go and protoc-gen-go-grpc versions in CI workflow Signed-off-by: Sammy Oina <sammyoina@gmail.com> * feat: Add mock implementation for AttestationAgentServiceClient and corresponding tests Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix: Add missing periods to test function comments in provider_test.go Signed-off-by: Sammy Oina <sammyoina@gmail.com> --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com>
363 lines
13 KiB
Go
363 lines
13 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// 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"`
|
|
EatToken []byte `protobuf:"bytes,1,opt,name=eat_token,json=eatToken,proto3" json:"eat_token,omitempty"` // EAT token (JWT or CBOR format)
|
|
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) GetEatToken() []byte {
|
|
if x != nil {
|
|
return x.EatToken
|
|
}
|
|
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\"2\n" +
|
|
"\x13AttestationResponse\x12\x1b\n" +
|
|
"\teat_token\x18\x01 \x01(\fR\beatToken\")\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
|
|
}
|