// for backward compatibility
syntax = "proto3";

import "google/protobuf/timestamp.proto";

package trivy.detector;
option  go_package = "detector";

import "github.com/aquasecurity/trivy/rpc/common/service.proto";

service OSDetector {
  rpc Detect(OSDetectRequest) returns (DetectResponse);
}

message OSDetectRequest {
  string   os_family                   = 1;
  string   os_name                     = 2;
  repeated common.Package   packages   = 3;
  string                    image_name = 4;
  google.protobuf.Timestamp created    = 5;
}

message DetectResponse {
  repeated common.Vulnerability vulnerabilities = 1;
  bool                          eosl            = 2;
}

service LibDetector {
  rpc Detect(LibDetectRequest) returns (DetectResponse);
}

message LibDetectRequest {
  string   file_path                   = 1;
  repeated common.Library   libraries  = 2;
  string                    image_name = 3;
  google.protobuf.Timestamp created    = 4;
}
