Documentation ¶
Overview ¶
Package evidence is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterEvidenceStoreHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEvidenceStoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EvidenceStoreClient) error
- func RegisterEvidenceStoreHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEvidenceStoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EvidenceStoreServer) error
- func RegisterEvidenceStoreServer(s grpc.ServiceRegistrar, srv EvidenceStoreServer)
- type Evidence
- func (*Evidence) Descriptor() ([]byte, []int)deprecated
- func (x *Evidence) GetCertificationTargetId() string
- func (x *Evidence) GetExperimentalRelatedResourceIds() []string
- func (x *Evidence) GetId() string
- func (ev *Evidence) GetOntologyResource() ontology.IsResource
- func (x *Evidence) GetRaw() string
- func (x *Evidence) GetResource() *anypb.Any
- func (ev *Evidence) GetResourceId() string
- func (x *Evidence) GetTimestamp() *timestamppb.Timestamp
- func (x *Evidence) GetToolId() string
- func (*Evidence) ProtoMessage()
- func (x *Evidence) ProtoReflect() protoreflect.Message
- func (x *Evidence) Reset()
- func (x *Evidence) String() string
- type EvidenceHookFunc
- type EvidenceStoreClient
- type EvidenceStoreServer
- type EvidenceStore_StoreEvidencesClient
- type EvidenceStore_StoreEvidencesServer
- type Filter
- type GetEvidenceRequest
- func (*GetEvidenceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetEvidenceRequest) GetEvidenceId() string
- func (*GetEvidenceRequest) ProtoMessage()
- func (x *GetEvidenceRequest) ProtoReflect() protoreflect.Message
- func (x *GetEvidenceRequest) Reset()
- func (x *GetEvidenceRequest) String() string
- type ListEvidencesRequest
- func (*ListEvidencesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListEvidencesRequest) GetAsc() bool
- func (x *ListEvidencesRequest) GetFilter() *Filter
- func (x *ListEvidencesRequest) GetOrderBy() string
- func (x *ListEvidencesRequest) GetPageSize() int32
- func (x *ListEvidencesRequest) GetPageToken() string
- func (*ListEvidencesRequest) ProtoMessage()
- func (x *ListEvidencesRequest) ProtoReflect() protoreflect.Message
- func (x *ListEvidencesRequest) Reset()
- func (x *ListEvidencesRequest) String() string
- type ListEvidencesResponse
- func (*ListEvidencesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListEvidencesResponse) GetEvidences() []*Evidence
- func (x *ListEvidencesResponse) GetNextPageToken() string
- func (*ListEvidencesResponse) ProtoMessage()
- func (x *ListEvidencesResponse) ProtoReflect() protoreflect.Message
- func (x *ListEvidencesResponse) Reset()
- func (x *ListEvidencesResponse) String() string
- type StoreEvidenceRequest
- func (*StoreEvidenceRequest) Descriptor() ([]byte, []int)deprecated
- func (req *StoreEvidenceRequest) GetCertificationTargetId() string
- func (x *StoreEvidenceRequest) GetEvidence() *Evidence
- func (req *StoreEvidenceRequest) GetPayload() proto.Message
- func (*StoreEvidenceRequest) ProtoMessage()
- func (x *StoreEvidenceRequest) ProtoReflect() protoreflect.Message
- func (x *StoreEvidenceRequest) Reset()
- func (x *StoreEvidenceRequest) String() string
- type StoreEvidenceResponse
- type StoreEvidencesResponse
- func (*StoreEvidencesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StoreEvidencesResponse) GetStatus() bool
- func (x *StoreEvidencesResponse) GetStatusMessage() string
- func (*StoreEvidencesResponse) ProtoMessage()
- func (x *StoreEvidencesResponse) ProtoReflect() protoreflect.Message
- func (x *StoreEvidencesResponse) Reset()
- func (x *StoreEvidencesResponse) String() string
- type UnimplementedEvidenceStoreServer
- func (UnimplementedEvidenceStoreServer) GetEvidence(context.Context, *GetEvidenceRequest) (*Evidence, error)
- func (UnimplementedEvidenceStoreServer) ListEvidences(context.Context, *ListEvidencesRequest) (*ListEvidencesResponse, error)
- func (UnimplementedEvidenceStoreServer) StoreEvidence(context.Context, *StoreEvidenceRequest) (*StoreEvidenceResponse, error)
- func (UnimplementedEvidenceStoreServer) StoreEvidences(grpc.BidiStreamingServer[StoreEvidenceRequest, StoreEvidencesResponse]) error
- type UnsafeEvidenceStoreServer
Constants ¶
const ( EvidenceStore_StoreEvidence_FullMethodName = "/clouditor.evidence.v1.EvidenceStore/StoreEvidence" EvidenceStore_StoreEvidences_FullMethodName = "/clouditor.evidence.v1.EvidenceStore/StoreEvidences" EvidenceStore_ListEvidences_FullMethodName = "/clouditor.evidence.v1.EvidenceStore/ListEvidences" EvidenceStore_GetEvidence_FullMethodName = "/clouditor.evidence.v1.EvidenceStore/GetEvidence" )
Variables ¶
var EvidenceStore_ServiceDesc = grpc.ServiceDesc{ ServiceName: "clouditor.evidence.v1.EvidenceStore", HandlerType: (*EvidenceStoreServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "StoreEvidence", Handler: _EvidenceStore_StoreEvidence_Handler, }, { MethodName: "ListEvidences", Handler: _EvidenceStore_ListEvidences_Handler, }, { MethodName: "GetEvidence", Handler: _EvidenceStore_GetEvidence_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "StoreEvidences", Handler: _EvidenceStore_StoreEvidences_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "api/evidence/evidence_store.proto", }
EvidenceStore_ServiceDesc is the grpc.ServiceDesc for EvidenceStore service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_evidence_evidence_proto protoreflect.FileDescriptor
var File_api_evidence_evidence_store_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEvidenceStoreHandler ¶
func RegisterEvidenceStoreHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEvidenceStoreHandler registers the http handlers for service EvidenceStore to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEvidenceStoreHandlerClient ¶
func RegisterEvidenceStoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EvidenceStoreClient) error
RegisterEvidenceStoreHandlerClient registers the http handlers for service EvidenceStore to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EvidenceStoreClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EvidenceStoreClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EvidenceStoreClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterEvidenceStoreHandlerFromEndpoint ¶
func RegisterEvidenceStoreHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEvidenceStoreHandlerFromEndpoint is same as RegisterEvidenceStoreHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEvidenceStoreHandlerServer ¶
func RegisterEvidenceStoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EvidenceStoreServer) error
RegisterEvidenceStoreHandlerServer registers the http handlers for service EvidenceStore to "mux". UnaryRPC :call EvidenceStoreServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEvidenceStoreHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterEvidenceStoreServer ¶
func RegisterEvidenceStoreServer(s grpc.ServiceRegistrar, srv EvidenceStoreServer)
Types ¶
type Evidence ¶
type Evidence struct { // the ID in a uuid format Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // time of evidence creation Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty" gorm:"serializer:timestamppb;type:datetime"` // Reference to a certification target (e.g., service, organization) this evidence was gathered from CertificationTargetId string `` /* 126-byte string literal not displayed */ // Reference to the tool which provided the evidence ToolId string `protobuf:"bytes,4,opt,name=tool_id,json=toolId,proto3" json:"tool_id,omitempty"` // Optional. Contains the evidence in its original form without following a // defined schema, e.g. the raw JSON Raw *string `protobuf:"bytes,5,opt,name=raw,proto3,oneof" json:"raw,omitempty"` // Semantic representation of the Cloud resource according to our defined // ontology Resource *anypb.Any `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty" gorm:"serializer:anypb;type:json"` // Very experimental property. Use at own risk. This property will be deleted again. // // Related resource IDs. The assessment will wait until all evidences for related resource have arrived in the // assessment and are recent enough. In the future, this will be replaced with information in the "related" edges in // the resource. For now, this needs to be set manually in the evidence. ExperimentalRelatedResourceIds []string `` /* 180-byte string literal not displayed */ // contains filtered or unexported fields }
An evidence resource
func (*Evidence) Descriptor
deprecated
func (*Evidence) GetCertificationTargetId ¶
func (*Evidence) GetExperimentalRelatedResourceIds ¶
func (*Evidence) GetOntologyResource ¶
func (ev *Evidence) GetOntologyResource() ontology.IsResource
func (*Evidence) GetResource ¶
func (*Evidence) GetResourceId ¶
func (*Evidence) GetTimestamp ¶
func (x *Evidence) GetTimestamp() *timestamppb.Timestamp
func (*Evidence) ProtoMessage ¶
func (*Evidence) ProtoMessage()
func (*Evidence) ProtoReflect ¶
func (x *Evidence) ProtoReflect() protoreflect.Message
type EvidenceHookFunc ¶
type EvidenceStoreClient ¶
type EvidenceStoreClient interface { // Stores an evidence to the evidence storage. Part of the public API, also // exposed as REST. StoreEvidence(ctx context.Context, in *StoreEvidenceRequest, opts ...grpc.CallOption) (*StoreEvidenceResponse, error) // Stores a stream of evidences to the evidence storage and returns a response // stream. Part of the public API, not exposed as REST. StoreEvidences(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StoreEvidenceRequest, StoreEvidencesResponse], error) // Returns all stored evidences. Part of the public API, also exposed as REST. ListEvidences(ctx context.Context, in *ListEvidencesRequest, opts ...grpc.CallOption) (*ListEvidencesResponse, error) // Returns a particular stored evidence. Part of the public API, also exposed // as REST. GetEvidence(ctx context.Context, in *GetEvidenceRequest, opts ...grpc.CallOption) (*Evidence, error) }
EvidenceStoreClient is the client API for EvidenceStore service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Manages the storage of evidences
func NewEvidenceStoreClient ¶
func NewEvidenceStoreClient(cc grpc.ClientConnInterface) EvidenceStoreClient
type EvidenceStoreServer ¶
type EvidenceStoreServer interface { // Stores an evidence to the evidence storage. Part of the public API, also // exposed as REST. StoreEvidence(context.Context, *StoreEvidenceRequest) (*StoreEvidenceResponse, error) // Stores a stream of evidences to the evidence storage and returns a response // stream. Part of the public API, not exposed as REST. StoreEvidences(grpc.BidiStreamingServer[StoreEvidenceRequest, StoreEvidencesResponse]) error // Returns all stored evidences. Part of the public API, also exposed as REST. ListEvidences(context.Context, *ListEvidencesRequest) (*ListEvidencesResponse, error) // Returns a particular stored evidence. Part of the public API, also exposed // as REST. GetEvidence(context.Context, *GetEvidenceRequest) (*Evidence, error) // contains filtered or unexported methods }
EvidenceStoreServer is the server API for EvidenceStore service. All implementations must embed UnimplementedEvidenceStoreServer for forward compatibility.
Manages the storage of evidences
type EvidenceStore_StoreEvidencesClient ¶
type EvidenceStore_StoreEvidencesClient = grpc.BidiStreamingClient[StoreEvidenceRequest, StoreEvidencesResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type EvidenceStore_StoreEvidencesServer ¶
type EvidenceStore_StoreEvidencesServer = grpc.BidiStreamingServer[StoreEvidenceRequest, StoreEvidencesResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Filter ¶
type Filter struct { CertificationTargetId *string `` /* 132-byte string literal not displayed */ ToolId *string `protobuf:"bytes,2,opt,name=tool_id,json=toolId,proto3,oneof" json:"tool_id,omitempty"` // contains filtered or unexported fields }
Allows specifying Filters for ListEvidencesRequest
func (*Filter) Descriptor
deprecated
func (*Filter) GetCertificationTargetId ¶
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
func (*Filter) ProtoReflect ¶
func (x *Filter) ProtoReflect() protoreflect.Message
type GetEvidenceRequest ¶
type GetEvidenceRequest struct { EvidenceId string `protobuf:"bytes,1,opt,name=evidence_id,json=evidenceId,proto3" json:"evidence_id,omitempty"` // contains filtered or unexported fields }
func (*GetEvidenceRequest) Descriptor
deprecated
func (*GetEvidenceRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetEvidenceRequest.ProtoReflect.Descriptor instead.
func (*GetEvidenceRequest) GetEvidenceId ¶
func (x *GetEvidenceRequest) GetEvidenceId() string
func (*GetEvidenceRequest) ProtoMessage ¶
func (*GetEvidenceRequest) ProtoMessage()
func (*GetEvidenceRequest) ProtoReflect ¶
func (x *GetEvidenceRequest) ProtoReflect() protoreflect.Message
func (*GetEvidenceRequest) Reset ¶
func (x *GetEvidenceRequest) Reset()
func (*GetEvidenceRequest) String ¶
func (x *GetEvidenceRequest) String() string
type ListEvidencesRequest ¶
type ListEvidencesRequest struct { Filter *Filter `protobuf:"bytes,1,opt,name=filter,proto3,oneof" json:"filter,omitempty"` // page_size: 0 = default (50 is default value), > 0 = set value (i.e. page_size = 5 -> SQL-Limit = 5) PageSize int32 `protobuf:"varint,10,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,11,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` OrderBy string `protobuf:"bytes,12,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` Asc bool `protobuf:"varint,13,opt,name=asc,proto3" json:"asc,omitempty"` // contains filtered or unexported fields }
func (*ListEvidencesRequest) Descriptor
deprecated
func (*ListEvidencesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListEvidencesRequest.ProtoReflect.Descriptor instead.
func (*ListEvidencesRequest) GetAsc ¶
func (x *ListEvidencesRequest) GetAsc() bool
func (*ListEvidencesRequest) GetFilter ¶
func (x *ListEvidencesRequest) GetFilter() *Filter
func (*ListEvidencesRequest) GetOrderBy ¶
func (x *ListEvidencesRequest) GetOrderBy() string
func (*ListEvidencesRequest) GetPageSize ¶
func (x *ListEvidencesRequest) GetPageSize() int32
func (*ListEvidencesRequest) GetPageToken ¶
func (x *ListEvidencesRequest) GetPageToken() string
func (*ListEvidencesRequest) ProtoMessage ¶
func (*ListEvidencesRequest) ProtoMessage()
func (*ListEvidencesRequest) ProtoReflect ¶
func (x *ListEvidencesRequest) ProtoReflect() protoreflect.Message
func (*ListEvidencesRequest) Reset ¶
func (x *ListEvidencesRequest) Reset()
func (*ListEvidencesRequest) String ¶
func (x *ListEvidencesRequest) String() string
type ListEvidencesResponse ¶
type ListEvidencesResponse struct { Evidences []*Evidence `protobuf:"bytes,1,rep,name=evidences,proto3" json:"evidences,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
func (*ListEvidencesResponse) Descriptor
deprecated
func (*ListEvidencesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListEvidencesResponse.ProtoReflect.Descriptor instead.
func (*ListEvidencesResponse) GetEvidences ¶
func (x *ListEvidencesResponse) GetEvidences() []*Evidence
func (*ListEvidencesResponse) GetNextPageToken ¶
func (x *ListEvidencesResponse) GetNextPageToken() string
func (*ListEvidencesResponse) ProtoMessage ¶
func (*ListEvidencesResponse) ProtoMessage()
func (*ListEvidencesResponse) ProtoReflect ¶
func (x *ListEvidencesResponse) ProtoReflect() protoreflect.Message
func (*ListEvidencesResponse) Reset ¶
func (x *ListEvidencesResponse) Reset()
func (*ListEvidencesResponse) String ¶
func (x *ListEvidencesResponse) String() string
type StoreEvidenceRequest ¶
type StoreEvidenceRequest struct { Evidence *Evidence `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"` // contains filtered or unexported fields }
func (*StoreEvidenceRequest) Descriptor
deprecated
func (*StoreEvidenceRequest) Descriptor() ([]byte, []int)
Deprecated: Use StoreEvidenceRequest.ProtoReflect.Descriptor instead.
func (*StoreEvidenceRequest) GetCertificationTargetId ¶
func (req *StoreEvidenceRequest) GetCertificationTargetId() string
GetCertificationTargetId is a shortcut to implement CertificationTargetRequest. It returns the certification target ID of the inner object.
func (*StoreEvidenceRequest) GetEvidence ¶
func (x *StoreEvidenceRequest) GetEvidence() *Evidence
func (*StoreEvidenceRequest) GetPayload ¶
func (req *StoreEvidenceRequest) GetPayload() proto.Message
func (*StoreEvidenceRequest) ProtoMessage ¶
func (*StoreEvidenceRequest) ProtoMessage()
func (*StoreEvidenceRequest) ProtoReflect ¶
func (x *StoreEvidenceRequest) ProtoReflect() protoreflect.Message
func (*StoreEvidenceRequest) Reset ¶
func (x *StoreEvidenceRequest) Reset()
func (*StoreEvidenceRequest) String ¶
func (x *StoreEvidenceRequest) String() string
type StoreEvidenceResponse ¶
type StoreEvidenceResponse struct {
// contains filtered or unexported fields
}
StoreEvidenceResponse belongs to StoreEvidence, which uses a custom unary RPC and therefore requires a response message according to the style convention. Since no return values are required, this is empty.
func (*StoreEvidenceResponse) Descriptor
deprecated
func (*StoreEvidenceResponse) Descriptor() ([]byte, []int)
Deprecated: Use StoreEvidenceResponse.ProtoReflect.Descriptor instead.
func (*StoreEvidenceResponse) ProtoMessage ¶
func (*StoreEvidenceResponse) ProtoMessage()
func (*StoreEvidenceResponse) ProtoReflect ¶
func (x *StoreEvidenceResponse) ProtoReflect() protoreflect.Message
func (*StoreEvidenceResponse) Reset ¶
func (x *StoreEvidenceResponse) Reset()
func (*StoreEvidenceResponse) String ¶
func (x *StoreEvidenceResponse) String() string
type StoreEvidencesResponse ¶
type StoreEvidencesResponse struct { Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` StatusMessage string `protobuf:"bytes,2,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` // contains filtered or unexported fields }
StoreEvidencesResponse belongs to StoreEvidences, which uses a custom bidirectional streaming RPC and therefore requires a response message according to the style convention. The bidirectional streaming needs the status and its message in the response for error handling.
func (*StoreEvidencesResponse) Descriptor
deprecated
func (*StoreEvidencesResponse) Descriptor() ([]byte, []int)
Deprecated: Use StoreEvidencesResponse.ProtoReflect.Descriptor instead.
func (*StoreEvidencesResponse) GetStatus ¶
func (x *StoreEvidencesResponse) GetStatus() bool
func (*StoreEvidencesResponse) GetStatusMessage ¶
func (x *StoreEvidencesResponse) GetStatusMessage() string
func (*StoreEvidencesResponse) ProtoMessage ¶
func (*StoreEvidencesResponse) ProtoMessage()
func (*StoreEvidencesResponse) ProtoReflect ¶
func (x *StoreEvidencesResponse) ProtoReflect() protoreflect.Message
func (*StoreEvidencesResponse) Reset ¶
func (x *StoreEvidencesResponse) Reset()
func (*StoreEvidencesResponse) String ¶
func (x *StoreEvidencesResponse) String() string
type UnimplementedEvidenceStoreServer ¶
type UnimplementedEvidenceStoreServer struct{}
UnimplementedEvidenceStoreServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedEvidenceStoreServer) GetEvidence ¶
func (UnimplementedEvidenceStoreServer) GetEvidence(context.Context, *GetEvidenceRequest) (*Evidence, error)
func (UnimplementedEvidenceStoreServer) ListEvidences ¶
func (UnimplementedEvidenceStoreServer) ListEvidences(context.Context, *ListEvidencesRequest) (*ListEvidencesResponse, error)
func (UnimplementedEvidenceStoreServer) StoreEvidence ¶
func (UnimplementedEvidenceStoreServer) StoreEvidence(context.Context, *StoreEvidenceRequest) (*StoreEvidenceResponse, error)
func (UnimplementedEvidenceStoreServer) StoreEvidences ¶
func (UnimplementedEvidenceStoreServer) StoreEvidences(grpc.BidiStreamingServer[StoreEvidenceRequest, StoreEvidencesResponse]) error
type UnsafeEvidenceStoreServer ¶
type UnsafeEvidenceStoreServer interface {
// contains filtered or unexported methods
}
UnsafeEvidenceStoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EvidenceStoreServer will result in compilation errors.