diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b8cb0fe..c3bcc2c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,20 +7,6 @@ on: pull_request: jobs: - # golangci must be the first job as it has different problems - golangci: - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.19 - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.49.0 - args: --timeout 5m - skip-pkg-cache: true test: runs-on: ubuntu-latest permissions: @@ -46,21 +32,3 @@ jobs: - uses: bufbuild/buf-breaking-action@v1 with: against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main" - codegen: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.19 - - name: Prepare - run: make install-tools - - name: generate - run: make generate - - name: check diff - run: git diff --exit-code diff --git a/.gitignore b/.gitignore index f015003..1b5ba5e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,7 @@ go.work .vscode *.DS_Store + +.config.yaml + +dist/ diff --git a/.golangci.yml b/.golangci.yml deleted file mode 100644 index a90ea05..0000000 --- a/.golangci.yml +++ /dev/null @@ -1,25 +0,0 @@ -linters-settings: - gci: - sections: - - standard - - default - - prefix(pkg.redcarbon.ai) - -run: - skip-files: - - ".*\\.sql\\.go$" - - ".*\\.pb\\.go$" - -linters: - enable: - - gci - - gofumpt - - gofmt - - gomnd - - goconst - - wsl - disable-all: true - -issues: - # Default: false. - new: true \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 682a894..55dc8f7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -31,20 +31,8 @@ archives: name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" wrap_in_directory: true format: tar.gz - -nfpms: - - license: Apache 2.0 - maintainer: RedCarbon SA - vendor: RedCarbon SA - homepage: https://redcarbon.ai - bindir: /usr - description: RedCarbon's Agent - formats: - - deb - - rpm - contents: - - src: ./service/redcarbon.service - dst: /etc/systemd/system/redcarbon.service - type: config - scripts: - postinstall: ./scripts/post_install.sh + files: + - src: assets/* + dst: . + - src: templates/* + dst: bin/templates diff --git a/.proto/buf.yaml b/.proto/buf.yaml index 4c071d9..a30d998 100644 --- a/.proto/buf.yaml +++ b/.proto/buf.yaml @@ -1,13 +1,9 @@ version: v1 -lint: - use: - - BASIC - - FILE_LOWER_SNAKE_CASE - except: - - ENUM_NO_ALLOW_ALIAS - - IMPORT_NO_PUBLIC - - PACKAGE_DIRECTORY_MATCH - - PACKAGE_SAME_DIRECTORY breaking: use: - - WIRE_JSON + - FILE +lint: + use: + - DEFAULT + ignore: + - google/type/datetime.proto \ No newline at end of file diff --git a/.proto/redcarbon/agents_public/v1/types.proto b/.proto/redcarbon/agents_public/v1/types.proto new file mode 100644 index 0000000..0aac03b --- /dev/null +++ b/.proto/redcarbon/agents_public/v1/types.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package redcarbon.agents_public.v1; + +message AgentConfiguration { + optional QRadarJobConfiguration qradar_job_configuration = 1; +} + +message QRadarJobConfiguration { + string host = 1; + string token = 2; + bool verify_ssl = 3; +} diff --git a/.proto/redcarbon/agents_public/v1/v1.proto b/.proto/redcarbon/agents_public/v1/v1.proto new file mode 100644 index 0000000..4835b36 --- /dev/null +++ b/.proto/redcarbon/agents_public/v1/v1.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package redcarbon.agents_public.v1; + +import "google/protobuf/timestamp.proto"; +import "redcarbon/agents_public/v1/types.proto"; + +service AgentsPublicAPIsV1Srv { + rpc HZ(HZRequest) returns (HZResponse) {} + rpc IngestIncident(IngestIncidentRequest) returns (IngestIncidentResponse) {} + rpc FetchAgentConfiguration(FetchAgentConfigurationRequest) returns (FetchAgentConfigurationResponse) {} +} + +message HZRequest { + string hostname = 1; + string ip = 2; +} + +message HZResponse { + google.protobuf.Timestamp received_at = 1; +} + +message IngestIncidentRequest { + string title = 1; + string description = 2; + string raw_data = 3; + uint32 severity = 4; + string origin = 5; + optional string original_id = 6; +} + +message IngestIncidentResponse {} + +message FetchAgentConfigurationRequest {} + +message FetchAgentConfigurationResponse { + AgentConfiguration configuration = 1; +} diff --git a/.proto/redcarbon/public_apis/agents/api/v1/types.proto b/.proto/redcarbon/public_apis/agents/api/v1/types.proto deleted file mode 100644 index 7c76494..0000000 --- a/.proto/redcarbon/public_apis/agents/api/v1/types.proto +++ /dev/null @@ -1,68 +0,0 @@ -syntax = "proto3"; - -package redcarbon.public_apis.agents.api.v1; - -option go_package = "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1;agentsPublicApiV1"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -message AgentConfiguration { - string agent_configuration_id = 1; - google.protobuf.Timestamp created_at = 2; - google.protobuf.Timestamp updated_at = 3; - string name = 4; - AgentConfigurationData data = 5; - string type = 6; -} - -message AgentConfigurationData { - oneof data { - SentinelOneData sentinel_one = 1; - GrayLogImpossibleTravelData graylog_impossible_travel = 2; - GrayLogDataMineData graylog_datamine = 3; - } -} - -message SentinelOneData { - string api_token = 1; - string url = 2; -} - -message GrayLogImpossibleTravelData { - string token = 1; - string url = 2; - bool skip_ssl = 3; - google.protobuf.Duration time_window = 4; -} - -message GrayLogDataMineData { - string token = 1; - string url = 2; - bool skip_ssl = 3; -} - -message GrayLogImpossibleTravelLog { - map logs = 1; -} - -message GrayLogDataMineResult { - google.protobuf.Timestamp timestamp = 1; - string uuid = 2; - string source = 3; - string message = 4; -} - -enum DataType { - UNSUPPORTED = 0; - SENTINEL_ONE = 1; - GRAYLOG_IMPOSSIBLE_TRAVEL = 2; - GRAYLOG_DATAMINE = 3; -} - -message GrayLogDataMineQuery { - string id = 1; - google.protobuf.Timestamp search_start_time = 2; - google.protobuf.Timestamp search_stop_time = 3; - string query = 4; -} diff --git a/.proto/redcarbon/public_apis/agents/api/v1/v1.proto b/.proto/redcarbon/public_apis/agents/api/v1/v1.proto deleted file mode 100644 index 54353ed..0000000 --- a/.proto/redcarbon/public_apis/agents/api/v1/v1.proto +++ /dev/null @@ -1,104 +0,0 @@ -syntax = "proto3"; - -package redcarbon.public_apis.agents.api.v1; - -option go_package = "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1;agentsPublicApiV1"; - -import "google/protobuf/timestamp.proto"; -import "redcarbon/public_apis/agents/api/v1/types.proto"; - -service AgentsPublicApiV1Srv { - rpc HZ(HZReq) - returns (HZRes) {} - - rpc PullConfigurations(PullConfigurationsReq) - returns (PullConfigurationsRes) {} - - rpc SendSentinelOneData(SendSentinelOneDataReq) - returns (SendSentinelOneDataRes) {} - rpc SendGrayLogImpossibleTravelData(SendGrayLogImpossibleTravelDataReq) - returns (SendGrayLogImpossibleTravelDataRes) {} - rpc SendGrayLogDatamineQueryResultsData(SendGrayLogDatamineQueryResultsDataReq) - returns (SendGrayLogDatamineQueryResultsDataRes) {} - rpc SendGrayLogDatamineQueryErrorData (SendGrayLogDatamineQueryErrorDataReq) - returns (SendGrayLogDatamineQueryErrorDataRes) {} - - rpc RefreshToken(RefreshTokenReq) - returns (RefreshTokenRes) {} - - rpc GetGrayLogDataMinePendingQueries(GetGrayLogDataMinePendingQueriesReq) - returns (GetGrayLogDataMinePendingQueriesRes) {} -} - -message HZReq { - string ip = 3; - string hostname = 4; -} - -message HZRes { - google.protobuf.Timestamp received_at = 1; -} - -message PullConfigurationsReq { -} - -message PullConfigurationsRes { - repeated AgentConfiguration agent_configurations = 1; -} - -message SendSentinelOneDataReq { - string agent_configuration_id = 1; - string data = 2; -} - -message SendSentinelOneDataRes { - google.protobuf.Timestamp received_at = 1; -} - -message SendGrayLogImpossibleTravelDataReq { - string agent_configuration_id = 1; - string user = 2; - repeated string ips = 3; - repeated string countries = 4; - repeated GrayLogImpossibleTravelLog impossible_travel_logs = 5; -} - -message SendGrayLogImpossibleTravelDataRes { - google.protobuf.Timestamp received_at = 1; -} - -message SendGrayLogDatamineQueryResultsDataReq { - string agent_configuration_id = 1; - string query_id = 2; - repeated GrayLogDataMineResult results = 3; -} - -message SendGrayLogDatamineQueryResultsDataRes { - google.protobuf.Timestamp received_at = 1; -} - -message SendGrayLogDatamineQueryErrorDataReq { - string agent_configuration_id = 1; - string query_id = 2; - string error = 3; -} - -message SendGrayLogDatamineQueryErrorDataRes { - google.protobuf.Timestamp received_at = 1; -} - -message RefreshTokenReq { -} - -message RefreshTokenRes { - string token = 1; - string refresh_token = 2; -} - -message GetGrayLogDataMinePendingQueriesReq { - string agent_configuration_id = 1; -} - -message GetGrayLogDataMinePendingQueriesRes { - repeated GrayLogDataMineQuery graylog_datamine_queries = 1; -} diff --git a/assets/config.sh b/assets/config.sh new file mode 100755 index 0000000..4338649 --- /dev/null +++ b/assets/config.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +user_id=`id -u` + +# we want to snapshot the environment of the config user +if [ $user_id -eq 0 -a -z "$AGENT_ALLOW_RUNASROOT" ]; then + echo "Must not run with sudo" + exit 1 +fi + +# Change directory to the script root directory +# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +cd "$DIR" + +shopt -s nocasematch +./bin/redcarbon configure "$@" diff --git a/assets/svc.sh b/assets/svc.sh new file mode 100755 index 0000000..b8b29e4 --- /dev/null +++ b/assets/svc.sh @@ -0,0 +1,174 @@ +#!/bin/bash + +SVC_NAME="redcarbon.agent.service" +SVC_NAME=${SVC_NAME// /_} +SVC_DESCRIPTION="RedCarbon Agent Runner" + +SVC_CMD=$1 +arg_2=${2} + +RUNNER_ROOT=`pwd` + +UNIT_PATH=/etc/systemd/system/${SVC_NAME} +TEMPLATE_PATH=$REDCARBON_AGENT_SERVICE_TEMPLATE +IS_CUSTOM_TEMPLATE=0 +if [[ -z $TEMPLATE_PATH ]]; then + TEMPLATE_PATH=./bin/templates/redcarbon.agent.service.template +else + IS_CUSTOM_TEMPLATE=1 +fi +TEMP_PATH=./redcarbon.agent.service.temp +CONFIG_PATH=.service + +user_id=`id -u` + +# systemctl must run as sudo +# this script is a convenience wrapper around systemctl +if [ $user_id -ne 0 ]; then + echo "Must run as sudo" + exit 1 +fi + +function failed() +{ + local error=${1:-Undefined error} + echo "Failed: $error" >&2 + exit 1 +} + +if [ ! -f "${TEMPLATE_PATH}" ]; then + if [[ $IS_CUSTOM_TEMPLATE = 0 ]]; then + failed "Must run from runner root or install is corrupt" + else + failed "Service file at '$REDCARBON_AGENT_SERVICE_TEMPLATE' using REDCARBON_AGENT_SERVICE_TEMPLATE env variable is not found" + fi +fi + +#check if we run as root +if [[ $(id -u) != "0" ]]; then + echo "Failed: This script requires to run with sudo." >&2 + exit 1 +fi + +function install() +{ + echo "Creating launch runner in ${UNIT_PATH}" + if [ -f "${UNIT_PATH}" ]; then + failed "error: exists ${UNIT_PATH}" + fi + + if [ -f "${TEMP_PATH}" ]; then + rm "${TEMP_PATH}" || failed "failed to delete ${TEMP_PATH}" + fi + + # can optionally use username supplied + run_as_user=${arg_2:-$SUDO_USER} + echo "Run as user: ${run_as_user}" + + run_as_uid=$(id -u ${run_as_user}) || failed "User does not exist" + echo "Run as uid: ${run_as_uid}" + + run_as_gid=$(id -g ${run_as_user}) || failed "Group not available" + echo "gid: ${run_as_gid}" + + sed "s/{{User}}/${run_as_user}/g; s/{{Description}}/$(echo ${SVC_DESCRIPTION} | sed -e 's/[\/&]/\\&/g')/g; s/{{RunnerRoot}}/$(echo ${RUNNER_ROOT} | sed -e 's/[\/&]/\\&/g')/g;" "${TEMPLATE_PATH}" > "${TEMP_PATH}" || failed "failed to create replacement temp file" + mv "${TEMP_PATH}" "${UNIT_PATH}" || failed "failed to copy unit file" + + # Recent Fedora based Linux (CentOS/Redhat) has SELinux enabled by default + # We need to restore security context on the unit file we added otherwise SystemD have no access to it. + command -v getenforce > /dev/null + if [ $? -eq 0 ] + then + selinuxEnabled=$(getenforce) + if [[ $selinuxEnabled == "Enforcing" ]] + then + # SELinux is enabled, we will need to Restore SELinux Context for the service file + restorecon -r -v "${UNIT_PATH}" || failed "failed to restore SELinux context on ${UNIT_PATH}" + fi + fi + + # unit file should not be executable and world writable + chmod 664 "${UNIT_PATH}" || failed "failed to set permissions on ${UNIT_PATH}" + systemctl daemon-reload || failed "failed to reload daemons" + + systemctl enable ${SVC_NAME} || failed "failed to enable ${SVC_NAME}" + + echo "${SVC_NAME}" > ${CONFIG_PATH} || failed "failed to create .service file" + chown ${run_as_uid}:${run_as_gid} ${CONFIG_PATH} || failed "failed to set permission for ${CONFIG_PATH}" +} + +function start() +{ + systemctl start ${SVC_NAME} || failed "failed to start ${SVC_NAME}" + status +} + +function stop() +{ + systemctl stop ${SVC_NAME} || failed "failed to stop ${SVC_NAME}" + status +} + +function uninstall() +{ + if service_exists; then + stop + systemctl disable ${SVC_NAME} || failed "failed to disable ${SVC_NAME}" + rm "${UNIT_PATH}" || failed "failed to delete ${UNIT_PATH}" + else + echo "Service ${SVC_NAME} is not installed" + fi + if [ -f "${CONFIG_PATH}" ]; then + rm "${CONFIG_PATH}" || failed "failed to delete ${CONFIG_PATH}" + fi + systemctl daemon-reload || failed "failed to reload daemons" +} + +function service_exists() { + if [ -f "${UNIT_PATH}" ]; then + return 0 + else + return 1 + fi +} + +function status() +{ + if service_exists; then + echo + echo "${UNIT_PATH}" + else + echo + echo "not installed" + echo + exit 1 + fi + + systemctl --no-pager status ${SVC_NAME} +} + +function usage() +{ + echo + echo Usage: + echo "./svc.sh [install, start, stop, status, uninstall]" + echo "Commands:" + echo " install [user]: Install runner service as Root or specified user." + echo " start: Manually start the runner service." + echo " stop: Manually stop the runner service." + echo " status: Display status of runner service." + echo " uninstall: Uninstall runner service." + echo +} + +case $SVC_CMD in + "install") install;; + "status") status;; + "uninstall") uninstall;; + "start") start;; + "stop") stop;; + "status") status;; + *) usage;; +esac + +exit 0 diff --git a/buf.gen.yaml b/buf.gen.yaml index 801f7f6..1ad4a85 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,11 +1,12 @@ version: v1 +managed: + enabled: true + go_package_prefix: + default: pkg.redcarbon.ai/proto plugins: - - name: go - out: . - opt: - - module=pkg.redcarbon.ai - - name: go-grpc - out: . - opt: - - require_unimplemented_servers=false - - module=pkg.redcarbon.ai \ No newline at end of file + - plugin: buf.build/protocolbuffers/go + out: proto + opt: paths=source_relative + - plugin: buf.build/connectrpc/go + out: proto + opt: paths=source_relative diff --git a/buf.work.yaml b/buf.work.yaml deleted file mode 100644 index 454d788..0000000 --- a/buf.work.yaml +++ /dev/null @@ -1,3 +0,0 @@ -version: v1 -directories: - - .proto \ No newline at end of file diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..4145af6 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,17 @@ +version: v1beta1 +build: + roots: + - ./.proto +lint: + use: + - BASIC + - FILE_LOWER_SNAKE_CASE + except: + - ENUM_NO_ALLOW_ALIAS + - IMPORT_NO_PUBLIC + - PACKAGE_AFFINITY + - PACKAGE_DIRECTORY_MATCH + - PACKAGE_SAME_DIRECTORY +breaking: + use: + - WIRE_JSON diff --git a/cmd/config/cmd.go b/cmd/config/cmd.go deleted file mode 100644 index 1b09318..0000000 --- a/cmd/config/cmd.go +++ /dev/null @@ -1,92 +0,0 @@ -package config - -import ( - "crypto/tls" - "os" - "path" - - "github.com/sirupsen/logrus" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - - "pkg.redcarbon.ai/internal/auth" - "pkg.redcarbon.ai/internal/build" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -type ConfigOptions struct { - RefreshToken string - Host string - Insecure bool -} - -func NewConfigCmd() *cobra.Command { - opts := &ConfigOptions{} - - cmd := &cobra.Command{ - Use: "config", - Short: "Configure the RedCarbon agent", - Run: func(cmd *cobra.Command, args []string) { - run(cmd, args, opts) - }, - } - - cmd.Flags().StringVarP(&opts.RefreshToken, "token", "t", "", "The token used to execute the login") - cmd.Flags().StringVarP(&opts.Host, "server", "s", build.DefaultHost, "The Server used to execute the login") - cmd.Flags().BoolVarP(&opts.Insecure, "insecure", "i", false, "connection insecure") - - return cmd -} - -func run(cmd *cobra.Command, args []string, opts *ConfigOptions) { - viper.Set("server.host", opts.Host) - viper.Set("server.insecure", opts.Insecure) - - agentsCli := mustCreateAgentCli() - defer agentsCli.Close() - - confDir, err := os.UserConfigDir() - if err != nil { - logrus.Fatalf("can't extract the user config directory for error %v", err) - } - - redcarbonConfDir := path.Join(confDir, "redcarbon") - - viper.SetConfigName("config") - viper.SetConfigType("yaml") - viper.AddConfigPath(redcarbonConfDir) - - client := agentsPublicApiV1.NewAgentsPublicApiV1SrvClient(agentsCli) - a := auth.NewAuthService(client, path.Join(confDir, "redcarbon", "config.yaml")) - - err = a.RefreshToken(opts.RefreshToken) - if err != nil { - logrus.Fatalf("Can't refresh the token %v", err) - } - - logrus.Println("Agent successfully configured!") -} - -func mustCreateAgentCli() *grpc.ClientConn { - host := viper.GetString("server.host") - - var creds credentials.TransportCredentials - - logrus.Infof("Connecting to the server... %s\n", host) - - if viper.GetBool("server.insecure") { - creds = insecure.NewCredentials() - } else { - creds = credentials.NewTLS(&tls.Config{}) - } - - agentsCli, err := grpc.Dial(host, grpc.WithTransportCredentials(creds)) - if err != nil { - logrus.Fatalf("Cannot create source connection: %v", err) - } - - return agentsCli -} diff --git a/cmd/configure/cmd.go b/cmd/configure/cmd.go new file mode 100644 index 0000000..f38857f --- /dev/null +++ b/cmd/configure/cmd.go @@ -0,0 +1,42 @@ +package configure + +import ( + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "pkg.redcarbon.ai/internal/build" +) + +type ConfigOptions struct { + Token string + Host string +} + +func NewConfigureCmd() *cobra.Command { + opts := &ConfigOptions{} + + cmd := &cobra.Command{ + Use: "configure", + Short: "Configure the RedCarbon agent", + Run: func(cmd *cobra.Command, args []string) { + run(cmd, args, opts) + }, + } + + cmd.Flags().StringVarP(&opts.Token, "token", "t", "", "The token used to execute the login") + cmd.Flags().StringVarP(&opts.Host, "server", "s", build.DefaultHost, "The Server used to execute the login") + + return cmd +} + +func run(cmd *cobra.Command, args []string, opts *ConfigOptions) { + viper.Set("server.host", opts.Host) + viper.Set("auth.access_token", opts.Token) + + if err := viper.WriteConfig(); err != nil { + logrus.Fatalf("Error while writing the configuration: %v", err) + } + + logrus.Println("Agent successfully configured!") +} diff --git a/cmd/main.go b/cmd/main.go index faa5ebd..85668ff 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,62 +1,63 @@ package main import ( + "context" "errors" + "github.com/go-co-op/gocron" + "github.com/google/go-github/v50/github" + "net/http" "os" - "path" + "os/signal" + "pkg.redcarbon.ai/cmd/configure" + "pkg.redcarbon.ai/internal/routines" + "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1/agents_publicv1connect" + "time" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" - "pkg.redcarbon.ai/cmd/config" - "pkg.redcarbon.ai/cmd/start" "pkg.redcarbon.ai/internal/build" ) -const confDirPermission = 0o755 +const ( + hzRoutineInterval = 5 + configRoutineInterval = 10 + updateRoutineInterval = 1 + + updateErrorCode = 3 +) func init() { - confDir, err := os.UserConfigDir() + confDir, err := os.Getwd() if err != nil { - logrus.Fatalf("can't extract the user config directory for error %v", err) + logrus.Fatalf("can't extract the user working directory for error %v", err) } - redcarbonConfDir := path.Join(confDir, "redcarbon") - - viper.SetConfigName("config") + viper.SetConfigName(".config") viper.SetConfigType("yaml") - viper.AddConfigPath(redcarbonConfDir) + viper.AddConfigPath(confDir) - viper.SetDefault("server.host", build.DefaultHost) - viper.SetDefault("server.insecure", true) - - if _, err := os.Stat(path.Join(redcarbonConfDir, "config.yaml")); errors.Is(err, os.ErrNotExist) { - err = os.MkdirAll(redcarbonConfDir, confDirPermission) - if err != nil { - logrus.Fatalf("can't create redcarbon config directory for error %v", err) + if err = viper.ReadInConfig(); err != nil { + var e viper.ConfigFileNotFoundError + if !errors.As(err, &e) { + logrus.WithError(err).Fatal("error while reading the configuration") } - err = viper.WriteConfigAs(path.Join(redcarbonConfDir, "config.yaml")) - if err != nil { - logrus.Fatalf("can't create redcarbon config file for error %v", err) + if err = viper.SafeWriteConfig(); err != nil { + logrus.WithError(err).Fatal("error while writing the configuration") } } - - err = viper.ReadInConfig() - if err != nil { - logrus.Fatalf("can't read the configuration %v", err) - } } func main() { rootCmd := &cobra.Command{ Use: "redcarbon", Short: "RedCarbon Agent", + Run: run, } - rootCmd.AddCommand(config.NewConfigCmd()) - rootCmd.AddCommand(start.NewStartCmd()) + rootCmd.AddCommand(configure.NewConfigureCmd()) rootCmd.Version = build.Version @@ -65,3 +66,48 @@ func main() { os.Exit(1) } } + +func run(cmd *cobra.Command, args []string) { + logrus.Infof("Starting RedCarbon Agent v%s on %s", build.Version, build.Architecture) + + if viper.GetString("auth.access_token") == "" { + logrus.Fatal("No access token found. Please run `redcarbon config` to configure the agent") + } + + ctx, cancelFn := context.WithCancel(context.Background()) + defer cancelFn() + + host := viper.GetString("server.host") + + client := agents_publicv1connect.NewAgentsPublicAPIsV1SrvClient(http.DefaultClient, host) + gh := github.NewClient(nil) + done := make(chan bool) + r := routines.NewRoutineJobs(client, gh, done) + + s := gocron.NewScheduler(time.UTC) + + s.Every(updateRoutineInterval).Day().StartImmediately().SingletonMode().Do(r.UpdateRoutine, ctx) + s.Every(hzRoutineInterval).Seconds().StartImmediately().Do(r.HZRoutine, ctx) + s.Every(configRoutineInterval).Minutes().StartImmediately().SingletonMode().Do(r.ConfigRoutine, ctx) + + s.StartAsync() + + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt) + + go func() { + <-c + cancelFn() + }() + + select { + case <-ctx.Done(): + s.Stop() + logrus.Info("RedCarbon Agent stopped") + os.Exit(0) + case <-done: + s.Stop() + logrus.Info("RedCarbon Agent stopped due update") + os.Exit(updateErrorCode) + } +} diff --git a/cmd/start/cmd.go b/cmd/start/cmd.go deleted file mode 100644 index 2fc2cd4..0000000 --- a/cmd/start/cmd.go +++ /dev/null @@ -1,109 +0,0 @@ -package start - -import ( - "context" - "crypto/tls" - "os" - "os/signal" - "path" - "time" - - "github.com/go-co-op/gocron" - "github.com/google/go-github/v50/github" - "github.com/sirupsen/logrus" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - - "pkg.redcarbon.ai/internal/auth" - "pkg.redcarbon.ai/internal/build" - "pkg.redcarbon.ai/internal/routines" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -const ( - hzRoutineInterval = 5 - refreshRoutineInterval = 30 - configRoutineInterval = 10 - updateRoutineInterval = 1 -) - -func NewStartCmd() *cobra.Command { - return &cobra.Command{ - Use: "start", - Short: "Start the RedCarbon agent", - Run: run, - } -} - -func run(cmd *cobra.Command, args []string) { - logrus.Infof("Starting RedCarbon Agent v%s on %s", build.Version, build.Architecture) - - if viper.GetString("auth.access_token") == "" { - logrus.Fatal("No access token found. Please run `redcarbon config` to configure the agent") - } - - ctx, cancelFn := context.WithCancel(context.Background()) - defer cancelFn() - - agentsCli := mustCreateAgentCli() - defer agentsCli.Close() - - confDir, err := os.UserConfigDir() - if err != nil { - logrus.Fatalf("can't extract the user config directory for error %v", err) - } - - client := agentsPublicApiV1.NewAgentsPublicApiV1SrvClient(agentsCli) - a := auth.NewAuthService(client, path.Join(confDir, "redcarbon", "config.yaml")) - gh := github.NewClient(nil) - done := make(chan bool) - r := routines.NewRoutineJobs(client, a, gh, done) - - s := gocron.NewScheduler(time.UTC) - - s.Every(updateRoutineInterval).Day().StartImmediately().SingletonMode().Do(r.UpdateRoutine, ctx) - s.Every(hzRoutineInterval).Seconds().StartImmediately().Do(r.HZRoutine, ctx) - s.Every(refreshRoutineInterval).Minutes().StartImmediately().SingletonMode().Do(r.Refresh, ctx) - s.Every(configRoutineInterval).Minutes().StartImmediately().SingletonMode().Do(r.ConfigRoutine, ctx) - - s.StartAsync() - - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt) - - go func() { - <-c - cancelFn() - }() - - select { - case <-ctx.Done(): - case <-done: - } - - s.Stop() - - logrus.Info("RedCarbon Agent stopped") -} - -func mustCreateAgentCli() *grpc.ClientConn { - host := viper.GetString("server.host") - - var creds credentials.TransportCredentials - - if viper.GetBool("server.insecure") { - creds = insecure.NewCredentials() - } else { - creds = credentials.NewTLS(&tls.Config{}) - } - - agentsCli, err := grpc.Dial(host, grpc.WithTransportCredentials(creds)) - if err != nil { - logrus.Fatalf("Cannot create source connection: %v", err) - } - - return agentsCli -} diff --git a/go.mod b/go.mod index a12073a..a14fb51 100644 --- a/go.mod +++ b/go.mod @@ -3,91 +3,47 @@ module pkg.redcarbon.ai go 1.19 require ( - github.com/bufbuild/buf v1.12.0 + connectrpc.com/connect v1.13.0 github.com/go-co-op/gocron v1.19.0 - github.com/gocarina/gocsv v0.0.0-20230123225133-763e25b40669 github.com/google/go-github/v50 v50.2.0 + github.com/google/uuid v1.3.0 github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.15.0 github.com/stretchr/testify v1.8.2 golang.org/x/mod v0.8.0 - google.golang.org/grpc v1.52.3 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 + google.golang.org/protobuf v1.31.0 ) require ( - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/Microsoft/go-winio v0.6.0 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/bufbuild/connect-go v1.4.1 // indirect - github.com/bufbuild/protocompile v0.1.0 // indirect github.com/cloudflare/circl v1.1.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/cli v20.10.21+incompatible // indirect - github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/docker/docker v20.10.21+incompatible // indirect - github.com/docker/docker-credential-helpers v0.7.0 // indirect - github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/felixge/fgprof v0.9.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-chi/chi/v5 v5.0.8 // indirect - github.com/gofrs/flock v0.8.1 // indirect - github.com/gofrs/uuid v4.3.1+incompatible // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-containerregistry v0.12.1 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/pprof v0.0.0-20221203041831-ce31453925ec // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect - github.com/klauspost/compress v1.15.13 // indirect - github.com/klauspost/pgzip v1.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect - github.com/morikuni/aec v1.0.0 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pkg/profile v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect - github.com/rs/cors v1.8.2 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect - go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.11.2 // indirect - go.opentelemetry.io/otel/metric v0.34.0 // indirect - go.opentelemetry.io/otel/trace v1.11.2 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.7.0 // indirect - golang.org/x/net v0.8.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - golang.org/x/tools v0.6.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a9c901d..ea997f4 100644 --- a/go.sum +++ b/go.sum @@ -35,22 +35,13 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +connectrpc.com/connect v1.13.0 h1:lGs5maZZzWOOD+PFFiOt5OncKmMsk9ZdPwpy5jcmaYg= +connectrpc.com/connect v1.13.0/go.mod h1:uHAFHtYgeSZJxXrkN1IunDpKghnTXhYbVh0wW4StPW0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/bufbuild/buf v1.12.0 h1:F5yU2VNaJv3PzfQu+qnUWyzn9KerhbIfV/dM961jJ70= -github.com/bufbuild/buf v1.12.0/go.mod h1:tgUhc+/7jgJPn6EbcS8oIFOiSRewkyO/9j+Acbby9SQ= -github.com/bufbuild/connect-go v1.4.1 h1:6usL3JGjKhxQpvDlizP7u8VfjAr1JkckcAUbrdcbgNY= -github.com/bufbuild/connect-go v1.4.1/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= -github.com/bufbuild/protocompile v0.1.0 h1:HjgJBI85hY/qmW5tw/66sNDZ7z0UDdVSi/5r40WHw4s= -github.com/bufbuild/protocompile v0.1.0/go.mod h1:ix/MMMdsT3fzxfw91dvbfzKW3fRRnuPCP47kpAm5m/4= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -62,58 +53,29 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/containerd/stargz-snapshotter/estargz v0.12.1 h1:+7nYmHJb0tEkcRaAW+MHqoKaJYZmkikupxCqVtmPuY0= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/cli v20.10.21+incompatible h1:qVkgyYUnOLQ98LtXBrwd/duVqPT2X4SHndOuGsfwyhU= -github.com/docker/cli v20.10.21+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog= -github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= -github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= -github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-co-op/gocron v1.19.0 h1:XlPLqNnxnKblmCRLdfcWV1UgbukQaU54QdNeR1jtgak= github.com/go-co-op/gocron v1.19.0/go.mod h1:UqVyvM90I1q/R1qGEX6cBORI6WArLuEgYlbncLMvzRM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/gocarina/gocsv v0.0.0-20230123225133-763e25b40669 h1:MvZzCA/mduVWoBSVKJeMdv+AqXQmZZ8i6p8889ejt/Y= -github.com/gocarina/gocsv v0.0.0-20230123225133-763e25b40669/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= -github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -148,12 +110,9 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-containerregistry v0.12.1 h1:W1mzdNUTx4Zla4JaixCRLhORcR7G6KxE5hHl5fkPsp8= -github.com/google/go-containerregistry v0.12.1/go.mod h1:sdIK+oHQO7B93xI8UweYdl887YhuIwg9vz8BSLH3+8k= github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk= github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -171,11 +130,10 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/pprof v0.0.0-20221203041831-ce31453925ec h1:fR20TYVVwhK4O7r7y+McjRYyaTH6/vjwJOajE+XhlzM= -github.com/google/pprof v0.0.0-20221203041831-ce31453925ec/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -185,25 +143,17 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8= github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 h1:2uT3aivO7NVpUPGcQX7RbHijHMyWix/yCnIrCWc+5co= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jhump/protoreflect v1.14.0 h1:MBbQK392K3u8NTLbKOCIi3XdI+y+c6yt5oMq0X3xviw= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0= -github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -212,28 +162,12 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= -github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= -github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -243,9 +177,6 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -263,7 +194,6 @@ github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -276,7 +206,6 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -287,21 +216,7 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= -go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= -go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= -go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= -go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= -go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -310,8 +225,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -375,12 +290,11 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -438,28 +352,23 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -497,7 +406,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -506,11 +414,8 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -578,8 +483,6 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef h1:uQ2vjV/sHTsWSqdKeLqmwitzgvjMl7o4IdtHwUDXSJY= -google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -596,10 +499,6 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= -google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -612,13 +511,12 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -626,7 +524,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/auth/auth.go b/internal/auth/auth.go deleted file mode 100644 index ed8ab7f..0000000 --- a/internal/auth/auth.go +++ /dev/null @@ -1,47 +0,0 @@ -package auth - -import ( - "context" - "fmt" - - "github.com/sirupsen/logrus" - "github.com/spf13/viper" - "google.golang.org/grpc/metadata" - - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -type AuthenticationService struct { - agentsCli agentsPublicApiV1.AgentsPublicApiV1SrvClient - configFile string -} - -func NewAuthService(a agentsPublicApiV1.AgentsPublicApiV1SrvClient, configFile string) AuthenticationService { - return AuthenticationService{ - agentsCli: a, - configFile: configFile, - } -} - -func (a AuthenticationService) RefreshToken(refreshToken string) error { - ctx := context.Background() - - updateCtx := metadata.AppendToOutgoingContext(ctx, "authorization", fmt.Sprintf("Bearer %s", refreshToken)) - - res, err := a.agentsCli.RefreshToken(updateCtx, &agentsPublicApiV1.RefreshTokenReq{}) - if err != nil { - return err - } - - viper.Set("auth.access_token", res.Token) - viper.Set("auth.refresh_token", res.RefreshToken) - - err = viper.WriteConfigAs(a.configFile) - if err != nil { - logrus.Fatalf("Error while writing the configuration %v", err) - } - - logrus.Infof("Token successfully refreshed!") - - return nil -} diff --git a/internal/graylog-datamine/graylog-datamine.go b/internal/graylog-datamine/graylog-datamine.go deleted file mode 100644 index 9f2a3c3..0000000 --- a/internal/graylog-datamine/graylog-datamine.go +++ /dev/null @@ -1,113 +0,0 @@ -package graylog_datamine - -import ( - "context" - "sync" - "time" - - "github.com/sirupsen/logrus" - "google.golang.org/protobuf/types/known/timestamppb" - - "pkg.redcarbon.ai/internal/graylog" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -type ServiceGrayLogDataMine struct { - ac *agentsPublicApiV1.AgentConfiguration - gdmConf *agentsPublicApiV1.GrayLogDataMineData - aCli agentsPublicApiV1.AgentsPublicApiV1SrvClient - glCli graylog.Client -} - -func NewGrayLogDataMineService(conf *agentsPublicApiV1.AgentConfiguration, cli agentsPublicApiV1.AgentsPublicApiV1SrvClient) *ServiceGrayLogDataMine { - gdmConf := conf.Data.GetGraylogDatamine() - - return &ServiceGrayLogDataMine{ - ac: conf, - aCli: cli, - gdmConf: gdmConf, - glCli: graylog.NewGrayLogClient(gdmConf.Token, gdmConf.Url, gdmConf.SkipSsl), - } -} - -func (s ServiceGrayLogDataMine) RunService(ctx context.Context) { - l := logrus.WithField("configurationId", s.ac.AgentConfigurationId) - - l.Infof("Retrieving pending queries...") - - qs, err := s.aCli.GetGrayLogDataMinePendingQueries(ctx, &agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq{ - AgentConfigurationId: s.ac.AgentConfigurationId, - }) - if err != nil { - l.Errorf("Error while retrieving the pending queries for error %v", err) - return - } - - var wg sync.WaitGroup - - for _, q := range qs.GraylogDatamineQueries { - wg.Add(1) - - go func(query *agentsPublicApiV1.GrayLogDataMineQuery) { - defer wg.Done() - - err := s.runQuery(ctx, query, l) - if err == nil { - return - } - - l.Errorf("Error while executing the query %s for error %v", query.Id, err) - - _, err = s.aCli.SendGrayLogDatamineQueryErrorData(ctx, &agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq{ - AgentConfigurationId: s.ac.AgentConfigurationId, - QueryId: query.Id, - Error: err.Error(), - }) - if err != nil { - l.Errorf("Error while sending the error due to %v for query %s", err, query.Id) - } - }(q) - } - - wg.Wait() - - l.Infof("Done") -} - -func (s ServiceGrayLogDataMine) runQuery(ctx context.Context, q *agentsPublicApiV1.GrayLogDataMineQuery, l *logrus.Entry) error { - l.Infof("Starting query %s...", q.Id) - - res, err := s.glCli.QueryData(ctx, q.Query, q.SearchStartTime.AsTime(), q.SearchStopTime.AsTime(), []string{"timestamp", "gl2_message_id", "source", "message"}) - if err != nil { - return err - } - - var results []*agentsPublicApiV1.GrayLogDataMineResult - - for _, v := range res { - t, err := time.Parse(time.RFC3339Nano, v["timestamp"]) - if err != nil { - return err - } - - results = append(results, &agentsPublicApiV1.GrayLogDataMineResult{ - Uuid: v["gl2_message_id"], - Source: v["source"], - Message: v["message"], - Timestamp: timestamppb.New(t), - }) - } - - _, err = s.aCli.SendGrayLogDatamineQueryResultsData(ctx, &agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq{ - QueryId: q.Id, - AgentConfigurationId: s.ac.AgentConfigurationId, - Results: results, - }) - if err != nil { - return err - } - - l.Infof("Query %s successfully executed", q.Id) - - return nil -} diff --git a/internal/graylog-datamine/graylog-datamine_test.go b/internal/graylog-datamine/graylog-datamine_test.go deleted file mode 100644 index 19602ed..0000000 --- a/internal/graylog-datamine/graylog-datamine_test.go +++ /dev/null @@ -1,166 +0,0 @@ -package graylog_datamine_test - -import ( - "context" - "encoding/base64" - "fmt" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/gocarina/gocsv" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/protobuf/types/known/timestamppb" - - "pkg.redcarbon.ai/internal/services" - "pkg.redcarbon.ai/mocks" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -type grayLogDataMine struct { - Timestamp string `csv:"timestamp"` - Source string `csv:"source"` - Uuid string `csv:"gl2_message_id"` - Message string `csv:"message"` -} - -func TestNewGrayLogDataMineService(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - dToken, err := base64.StdEncoding.DecodeString(strings.Replace(r.Header.Get("Authorization"), "Basic ", "", -1)) - assert.Nil(t, err) - assert.Equal(t, "xxx:token", string(dToken)) - - data, err := gocsv.MarshalString([]grayLogDataMine{ - { - Timestamp: "2021-03-23T09:04:49.000Z", - Source: "127.0.0.1", - Uuid: "18515d34-112d-44c2-ad98-8fb37d387dbd", - Message: "Test test", - }, - { - Timestamp: "2022-03-23T09:04:49.000Z", - Source: "127.0.0.1", - Uuid: "bc5d1607-a7ec-46df-8d98-5ebfe5b1e7d6", - Message: "Test test 2", - }, - }) - assert.Nil(t, err) - - _, err = w.Write([]byte(data)) - assert.Nil(t, err) - })) - - cli := mocks.AgentsPublicApiV1SrvClient{} - - cli.On("GetGrayLogDataMinePendingQueries", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes{ - GraylogDatamineQueries: []*agentsPublicApiV1.GrayLogDataMineQuery{ - { - Id: "0", - SearchStartTime: timestamppb.New(time.Now().Add(-time.Hour)), - SearchStopTime: timestamppb.Now(), - Query: "", - }, - }, - }, nil) - cli.On("SendGrayLogDatamineQueryResultsData", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes{ReceivedAt: timestamppb.Now()}, nil) - - s := services.NewServiceFromConfiguration(&agentsPublicApiV1.AgentConfiguration{ - AgentConfigurationId: "cf:1234567890", - Name: "test", - Type: "sentinel_one", - CreatedAt: timestamppb.Now(), - UpdatedAt: timestamppb.Now(), - Data: &agentsPublicApiV1.AgentConfigurationData{ - Data: &agentsPublicApiV1.AgentConfigurationData_GraylogDatamine{ - GraylogDatamine: &agentsPublicApiV1.GrayLogDataMineData{ - Url: ts.URL, - Token: "xxx", - SkipSsl: true, - }, - }, - }, - }, &cli) - - s.RunService(context.Background()) - - cli.AssertNumberOfCalls(t, "SendGrayLogDatamineQueryResultsData", 1) - cli.AssertNotCalled(t, "SendGrayLogDatamineQueryErrorData", mock.Anything, mock.Anything) -} - -func TestShouldSendTheErrorInCaseSomethingWentWrong(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - dToken, err := base64.StdEncoding.DecodeString(strings.Replace(r.Header.Get("Authorization"), "Basic ", "", -1)) - assert.Nil(t, err) - assert.Equal(t, "xxx:token", string(dToken)) - - data, err := gocsv.MarshalString([]grayLogDataMine{ - { - Timestamp: "2021-03-23T09:04:49.000Z", - Source: "127.0.0.1", - Uuid: "18515d34-112d-44c2-ad98-8fb37d387dbd", - Message: "Test test", - }, - { - Timestamp: "2022-03-23T09:04:49.000Z", - Source: "127.0.0.1", - Uuid: "bc5d1607-a7ec-46df-8d98-5ebfe5b1e7d6", - Message: "Test test 2", - }, - }) - assert.Nil(t, err) - - _, err = w.Write([]byte(data)) - assert.Nil(t, err) - })) - - cli := mocks.AgentsPublicApiV1SrvClient{} - - cli.On("GetGrayLogDataMinePendingQueries", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes{ - GraylogDatamineQueries: []*agentsPublicApiV1.GrayLogDataMineQuery{ - { - Id: "0", - SearchStartTime: timestamppb.New(time.Now().Add(-time.Hour)), - SearchStopTime: timestamppb.Now(), - Query: "", - }, - { - Id: "1", - SearchStartTime: timestamppb.New(time.Now().Add(-time.Hour)), - SearchStopTime: timestamppb.Now(), - Query: "", - }, - }, - }, nil) - cli.On("SendGrayLogDatamineQueryResultsData", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes{ReceivedAt: timestamppb.Now()}, nil).Once() - cli.On("SendGrayLogDatamineQueryResultsData", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("test error")).Once() - cli.On("SendGrayLogDatamineQueryErrorData", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes{ReceivedAt: timestamppb.Now()}, nil) - - s := services.NewServiceFromConfiguration(&agentsPublicApiV1.AgentConfiguration{ - AgentConfigurationId: "cf:1234567890", - Name: "test", - Type: "sentinel_one", - CreatedAt: timestamppb.Now(), - UpdatedAt: timestamppb.Now(), - Data: &agentsPublicApiV1.AgentConfigurationData{ - Data: &agentsPublicApiV1.AgentConfigurationData_GraylogDatamine{ - GraylogDatamine: &agentsPublicApiV1.GrayLogDataMineData{ - Url: ts.URL, - Token: "xxx", - SkipSsl: true, - }, - }, - }, - }, &cli) - - s.RunService(context.Background()) - - cli.AssertNumberOfCalls(t, "SendGrayLogDatamineQueryResultsData", 2) - cli.AssertNumberOfCalls(t, "SendGrayLogDatamineQueryErrorData", 1) -} diff --git a/internal/graylog-impossible-travel/impossible-travel.go b/internal/graylog-impossible-travel/impossible-travel.go deleted file mode 100644 index a150168..0000000 --- a/internal/graylog-impossible-travel/impossible-travel.go +++ /dev/null @@ -1,95 +0,0 @@ -package grayLogImpossibleTravel - -import ( - "context" - "time" - - "github.com/sirupsen/logrus" - - "pkg.redcarbon.ai/internal/graylog" - "pkg.redcarbon.ai/internal/utils" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -type ServiceGrayLogImpossibleTravel struct { - ac *agentsPublicApiV1.AgentConfiguration - itConf *agentsPublicApiV1.GrayLogImpossibleTravelData - aCli agentsPublicApiV1.AgentsPublicApiV1SrvClient - glCli graylog.Client -} - -func NewGrayLogImpossibleTravelService(conf *agentsPublicApiV1.AgentConfiguration, cli agentsPublicApiV1.AgentsPublicApiV1SrvClient) *ServiceGrayLogImpossibleTravel { - itConf := conf.Data.GetGraylogImpossibleTravel() - - return &ServiceGrayLogImpossibleTravel{ - ac: conf, - aCli: cli, - itConf: itConf, - glCli: graylog.NewGrayLogClient(itConf.Token, itConf.Url, itConf.SkipSsl), - } -} - -func (s ServiceGrayLogImpossibleTravel) RunService(ctx context.Context) { - l := logrus.WithField("configurationId", s.ac.AgentConfigurationId) - - to := time.Now() - from := to.Add(-s.itConf.TimeWindow.AsDuration()) - - logs, _ := s.glCli.QueryData( - ctx, - "Workload:AzureActiveDirectory AND Operation:UserLoggedIn AND NOT _exists_:customer_subnet_lookup_match", - from, - to, - []string{ - "timestamp", - "source", - "UserId", - "ClientIP", - "ClientIP_country_code", - "UserAgent", - }, - ) - - impossibleTravels := s.findImpossibleTravel(logs, s.ac.AgentConfigurationId) - - for _, it := range impossibleTravels { - _, err := s.aCli.SendGrayLogImpossibleTravelData(ctx, it) - if err != nil { - l.Errorf("Error while sending impossible travel for error %v - data %v", err, it) - continue - } - } -} - -func (s ServiceGrayLogImpossibleTravel) findImpossibleTravel(logs []map[string]string, acID string) []*agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq { - var finds []*agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq - - byUser := utils.GroupMapByColumn(logs, "UserId") - - for user, userLogs := range byUser { - c := utils.GetUniqueDataForColumnInMap(userLogs, "ClientIP_country_code") - if len(c) <= 1 { - continue - } - - var its []*agentsPublicApiV1.GrayLogImpossibleTravelLog - - for _, userLog := range userLogs { - its = append(its, &agentsPublicApiV1.GrayLogImpossibleTravelLog{ - Logs: userLog, - }) - } - - ips := utils.GetUniqueDataForColumnInMap(userLogs, "ClientIP") - - finds = append(finds, &agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq{ - Ips: ips, - User: user, - Countries: c, - AgentConfigurationId: acID, - ImpossibleTravelLogs: its, - }) - } - - return finds -} diff --git a/internal/graylog-impossible-travel/impossible-travel_test.go b/internal/graylog-impossible-travel/impossible-travel_test.go deleted file mode 100644 index a617e00..0000000 --- a/internal/graylog-impossible-travel/impossible-travel_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package grayLogImpossibleTravel_test - -import ( - "context" - "encoding/base64" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/gocarina/gocsv" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" - - "pkg.redcarbon.ai/internal/services" - "pkg.redcarbon.ai/mocks" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -type graylogData struct { - ClientIP string `csv:"ClientIP"` - ClientIPCountryCode string `csv:"ClientIP_country_code"` - UserId string `csv:"UserId"` -} - -func TestImpossibleTravel(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - dToken, err := base64.StdEncoding.DecodeString(strings.Replace(r.Header.Get("Authorization"), "Basic ", "", -1)) - assert.Nil(t, err) - assert.Equal(t, "xxx:token", string(dToken)) - - data, err := gocsv.MarshalString([]graylogData{ - { - ClientIP: "8.8.8.8", - ClientIPCountryCode: "US", - UserId: "foo", - }, - { - ClientIP: "7.7.7.7", - ClientIPCountryCode: "US", - UserId: "bar", - }, - { - ClientIP: "9.9.9.9", - ClientIPCountryCode: "DE", - UserId: "woo", - }, - { - ClientIP: "9.9.9.9", - ClientIPCountryCode: "DE", - UserId: "woo", - }, - { - ClientIP: "7.7.7.7", - ClientIPCountryCode: "FR", - UserId: "bar", - }, - { - ClientIP: "8.8.6.6", - ClientIPCountryCode: "IT", - UserId: "foo", - }, - }) - assert.Nil(t, err) - - _, err = w.Write([]byte(data)) - assert.Nil(t, err) - })) - - cli := mocks.AgentsPublicApiV1SrvClient{} - - cli.On("SendGrayLogImpossibleTravelData", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes{ReceivedAt: timestamppb.Now()}, nil) - - s := services.NewServiceFromConfiguration(&agentsPublicApiV1.AgentConfiguration{ - AgentConfigurationId: "cf:1234567890", - Name: "test", - Type: "sentinel_one", - CreatedAt: timestamppb.Now(), - UpdatedAt: timestamppb.Now(), - Data: &agentsPublicApiV1.AgentConfigurationData{ - Data: &agentsPublicApiV1.AgentConfigurationData_GraylogImpossibleTravel{ - GraylogImpossibleTravel: &agentsPublicApiV1.GrayLogImpossibleTravelData{ - Url: ts.URL, - Token: "xxx", - SkipSsl: true, - TimeWindow: durationpb.New(time.Hour * 5), - }, - }, - }, - }, &cli) - - s.RunService(context.Background()) - - cli.AssertNumberOfCalls(t, "SendGrayLogImpossibleTravelData", 2) - - cli.AssertCalled(t, "SendGrayLogImpossibleTravelData", mock.Anything, &agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq{ - AgentConfigurationId: "cf:1234567890", - Countries: []string{"US", "IT"}, - Ips: []string{"8.8.8.8", "8.8.6.6"}, - User: "foo", - ImpossibleTravelLogs: []*agentsPublicApiV1.GrayLogImpossibleTravelLog{ - { - Logs: map[string]string{ - "ClientIP": "8.8.8.8", - "ClientIP_country_code": "US", - "UserId": "foo", - }, - }, - { - Logs: map[string]string{ - "ClientIP": "8.8.6.6", - "ClientIP_country_code": "IT", - "UserId": "foo", - }, - }, - }, - }) -} diff --git a/internal/graylog/graylog.go b/internal/graylog/graylog.go deleted file mode 100644 index b6790ec..0000000 --- a/internal/graylog/graylog.go +++ /dev/null @@ -1,96 +0,0 @@ -package graylog - -import ( - "bytes" - "context" - "crypto/tls" - "encoding/base64" - "encoding/json" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/gocarina/gocsv" -) - -type Client struct { - url string - token string - skipSSL bool -} - -func NewGrayLogClient(token string, url string, skipSSL bool) Client { - return Client{ - token: base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:token", token))), - url: url, - skipSSL: skipSSL, - } -} - -type queryString struct { - Type string `json:"type"` - QueryString string `json:"query_string"` -} - -type timeRange struct { - Type string `json:"type"` - From time.Time `json:"from"` - To time.Time `json:"to"` -} - -type payload struct { - QueryString queryString `json:"query_string"` - TimeRange timeRange `json:"timerange"` - FieldsInOrder []string `json:"fields_in_order"` -} - -func (c Client) QueryData(ctx context.Context, query string, from time.Time, to time.Time, fields []string) ([]map[string]string, error) { - p := payload{ - QueryString: queryString{ - QueryString: query, - Type: "elasticsearch", - }, - TimeRange: timeRange{ - Type: "absolute", - From: from, - To: to, - }, - FieldsInOrder: fields, - } - - jP, err := json.Marshal(p) - if err != nil { - return nil, err - } - - rUrl, err := url.JoinPath(c.url, "/api/views/search/messages") - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, http.MethodPost, rUrl, bytes.NewReader(jP)) - if err != nil { - return nil, err - } - - req.Header.Add("Authorization", fmt.Sprintf("Basic %s", c.token)) - req.Header.Add("Content-Type", "application/json") - req.Header.Add("X-Requested-By", "RC Agent") - - client := http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: c.skipSSL}}} - - res, err := client.Do(req) - if err != nil { - return nil, err - } - - defer res.Body.Close() - - pRes, err := gocsv.CSVToMaps(res.Body) - if err != nil { - return nil, err - } - - return pRes, nil -} diff --git a/internal/routines/config.go b/internal/routines/config.go index 0fcfb14..2bc6ad4 100644 --- a/internal/routines/config.go +++ b/internal/routines/config.go @@ -8,21 +8,25 @@ import ( "sync" "time" + "connectrpc.com/connect" "github.com/sirupsen/logrus" "github.com/spf13/viper" - "google.golang.org/grpc/metadata" "pkg.redcarbon.ai/internal/services" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" + agents_publicv1 "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1" ) -func (r routineConfig) ConfigRoutine(ctx context.Context) { +func (r RoutineConfig) ConfigRoutine(ctx context.Context) { logrus.Infof("Start pulling the configurations from the server...") ctxWithTimeout, cFn := context.WithTimeout(ctx, time.Hour) - ctxWithTimeAndMeta := metadata.AppendToOutgoingContext(ctxWithTimeout, "authorization", fmt.Sprintf("Bearer %s", viper.Get("auth.access_token"))) + defer cFn() - configs, err := r.agentsCli.PullConfigurations(ctxWithTimeAndMeta, &agentsPublicApiV1.PullConfigurationsReq{}) + req := connect.NewRequest(&agents_publicv1.FetchAgentConfigurationRequest{}) + + req.Header().Set("authorization", fmt.Sprintf("ApiToken %s", viper.Get("auth.access_token"))) + + config, err := r.agentsCli.FetchAgentConfiguration(ctxWithTimeout, req) if err != nil { logrus.Errorf("Error while retrieving the configurations for error %v", err) return @@ -32,13 +36,10 @@ func (r routineConfig) ConfigRoutine(ctx context.Context) { var wg sync.WaitGroup - for _, conf := range configs.AgentConfigurations { - s := services.NewServiceFromConfiguration(conf, r.agentsCli) - if s == nil { - logrus.Warnf("Configuration %s skipped as is not supported.", conf.AgentConfigurationId) - } + jobs := services.NewServicesFromConfig(r.agentsCli, config.Msg.Configuration) - r.runService(ctxWithTimeAndMeta, s, &wg) + for _, job := range jobs { + r.runService(ctxWithTimeout, job, &wg) } c := make(chan os.Signal, 1) @@ -54,7 +55,7 @@ func (r routineConfig) ConfigRoutine(ctx context.Context) { logrus.Infof("Jobs completed!") } -func (r routineConfig) runService(ctx context.Context, s services.Service, wg *sync.WaitGroup) { +func (r RoutineConfig) runService(ctx context.Context, s services.Service, wg *sync.WaitGroup) { wg.Add(1) go func() { diff --git a/internal/routines/hz.go b/internal/routines/hz.go index c986a87..8868ba5 100644 --- a/internal/routines/hz.go +++ b/internal/routines/hz.go @@ -6,14 +6,14 @@ import ( "net" "os" + "connectrpc.com/connect" "github.com/sirupsen/logrus" "github.com/spf13/viper" - "google.golang.org/grpc/metadata" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" + agents_publicv1 "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1" ) -func (r routineConfig) HZRoutine(ctx context.Context) { +func (r RoutineConfig) HZRoutine(ctx context.Context) { hostname, err := os.Hostname() if err != nil { logrus.Fatalf("Error while retrieving the Hostname %v", err) @@ -24,25 +24,26 @@ func (r routineConfig) HZRoutine(ctx context.Context) { return } - updCtx := metadata.AppendToOutgoingContext(ctx, "authorization", fmt.Sprintf("Bearer %s", viper.Get("auth.access_token"))) - - res, err := r.agentsCli.HZ(updCtx, &agentsPublicApiV1.HZReq{ + req := connect.NewRequest(&agents_publicv1.HZRequest{ Ip: localAddr, Hostname: hostname, }) + + req.Header().Set("authorization", fmt.Sprintf("ApiToken %s", viper.Get("auth.access_token"))) + + res, err := r.agentsCli.HZ(ctx, req) if err != nil { - // TODO Decide how to handle it - logrus.Errorf("Error while calling the HZ %v", err) + logrus.WithError(err).Error("Error while calling the HZ") return } - logrus.Infof("HZ executed %s", res.ReceivedAt.String()) + logrus.Infof("HZ executed %s", res.Msg.ReceivedAt.String()) } func getOutboundIP() (string, error) { conn, err := net.Dial("udp", "8.8.8.8:80") if err != nil { - logrus.Errorf("Error while retrieving the IP address %v", err) + logrus.WithError(err).Error("Error while retrieving the IP address") return "", err } diff --git a/internal/routines/refresh.go b/internal/routines/refresh.go deleted file mode 100644 index 11fa32c..0000000 --- a/internal/routines/refresh.go +++ /dev/null @@ -1,15 +0,0 @@ -package routines - -import ( - "context" - - "github.com/sirupsen/logrus" - "github.com/spf13/viper" -) - -func (r routineConfig) Refresh(ctx context.Context) { - err := r.authSrv.RefreshToken(viper.GetString("auth.refresh_token")) - if err != nil { - logrus.Errorf("error while refreshing the access token %v", err) - } -} diff --git a/internal/routines/routines.go b/internal/routines/routines.go index b4c740d..8b5b3b8 100644 --- a/internal/routines/routines.go +++ b/internal/routines/routines.go @@ -2,22 +2,18 @@ package routines import ( "github.com/google/go-github/v50/github" - - "pkg.redcarbon.ai/internal/auth" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" + "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1/agents_publicv1connect" ) -type routineConfig struct { - agentsCli agentsPublicApiV1.AgentsPublicApiV1SrvClient - authSrv auth.AuthenticationService +type RoutineConfig struct { + agentsCli agents_publicv1connect.AgentsPublicAPIsV1SrvClient gh *github.Client done chan bool } -func NewRoutineJobs(a agentsPublicApiV1.AgentsPublicApiV1SrvClient, authSrv auth.AuthenticationService, gh *github.Client, done chan bool) routineConfig { - return routineConfig{ +func NewRoutineJobs(a agents_publicv1connect.AgentsPublicAPIsV1SrvClient, gh *github.Client, done chan bool) RoutineConfig { + return RoutineConfig{ agentsCli: a, - authSrv: authSrv, gh: gh, done: done, } diff --git a/internal/routines/update.go b/internal/routines/update.go index f77de3f..23b0e33 100644 --- a/internal/routines/update.go +++ b/internal/routines/update.go @@ -21,7 +21,7 @@ import ( "pkg.redcarbon.ai/internal/utils" ) -func (r routineConfig) UpdateRoutine(ctx context.Context) { +func (r RoutineConfig) UpdateRoutine(ctx context.Context) { rel, _, err := r.gh.Repositories.GetLatestRelease(ctx, "redcarbon-dev", "redcarbon-agent") if err != nil { return @@ -64,7 +64,7 @@ func (r routineConfig) UpdateRoutine(ctx context.Context) { } } -func (r routineConfig) doUpdate(url string, name string, hexChecksum string) error { +func (r RoutineConfig) doUpdate(url string, name string, hexChecksum string) error { executable, err := r.downloadAsset(url, name, hexChecksum) if err != nil { return err @@ -86,7 +86,7 @@ func (r routineConfig) doUpdate(url string, name string, hexChecksum string) err return nil } -func (r routineConfig) retrieveChecksumForAsset(assetName string, assets []*github.ReleaseAsset) (string, error) { +func (r RoutineConfig) retrieveChecksumForAsset(assetName string, assets []*github.ReleaseAsset) (string, error) { for _, asset := range assets { if asset.Name == nil { continue @@ -109,7 +109,7 @@ func (r routineConfig) retrieveChecksumForAsset(assetName string, assets []*gith return "", fmt.Errorf("checksum not found") } -func (r routineConfig) retrieveChecksumsList(asset *github.ReleaseAsset) ([]string, error) { +func (r RoutineConfig) retrieveChecksumsList(asset *github.ReleaseAsset) ([]string, error) { resp, err := http.Get(*asset.BrowserDownloadURL) if err != nil { return nil, err @@ -125,7 +125,7 @@ func (r routineConfig) retrieveChecksumsList(asset *github.ReleaseAsset) ([]stri return strings.Split(string(data), "\n"), nil } -func (r routineConfig) downloadAsset(url string, name string, hexChecksum string) (io.Reader, error) { +func (r RoutineConfig) downloadAsset(url string, name string, hexChecksum string) (io.Reader, error) { logrus.Info("Downloading new version...") resp, err := http.Get(url) @@ -166,7 +166,7 @@ func (r routineConfig) downloadAsset(url string, name string, hexChecksum string return file, nil } -func (r routineConfig) verifyChecksum(file io.Reader, hexChecksum string) error { +func (r RoutineConfig) verifyChecksum(file io.Reader, hexChecksum string) error { checksum, err := hex.DecodeString(hexChecksum) if err != nil { return err diff --git a/internal/sentinelone/sentinelone.go b/internal/sentinelone/sentinelone.go deleted file mode 100644 index 2720804..0000000 --- a/internal/sentinelone/sentinelone.go +++ /dev/null @@ -1,147 +0,0 @@ -package sentinelone - -import ( - "context" - "crypto/tls" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "time" - - "github.com/sirupsen/logrus" - "github.com/spf13/viper" - - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -const maxDifferenceOfTimes = time.Hour * 24 * 7 - -type FetchResponse struct { - Data []map[string]interface{} `json:"data"` -} - -type ServiceSentinelOne struct { - ac *agentsPublicApiV1.AgentConfiguration - aCli agentsPublicApiV1.AgentsPublicApiV1SrvClient -} - -func NewSentinelOneService(conf *agentsPublicApiV1.AgentConfiguration, cli agentsPublicApiV1.AgentsPublicApiV1SrvClient) *ServiceSentinelOne { - return &ServiceSentinelOne{ - ac: conf, - aCli: cli, - } -} - -func (s ServiceSentinelOne) RunService(ctx context.Context) { - l := logrus.WithField("configurationId", s.ac.AgentConfigurationId) - - l.Infof("Starting SentinelOne Configuration...") - - sentinelOneConfig := s.ac.Data.GetSentinelOne() - - baseUrl, err := url.Parse(sentinelOneConfig.Url) - if err != nil { - return - } - - reqUrl := baseUrl.JoinPath("/web/api/v2.1/threats") - - from, to := s.retrieveTimeBoundariesForConfiguration() - - query := reqUrl.Query() - - query.Set("createdAt__gt", from.Format(time.RFC3339)) - query.Set("createdAt__lt", to.Format(time.RFC3339)) - - limit := 100 - skip := 0 - - for true { - query.Set("limit", fmt.Sprintf("%d", limit)) - query.Set("skip", fmt.Sprintf("%d", skip)) - - reqUrl.RawQuery = query.Encode() - - req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqUrl.String(), nil) - if err != nil { - return - } - - req.Header.Add("Authorization", fmt.Sprintf("ApiToken %s", sentinelOneConfig.ApiToken)) - req.Header.Add("User-Agent", "RedCarbon Ingestion Agent") - req.Header.Add("Accept", "application/json") - - client := http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}} - - res, err := client.Do(req) - if err != nil { - return - } - - body, err := io.ReadAll(res.Body) - if err != nil { - return - } - - var parsedBody FetchResponse - - err = json.Unmarshal(body, &parsedBody) - if err != nil { - return - } - - if len(parsedBody.Data) == 0 { - break - } - - for _, data := range parsedBody.Data { - l.Infof("Sending a message...") - - dataJ, err := json.Marshal(data) - if err != nil { - logrus.Errorf("Error while marshaling the message %v", err) - return - } - - _, err = s.aCli.SendSentinelOneData(ctx, &agentsPublicApiV1.SendSentinelOneDataReq{ - Data: string(dataJ), - AgentConfigurationId: s.ac.AgentConfigurationId, - }) - if err != nil { - logrus.Errorf("Error while sending the message %v", err) - return - } - } - - skip += limit - } - - viper.Set(fmt.Sprintf("configurations.%s.from", s.ac.AgentConfigurationId), to) - - err = viper.WriteConfig() - if err != nil { - return - } - - l.Infof("SentinelOne Configuration - Successfully Executed\n") -} - -func (s ServiceSentinelOne) retrieveTimeBoundariesForConfiguration() (time.Time, time.Time) { - now := time.Now() - - from := viper.GetTime(fmt.Sprintf("configurations.%s.from", s.ac.AgentConfigurationId)) - - zero := time.Time{} - if from == zero { - return now.Add(-time.Hour), now - } - - diff := now.Sub(from) - if diff > maxDifferenceOfTimes { - return now.Add(-maxDifferenceOfTimes), now - } - - return from, now -} diff --git a/internal/sentinelone/sentinelone_test.go b/internal/sentinelone/sentinelone_test.go deleted file mode 100644 index 12e8abb..0000000 --- a/internal/sentinelone/sentinelone_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package sentinelone_test - -import ( - "context" - "encoding/json" - "net/http" - "net/http/httptest" - "os" - "testing" - "time" - - "github.com/spf13/viper" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/grpc" - "google.golang.org/protobuf/types/known/timestamppb" - - "pkg.redcarbon.ai/internal/sentinelone" - "pkg.redcarbon.ai/internal/services" - "pkg.redcarbon.ai/mocks" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" -) - -var s *grpc.Server - -func TestShouldSendAllTheSentinelOneData(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - assert.Equal(t, "ApiToken xxx", r.Header.Get("Authorization")) - - query := r.URL.Query() - limit := query.Get("limit") - skip := query.Get("skip") - - assert.Equal(t, limit, "100") - - if skip == "0" { - res, err := json.Marshal(sentinelone.FetchResponse{Data: []map[string]interface{}{ - {"Hello": "World"}, - {"bar": []string{"foo"}}, - }}) - - assert.Nil(t, err) - - _, err = w.Write(res) - assert.Nil(t, err) - } else { - res, err := json.Marshal([]string{}) - - assert.Nil(t, err) - - _, err = w.Write(res) - assert.Nil(t, err) - } - })) - - defer ts.Close() - - f, err := os.CreateTemp("", "rcagent-sentinelone-test") - assert.Nil(t, err) - - defer f.Close() - - viper.SetConfigFile(f.Name()) - viper.SetConfigType("yaml") - - cli := mocks.AgentsPublicApiV1SrvClient{} - - cli.On("SendSentinelOneData", mock.Anything, mock.Anything).Return(&agentsPublicApiV1.SendSentinelOneDataRes{ReceivedAt: timestamppb.Now()}, nil) - - s := services.NewServiceFromConfiguration(&agentsPublicApiV1.AgentConfiguration{ - AgentConfigurationId: "cf:1234567890", - Name: "test", - Type: "sentinel_one", - CreatedAt: timestamppb.Now(), - UpdatedAt: timestamppb.Now(), - Data: &agentsPublicApiV1.AgentConfigurationData{ - Data: &agentsPublicApiV1.AgentConfigurationData_SentinelOne{ - SentinelOne: &agentsPublicApiV1.SentinelOneData{ - Url: ts.URL, - ApiToken: "xxx", - }, - }, - }, - }, &cli) - - s.RunService(context.Background()) - - cli.AssertNumberOfCalls(t, "SendSentinelOneData", 2) - assert.NotEqual(t, time.Time{}, viper.Get("configurations.cf:1234567890.from")) -} diff --git a/internal/services/qradar/client.go b/internal/services/qradar/client.go new file mode 100644 index 0000000..aa1b3b9 --- /dev/null +++ b/internal/services/qradar/client.go @@ -0,0 +1,225 @@ +package qradar + +import ( + "context" + "crypto/tls" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" +) + +type QRadarClient struct { + client *http.Client + token string + url string +} + +func NewQRadarClient(url, token string, skipSSL bool) QRadarClient { + return QRadarClient{ + token: token, + url: url, + client: &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: !skipSSL}, + }, + }, + } +} + +func (q *QRadarClient) addBaseHeadersToRequest(req *http.Request) { + req.Header.Set("Accept", "application/json") + req.Header.Set("SEC", q.token) + req.Header.Set("X-Requested-By", "RedCarbon Agent") +} + +func (q *QRadarClient) FetchOffenses(ctx context.Context, start, end time.Time) ([]map[string]interface{}, error) { + rFetchOffenses, err := url.JoinPath(q.url, "/api/siem/offenses") + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, rFetchOffenses, nil) + if err != nil { + return nil, err + } + + q.addBaseHeadersToRequest(req) + addTimeFilteringToRequest(req, start, end) + + res, err := q.client.Do(req) + if err != nil { + return nil, err + } + + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("status code %d", res.StatusCode) + } + + defer res.Body.Close() + + payload, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + var offenses []map[string]interface{} + + err = json.Unmarshal(payload, &offenses) + if err != nil { + return nil, err + } + + return offenses, nil +} + +func (q *QRadarClient) FetchSourceAddresses(ctx context.Context, sourceAddressIds []int) ([]map[string]interface{}, error) { + rFetchSourceAd, err := url.JoinPath(q.url, "/api/siem/source_addresses") + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, rFetchSourceAd, nil) + if err != nil { + return nil, err + } + + addIdsFilteringToRequest(req, sourceAddressIds) + q.addBaseHeadersToRequest(req) + + res, err := q.client.Do(req) + if err != nil { + return nil, err + } + + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("status code %d", res.StatusCode) + } + + defer res.Body.Close() + + payload, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + var sourceAddresses []map[string]interface{} + + err = json.Unmarshal(payload, &sourceAddresses) + if err != nil { + return nil, err + } + + return sourceAddresses, nil +} + +func (q *QRadarClient) FetchLocalDestinationAddresses(ctx context.Context, localDestinationAddressIds []int) ([]map[string]interface{}, error) { + rFetchLocalDestAd, err := url.JoinPath(q.url, "/api/siem/local_destination_addresses") + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, rFetchLocalDestAd, nil) + if err != nil { + return nil, err + } + + addIdsFilteringToRequest(req, localDestinationAddressIds) + q.addBaseHeadersToRequest(req) + + res, err := q.client.Do(req) + if err != nil { + return nil, err + } + + defer res.Body.Close() + + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("status code %d", res.StatusCode) + } + + payload, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + var localDestinationAddresses []map[string]interface{} + + err = json.Unmarshal(payload, &localDestinationAddresses) + if err != nil { + return nil, err + } + + return localDestinationAddresses, nil +} + +func (q *QRadarClient) FetchOffenseType(ctx context.Context, offenseTypeId int) (map[string]interface{}, error) { + rFetchOffenseType, err := url.JoinPath(q.url, fmt.Sprintf("/api/siem/offense_types/%d", offenseTypeId)) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, rFetchOffenseType, nil) + if err != nil { + return nil, err + } + + q.addBaseHeadersToRequest(req) + + res, err := q.client.Do(req) + if err != nil { + return nil, err + } + + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("status code %d", res.StatusCode) + } + + defer res.Body.Close() + + payload, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + var offenseType map[string]interface{} + + err = json.Unmarshal(payload, &offenseType) + if err != nil { + return nil, err + } + + return offenseType, nil +} + +func addIdsFilteringToRequest(req *http.Request, ids []int) { + var idsStr []string + + for _, id := range ids { + idsStr = append(idsStr, fmt.Sprintf("id=%d", id)) + } + + filter := strings.Join(idsStr, " OR ") + + q := req.URL.Query() + + q.Add("filter", filter) + + req.URL.RawQuery = q.Encode() + + return +} + +func addTimeFilteringToRequest(req *http.Request, start, end time.Time) { + q := req.URL.Query() + + q.Add("filter", fmt.Sprintf("start_time>=%d AND start_time<=%d", start.UnixMilli(), end.UnixMilli())) + q.Add("sort", "-start_time") + + req.URL.RawQuery = q.Encode() + + return +} diff --git a/internal/services/qradar/types.go b/internal/services/qradar/types.go new file mode 100644 index 0000000..eee2811 --- /dev/null +++ b/internal/services/qradar/types.go @@ -0,0 +1,12 @@ +package qradar + +type Offense struct { + Description string `json:"description"` + StartTime float64 `json:"start_time"` + LastUpdatedTime float64 `json:"last_updated_time"` + Magnitude int `json:"magnitude"` + ID int `json:"id"` + LocalDestinationAddressIds []int `json:"local_destination_address_ids"` + SourceAddressIds []int `json:"source_address_ids"` + OffenseType int `json:"offense_type"` +} diff --git a/internal/services/qradar_srv.go b/internal/services/qradar_srv.go new file mode 100644 index 0000000..98af60f --- /dev/null +++ b/internal/services/qradar_srv.go @@ -0,0 +1,188 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "time" + + "connectrpc.com/connect" + "github.com/google/uuid" + "github.com/sirupsen/logrus" + "github.com/spf13/viper" + + "pkg.redcarbon.ai/internal/services/qradar" + agents_publicv1 "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1" + "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1/agents_publicv1connect" +) + +const ( + maximumMagnitudeLow = 6 + minimumMagnitudeMedium = 7 + maximumMagnitudeMedium = 8 + magnitudeHigh = 9 + + rcSeverityLow = 10 + rcSeverityMedium = 40 + rcSeverityHigh = 70 + rcSeverityCritical = 90 + + hoursToFetch = 2 +) + +type srv struct { + cli qradar.QRadarClient + agentsCli agents_publicv1connect.AgentsPublicAPIsV1SrvClient +} + +type incidentToIngest struct { + Incident map[string]interface{} `json:"incident"` + OffenseType map[string]interface{} `json:"offense_type"` + LocalDestinationAddresses []map[string]interface{} `json:"local_destination_addresses"` + SourceAddresses []map[string]interface{} `json:"source_addresses"` +} + +func NewService(conf *agents_publicv1.QRadarJobConfiguration, agentsCli agents_publicv1connect.AgentsPublicAPIsV1SrvClient) Service { + return &srv{ + cli: qradar.NewQRadarClient(conf.Host, conf.Token, conf.VerifySsl), + agentsCli: agentsCli, + } +} + +func (s srv) RunService(ctx context.Context) { + l := logrus.WithFields(logrus.Fields{ + "service": "qradar", + "trace": uuid.NewString(), + }) + + l.Info("Starting QRadar service") + start, end := retrieveTimeRangeForSearch() + + offenses, err := s.cli.FetchOffenses(ctx, start, end) + if err != nil { + return + } + + l.Infof("Found %d offenses", len(offenses)) + + for _, offense := range offenses { + i, err := s.retrieveIncidentDataForOffense(ctx, offense) + if err != nil { + continue + } + + req := connect.NewRequest(i) + req.Header().Set("authorization", fmt.Sprintf("ApiToken %s", viper.Get("auth.access_token"))) + + _, err = s.agentsCli.IngestIncident(ctx, req) + if err != nil { + l.WithError(err).Error("failed to ingest incident") + continue + } + } + + viper.Set("qradar.last_execution", end) + + if err := viper.WriteConfig(); err != nil { + l.WithError(err).Error("failed to write config") + } + + l.Info("QRadar service completed") +} + +func (s srv) retrieveIncidentDataForOffense(ctx context.Context, offense map[string]interface{}) (*agents_publicv1.IngestIncidentRequest, error) { + of, err := parseOffense(offense) + if err != nil { + return nil, err + } + + ot, err := s.cli.FetchOffenseType(ctx, of.OffenseType) + if err != nil { + return nil, err + } + + la, err := s.SafeFetchIds(ctx, of.LocalDestinationAddressIds, s.cli.FetchLocalDestinationAddresses) + if err != nil { + return nil, err + } + + sa, err := s.SafeFetchIds(ctx, of.SourceAddressIds, s.cli.FetchSourceAddresses) + if err != nil { + return nil, err + } + + i := incidentToIngest{ + Incident: offense, + OffenseType: ot, + LocalDestinationAddresses: la, + SourceAddresses: sa, + } + + iStr, err := json.Marshal(i) + if err != nil { + return nil, err + } + + idStr := fmt.Sprintf("%d", of.ID) + + return &agents_publicv1.IngestIncidentRequest{ + Title: strings.TrimSpace(of.Description), + Description: of.Description, + RawData: string(iStr), + Severity: mapSeverity(of.Magnitude), + Origin: "qradar", + OriginalId: &idStr, + }, nil +} + +func parseOffense(offense map[string]interface{}) (qradar.Offense, error) { + ofStr, err := json.Marshal(offense) + if err != nil { + return qradar.Offense{}, err + } + + var of qradar.Offense + + err = json.Unmarshal(ofStr, &of) + if err != nil { + return qradar.Offense{}, err + } + + return of, nil +} + +func (s srv) SafeFetchIds(ctx context.Context, ids []int, f func(context.Context, []int) ([]map[string]interface{}, error)) ([]map[string]interface{}, error) { + if len(ids) == 0 { + return []map[string]interface{}{}, nil + } + + return f(ctx, ids) +} + +func mapSeverity(magnitude int) uint32 { + if magnitude <= maximumMagnitudeLow { + return rcSeverityLow + } + + if magnitude >= minimumMagnitudeMedium && magnitude <= maximumMagnitudeMedium { + return rcSeverityMedium + } + + if magnitude == magnitudeHigh { + return rcSeverityHigh + } + + return rcSeverityCritical +} + +func retrieveTimeRangeForSearch() (start, end time.Time) { + end = time.Now() + start = viper.GetTime("qradar.last_execution") + + if start.IsZero() { + start = end.Add(-hoursToFetch * time.Hour) + } + + return +} diff --git a/internal/services/services.go b/internal/services/services.go index 000d4af..e84372c 100644 --- a/internal/services/services.go +++ b/internal/services/services.go @@ -3,28 +3,20 @@ package services import ( "context" - graylog_datamine "pkg.redcarbon.ai/internal/graylog-datamine" - "pkg.redcarbon.ai/internal/graylog-impossible-travel" - "pkg.redcarbon.ai/internal/sentinelone" - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" + agents_publicv1 "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1" + "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1/agents_publicv1connect" ) type Service interface { RunService(ctx context.Context) } -func NewServiceFromConfiguration(conf *agentsPublicApiV1.AgentConfiguration, cli agentsPublicApiV1.AgentsPublicApiV1SrvClient) Service { - if conf.Data.GetSentinelOne() != nil { - return sentinelone.NewSentinelOneService(conf, cli) - } - - if conf.Data.GetGraylogImpossibleTravel() != nil { - return grayLogImpossibleTravel.NewGrayLogImpossibleTravelService(conf, cli) - } +func NewServicesFromConfig(agentsCli agents_publicv1connect.AgentsPublicAPIsV1SrvClient, config *agents_publicv1.AgentConfiguration) []Service { + services := []Service{} - if conf.Data.GetGraylogDatamine() != nil { - return graylog_datamine.NewGrayLogDataMineService(conf, cli) + if config.GetQradarJobConfiguration() != nil { + services = append(services, NewService(config.GetQradarJobConfiguration(), agentsCli)) } - return nil + return services } diff --git a/mocks/AgentsPublicApiV1SrvClient.go b/mocks/AgentsPublicApiV1SrvClient.go deleted file mode 100644 index 4b75fd3..0000000 --- a/mocks/AgentsPublicApiV1SrvClient.go +++ /dev/null @@ -1,601 +0,0 @@ -// Code generated by mockery v2.25.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" - - grpc "google.golang.org/grpc" - - mock "github.com/stretchr/testify/mock" -) - -// AgentsPublicApiV1SrvClient is an autogenerated mock type for the AgentsPublicApiV1SrvClient type -type AgentsPublicApiV1SrvClient struct { - mock.Mock -} - -type AgentsPublicApiV1SrvClient_Expecter struct { - mock *mock.Mock -} - -func (_m *AgentsPublicApiV1SrvClient) EXPECT() *AgentsPublicApiV1SrvClient_Expecter { - return &AgentsPublicApiV1SrvClient_Expecter{mock: &_m.Mock} -} - -// GetGrayLogDataMinePendingQueries provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) GetGrayLogDataMinePendingQueries(ctx context.Context, in *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq, opts ...grpc.CallOption) (*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq, ...grpc.CallOption) (*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq, ...grpc.CallOption) *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGrayLogDataMinePendingQueries' -type AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call struct { - *mock.Call -} - -// GetGrayLogDataMinePendingQueries is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) GetGrayLogDataMinePendingQueries(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call { - return &AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call{Call: _e.mock.On("GetGrayLogDataMinePendingQueries", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call) Return(_a0 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, _a1 error) *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq, ...grpc.CallOption) (*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, error)) *AgentsPublicApiV1SrvClient_GetGrayLogDataMinePendingQueries_Call { - _c.Call.Return(run) - return _c -} - -// HZ provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) HZ(ctx context.Context, in *agentsPublicApiV1.HZReq, opts ...grpc.CallOption) (*agentsPublicApiV1.HZRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.HZRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.HZReq, ...grpc.CallOption) (*agentsPublicApiV1.HZRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.HZReq, ...grpc.CallOption) *agentsPublicApiV1.HZRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.HZRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.HZReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_HZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HZ' -type AgentsPublicApiV1SrvClient_HZ_Call struct { - *mock.Call -} - -// HZ is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.HZReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) HZ(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_HZ_Call { - return &AgentsPublicApiV1SrvClient_HZ_Call{Call: _e.mock.On("HZ", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_HZ_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.HZReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_HZ_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.HZReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_HZ_Call) Return(_a0 *agentsPublicApiV1.HZRes, _a1 error) *AgentsPublicApiV1SrvClient_HZ_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_HZ_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.HZReq, ...grpc.CallOption) (*agentsPublicApiV1.HZRes, error)) *AgentsPublicApiV1SrvClient_HZ_Call { - _c.Call.Return(run) - return _c -} - -// PullConfigurations provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) PullConfigurations(ctx context.Context, in *agentsPublicApiV1.PullConfigurationsReq, opts ...grpc.CallOption) (*agentsPublicApiV1.PullConfigurationsRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.PullConfigurationsRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.PullConfigurationsReq, ...grpc.CallOption) (*agentsPublicApiV1.PullConfigurationsRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.PullConfigurationsReq, ...grpc.CallOption) *agentsPublicApiV1.PullConfigurationsRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.PullConfigurationsRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.PullConfigurationsReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_PullConfigurations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullConfigurations' -type AgentsPublicApiV1SrvClient_PullConfigurations_Call struct { - *mock.Call -} - -// PullConfigurations is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.PullConfigurationsReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) PullConfigurations(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_PullConfigurations_Call { - return &AgentsPublicApiV1SrvClient_PullConfigurations_Call{Call: _e.mock.On("PullConfigurations", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_PullConfigurations_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.PullConfigurationsReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_PullConfigurations_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.PullConfigurationsReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_PullConfigurations_Call) Return(_a0 *agentsPublicApiV1.PullConfigurationsRes, _a1 error) *AgentsPublicApiV1SrvClient_PullConfigurations_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_PullConfigurations_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.PullConfigurationsReq, ...grpc.CallOption) (*agentsPublicApiV1.PullConfigurationsRes, error)) *AgentsPublicApiV1SrvClient_PullConfigurations_Call { - _c.Call.Return(run) - return _c -} - -// RefreshToken provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) RefreshToken(ctx context.Context, in *agentsPublicApiV1.RefreshTokenReq, opts ...grpc.CallOption) (*agentsPublicApiV1.RefreshTokenRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.RefreshTokenRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.RefreshTokenReq, ...grpc.CallOption) (*agentsPublicApiV1.RefreshTokenRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.RefreshTokenReq, ...grpc.CallOption) *agentsPublicApiV1.RefreshTokenRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.RefreshTokenRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.RefreshTokenReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_RefreshToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshToken' -type AgentsPublicApiV1SrvClient_RefreshToken_Call struct { - *mock.Call -} - -// RefreshToken is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.RefreshTokenReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) RefreshToken(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_RefreshToken_Call { - return &AgentsPublicApiV1SrvClient_RefreshToken_Call{Call: _e.mock.On("RefreshToken", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_RefreshToken_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.RefreshTokenReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_RefreshToken_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.RefreshTokenReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_RefreshToken_Call) Return(_a0 *agentsPublicApiV1.RefreshTokenRes, _a1 error) *AgentsPublicApiV1SrvClient_RefreshToken_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_RefreshToken_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.RefreshTokenReq, ...grpc.CallOption) (*agentsPublicApiV1.RefreshTokenRes, error)) *AgentsPublicApiV1SrvClient_RefreshToken_Call { - _c.Call.Return(run) - return _c -} - -// SendGrayLogDatamineQueryErrorData provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) SendGrayLogDatamineQueryErrorData(ctx context.Context, in *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq, opts ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq, ...grpc.CallOption) *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendGrayLogDatamineQueryErrorData' -type AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call struct { - *mock.Call -} - -// SendGrayLogDatamineQueryErrorData is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) SendGrayLogDatamineQueryErrorData(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call { - return &AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call{Call: _e.mock.On("SendGrayLogDatamineQueryErrorData", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call) Return(_a0 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, _a1 error) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, error)) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryErrorData_Call { - _c.Call.Return(run) - return _c -} - -// SendGrayLogDatamineQueryResultsData provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) SendGrayLogDatamineQueryResultsData(ctx context.Context, in *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq, opts ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq, ...grpc.CallOption) *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendGrayLogDatamineQueryResultsData' -type AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call struct { - *mock.Call -} - -// SendGrayLogDatamineQueryResultsData is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) SendGrayLogDatamineQueryResultsData(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call { - return &AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call{Call: _e.mock.On("SendGrayLogDatamineQueryResultsData", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call) Return(_a0 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, _a1 error) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, error)) *AgentsPublicApiV1SrvClient_SendGrayLogDatamineQueryResultsData_Call { - _c.Call.Return(run) - return _c -} - -// SendGrayLogImpossibleTravelData provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) SendGrayLogImpossibleTravelData(ctx context.Context, in *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq, opts ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq, ...grpc.CallOption) *agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendGrayLogImpossibleTravelData' -type AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call struct { - *mock.Call -} - -// SendGrayLogImpossibleTravelData is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) SendGrayLogImpossibleTravelData(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call { - return &AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call{Call: _e.mock.On("SendGrayLogImpossibleTravelData", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call) Return(_a0 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, _a1 error) *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, error)) *AgentsPublicApiV1SrvClient_SendGrayLogImpossibleTravelData_Call { - _c.Call.Return(run) - return _c -} - -// SendSentinelOneData provides a mock function with given fields: ctx, in, opts -func (_m *AgentsPublicApiV1SrvClient) SendSentinelOneData(ctx context.Context, in *agentsPublicApiV1.SendSentinelOneDataReq, opts ...grpc.CallOption) (*agentsPublicApiV1.SendSentinelOneDataRes, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *agentsPublicApiV1.SendSentinelOneDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendSentinelOneDataRes, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq, ...grpc.CallOption) *agentsPublicApiV1.SendSentinelOneDataRes); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendSentinelOneDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvClient_SendSentinelOneData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendSentinelOneData' -type AgentsPublicApiV1SrvClient_SendSentinelOneData_Call struct { - *mock.Call -} - -// SendSentinelOneData is a helper method to define mock.On call -// - ctx context.Context -// - in *agentsPublicApiV1.SendSentinelOneDataReq -// - opts ...grpc.CallOption -func (_e *AgentsPublicApiV1SrvClient_Expecter) SendSentinelOneData(ctx interface{}, in interface{}, opts ...interface{}) *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call { - return &AgentsPublicApiV1SrvClient_SendSentinelOneData_Call{Call: _e.mock.On("SendSentinelOneData", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call) Run(run func(ctx context.Context, in *agentsPublicApiV1.SendSentinelOneDataReq, opts ...grpc.CallOption)) *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]grpc.CallOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(grpc.CallOption) - } - } - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendSentinelOneDataReq), variadicArgs...) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call) Return(_a0 *agentsPublicApiV1.SendSentinelOneDataRes, _a1 error) *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq, ...grpc.CallOption) (*agentsPublicApiV1.SendSentinelOneDataRes, error)) *AgentsPublicApiV1SrvClient_SendSentinelOneData_Call { - _c.Call.Return(run) - return _c -} - -type mockConstructorTestingTNewAgentsPublicApiV1SrvClient interface { - mock.TestingT - Cleanup(func()) -} - -// NewAgentsPublicApiV1SrvClient creates a new instance of AgentsPublicApiV1SrvClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewAgentsPublicApiV1SrvClient(t mockConstructorTestingTNewAgentsPublicApiV1SrvClient) *AgentsPublicApiV1SrvClient { - mock := &AgentsPublicApiV1SrvClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/AgentsPublicApiV1SrvServer.go b/mocks/AgentsPublicApiV1SrvServer.go deleted file mode 100644 index 329e3b6..0000000 --- a/mocks/AgentsPublicApiV1SrvServer.go +++ /dev/null @@ -1,479 +0,0 @@ -// Code generated by mockery v2.25.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - agentsPublicApiV1 "pkg.redcarbon.ai/proto/redcarbon/public_apis/agents/api/v1" - - mock "github.com/stretchr/testify/mock" -) - -// AgentsPublicApiV1SrvServer is an autogenerated mock type for the AgentsPublicApiV1SrvServer type -type AgentsPublicApiV1SrvServer struct { - mock.Mock -} - -type AgentsPublicApiV1SrvServer_Expecter struct { - mock *mock.Mock -} - -func (_m *AgentsPublicApiV1SrvServer) EXPECT() *AgentsPublicApiV1SrvServer_Expecter { - return &AgentsPublicApiV1SrvServer_Expecter{mock: &_m.Mock} -} - -// GetGrayLogDataMinePendingQueries provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) GetGrayLogDataMinePendingQueries(_a0 context.Context, _a1 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq) (*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq) (*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq) *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGrayLogDataMinePendingQueries' -type AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call struct { - *mock.Call -} - -// GetGrayLogDataMinePendingQueries is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) GetGrayLogDataMinePendingQueries(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call { - return &AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call{Call: _e.mock.On("GetGrayLogDataMinePendingQueries", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq)) *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call) Return(_a0 *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, _a1 error) *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.GetGrayLogDataMinePendingQueriesReq) (*agentsPublicApiV1.GetGrayLogDataMinePendingQueriesRes, error)) *AgentsPublicApiV1SrvServer_GetGrayLogDataMinePendingQueries_Call { - _c.Call.Return(run) - return _c -} - -// HZ provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) HZ(_a0 context.Context, _a1 *agentsPublicApiV1.HZReq) (*agentsPublicApiV1.HZRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.HZRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.HZReq) (*agentsPublicApiV1.HZRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.HZReq) *agentsPublicApiV1.HZRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.HZRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.HZReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_HZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HZ' -type AgentsPublicApiV1SrvServer_HZ_Call struct { - *mock.Call -} - -// HZ is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.HZReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) HZ(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_HZ_Call { - return &AgentsPublicApiV1SrvServer_HZ_Call{Call: _e.mock.On("HZ", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_HZ_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.HZReq)) *AgentsPublicApiV1SrvServer_HZ_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.HZReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_HZ_Call) Return(_a0 *agentsPublicApiV1.HZRes, _a1 error) *AgentsPublicApiV1SrvServer_HZ_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_HZ_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.HZReq) (*agentsPublicApiV1.HZRes, error)) *AgentsPublicApiV1SrvServer_HZ_Call { - _c.Call.Return(run) - return _c -} - -// PullConfigurations provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) PullConfigurations(_a0 context.Context, _a1 *agentsPublicApiV1.PullConfigurationsReq) (*agentsPublicApiV1.PullConfigurationsRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.PullConfigurationsRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.PullConfigurationsReq) (*agentsPublicApiV1.PullConfigurationsRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.PullConfigurationsReq) *agentsPublicApiV1.PullConfigurationsRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.PullConfigurationsRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.PullConfigurationsReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_PullConfigurations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullConfigurations' -type AgentsPublicApiV1SrvServer_PullConfigurations_Call struct { - *mock.Call -} - -// PullConfigurations is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.PullConfigurationsReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) PullConfigurations(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_PullConfigurations_Call { - return &AgentsPublicApiV1SrvServer_PullConfigurations_Call{Call: _e.mock.On("PullConfigurations", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_PullConfigurations_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.PullConfigurationsReq)) *AgentsPublicApiV1SrvServer_PullConfigurations_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.PullConfigurationsReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_PullConfigurations_Call) Return(_a0 *agentsPublicApiV1.PullConfigurationsRes, _a1 error) *AgentsPublicApiV1SrvServer_PullConfigurations_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_PullConfigurations_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.PullConfigurationsReq) (*agentsPublicApiV1.PullConfigurationsRes, error)) *AgentsPublicApiV1SrvServer_PullConfigurations_Call { - _c.Call.Return(run) - return _c -} - -// RefreshToken provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) RefreshToken(_a0 context.Context, _a1 *agentsPublicApiV1.RefreshTokenReq) (*agentsPublicApiV1.RefreshTokenRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.RefreshTokenRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.RefreshTokenReq) (*agentsPublicApiV1.RefreshTokenRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.RefreshTokenReq) *agentsPublicApiV1.RefreshTokenRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.RefreshTokenRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.RefreshTokenReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_RefreshToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshToken' -type AgentsPublicApiV1SrvServer_RefreshToken_Call struct { - *mock.Call -} - -// RefreshToken is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.RefreshTokenReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) RefreshToken(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_RefreshToken_Call { - return &AgentsPublicApiV1SrvServer_RefreshToken_Call{Call: _e.mock.On("RefreshToken", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_RefreshToken_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.RefreshTokenReq)) *AgentsPublicApiV1SrvServer_RefreshToken_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.RefreshTokenReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_RefreshToken_Call) Return(_a0 *agentsPublicApiV1.RefreshTokenRes, _a1 error) *AgentsPublicApiV1SrvServer_RefreshToken_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_RefreshToken_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.RefreshTokenReq) (*agentsPublicApiV1.RefreshTokenRes, error)) *AgentsPublicApiV1SrvServer_RefreshToken_Call { - _c.Call.Return(run) - return _c -} - -// SendGrayLogDatamineQueryErrorData provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) SendGrayLogDatamineQueryErrorData(_a0 context.Context, _a1 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq) (*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq) (*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq) *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendGrayLogDatamineQueryErrorData' -type AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call struct { - *mock.Call -} - -// SendGrayLogDatamineQueryErrorData is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) SendGrayLogDatamineQueryErrorData(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call { - return &AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call{Call: _e.mock.On("SendGrayLogDatamineQueryErrorData", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq)) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call) Return(_a0 *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, _a1 error) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataReq) (*agentsPublicApiV1.SendGrayLogDatamineQueryErrorDataRes, error)) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryErrorData_Call { - _c.Call.Return(run) - return _c -} - -// SendGrayLogDatamineQueryResultsData provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) SendGrayLogDatamineQueryResultsData(_a0 context.Context, _a1 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq) (*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq) (*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq) *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendGrayLogDatamineQueryResultsData' -type AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call struct { - *mock.Call -} - -// SendGrayLogDatamineQueryResultsData is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) SendGrayLogDatamineQueryResultsData(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call { - return &AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call{Call: _e.mock.On("SendGrayLogDatamineQueryResultsData", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq)) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call) Return(_a0 *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, _a1 error) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataReq) (*agentsPublicApiV1.SendGrayLogDatamineQueryResultsDataRes, error)) *AgentsPublicApiV1SrvServer_SendGrayLogDatamineQueryResultsData_Call { - _c.Call.Return(run) - return _c -} - -// SendGrayLogImpossibleTravelData provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) SendGrayLogImpossibleTravelData(_a0 context.Context, _a1 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq) (*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq) (*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq) *agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendGrayLogImpossibleTravelData' -type AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call struct { - *mock.Call -} - -// SendGrayLogImpossibleTravelData is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) SendGrayLogImpossibleTravelData(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call { - return &AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call{Call: _e.mock.On("SendGrayLogImpossibleTravelData", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq)) *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call) Return(_a0 *agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, _a1 error) *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendGrayLogImpossibleTravelDataReq) (*agentsPublicApiV1.SendGrayLogImpossibleTravelDataRes, error)) *AgentsPublicApiV1SrvServer_SendGrayLogImpossibleTravelData_Call { - _c.Call.Return(run) - return _c -} - -// SendSentinelOneData provides a mock function with given fields: _a0, _a1 -func (_m *AgentsPublicApiV1SrvServer) SendSentinelOneData(_a0 context.Context, _a1 *agentsPublicApiV1.SendSentinelOneDataReq) (*agentsPublicApiV1.SendSentinelOneDataRes, error) { - ret := _m.Called(_a0, _a1) - - var r0 *agentsPublicApiV1.SendSentinelOneDataRes - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq) (*agentsPublicApiV1.SendSentinelOneDataRes, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq) *agentsPublicApiV1.SendSentinelOneDataRes); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*agentsPublicApiV1.SendSentinelOneDataRes) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentsPublicApiV1SrvServer_SendSentinelOneData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendSentinelOneData' -type AgentsPublicApiV1SrvServer_SendSentinelOneData_Call struct { - *mock.Call -} - -// SendSentinelOneData is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *agentsPublicApiV1.SendSentinelOneDataReq -func (_e *AgentsPublicApiV1SrvServer_Expecter) SendSentinelOneData(_a0 interface{}, _a1 interface{}) *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call { - return &AgentsPublicApiV1SrvServer_SendSentinelOneData_Call{Call: _e.mock.On("SendSentinelOneData", _a0, _a1)} -} - -func (_c *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call) Run(run func(_a0 context.Context, _a1 *agentsPublicApiV1.SendSentinelOneDataReq)) *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*agentsPublicApiV1.SendSentinelOneDataReq)) - }) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call) Return(_a0 *agentsPublicApiV1.SendSentinelOneDataRes, _a1 error) *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call) RunAndReturn(run func(context.Context, *agentsPublicApiV1.SendSentinelOneDataReq) (*agentsPublicApiV1.SendSentinelOneDataRes, error)) *AgentsPublicApiV1SrvServer_SendSentinelOneData_Call { - _c.Call.Return(run) - return _c -} - -type mockConstructorTestingTNewAgentsPublicApiV1SrvServer interface { - mock.TestingT - Cleanup(func()) -} - -// NewAgentsPublicApiV1SrvServer creates a new instance of AgentsPublicApiV1SrvServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewAgentsPublicApiV1SrvServer(t mockConstructorTestingTNewAgentsPublicApiV1SrvServer) *AgentsPublicApiV1SrvServer { - mock := &AgentsPublicApiV1SrvServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/Service.go b/mocks/Service.go deleted file mode 100644 index 7f060ee..0000000 --- a/mocks/Service.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by mockery v2.25.1. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" -) - -// Service is an autogenerated mock type for the Service type -type Service struct { - mock.Mock -} - -type Service_Expecter struct { - mock *mock.Mock -} - -func (_m *Service) EXPECT() *Service_Expecter { - return &Service_Expecter{mock: &_m.Mock} -} - -// RunService provides a mock function with given fields: ctx -func (_m *Service) RunService(ctx context.Context) { - _m.Called(ctx) -} - -// Service_RunService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunService' -type Service_RunService_Call struct { - *mock.Call -} - -// RunService is a helper method to define mock.On call -// - ctx context.Context -func (_e *Service_Expecter) RunService(ctx interface{}) *Service_RunService_Call { - return &Service_RunService_Call{Call: _e.mock.On("RunService", ctx)} -} - -func (_c *Service_RunService_Call) Run(run func(ctx context.Context)) *Service_RunService_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *Service_RunService_Call) Return() *Service_RunService_Call { - _c.Call.Return() - return _c -} - -func (_c *Service_RunService_Call) RunAndReturn(run func(context.Context)) *Service_RunService_Call { - _c.Call.Return(run) - return _c -} - -type mockConstructorTestingTNewService interface { - mock.TestingT - Cleanup(func()) -} - -// NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewService(t mockConstructorTestingTNewService) *Service { - mock := &Service{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/UnsafeAgentsPublicApiV1SrvServer.go b/mocks/UnsafeAgentsPublicApiV1SrvServer.go deleted file mode 100644 index 024472d..0000000 --- a/mocks/UnsafeAgentsPublicApiV1SrvServer.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.25.1. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// UnsafeAgentsPublicApiV1SrvServer is an autogenerated mock type for the UnsafeAgentsPublicApiV1SrvServer type -type UnsafeAgentsPublicApiV1SrvServer struct { - mock.Mock -} - -type UnsafeAgentsPublicApiV1SrvServer_Expecter struct { - mock *mock.Mock -} - -func (_m *UnsafeAgentsPublicApiV1SrvServer) EXPECT() *UnsafeAgentsPublicApiV1SrvServer_Expecter { - return &UnsafeAgentsPublicApiV1SrvServer_Expecter{mock: &_m.Mock} -} - -// mustEmbedUnimplementedAgentsPublicApiV1SrvServer provides a mock function with given fields: -func (_m *UnsafeAgentsPublicApiV1SrvServer) mustEmbedUnimplementedAgentsPublicApiV1SrvServer() { - _m.Called() -} - -// UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'mustEmbedUnimplementedAgentsPublicApiV1SrvServer' -type UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call struct { - *mock.Call -} - -// mustEmbedUnimplementedAgentsPublicApiV1SrvServer is a helper method to define mock.On call -func (_e *UnsafeAgentsPublicApiV1SrvServer_Expecter) mustEmbedUnimplementedAgentsPublicApiV1SrvServer() *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call { - return &UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call{Call: _e.mock.On("mustEmbedUnimplementedAgentsPublicApiV1SrvServer")} -} - -func (_c *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call) Run(run func()) *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call) Return() *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call { - _c.Call.Return() - return _c -} - -func (_c *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call) RunAndReturn(run func()) *UnsafeAgentsPublicApiV1SrvServer_mustEmbedUnimplementedAgentsPublicApiV1SrvServer_Call { - _c.Call.Return(run) - return _c -} - -type mockConstructorTestingTNewUnsafeAgentsPublicApiV1SrvServer interface { - mock.TestingT - Cleanup(func()) -} - -// NewUnsafeAgentsPublicApiV1SrvServer creates a new instance of UnsafeAgentsPublicApiV1SrvServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewUnsafeAgentsPublicApiV1SrvServer(t mockConstructorTestingTNewUnsafeAgentsPublicApiV1SrvServer) *UnsafeAgentsPublicApiV1SrvServer { - mock := &UnsafeAgentsPublicApiV1SrvServer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/isAgentConfigurationData_Data.go b/mocks/isAgentConfigurationData_Data.go deleted file mode 100644 index da98947..0000000 --- a/mocks/isAgentConfigurationData_Data.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.25.1. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// isAgentConfigurationData_Data is an autogenerated mock type for the isAgentConfigurationData_Data type -type isAgentConfigurationData_Data struct { - mock.Mock -} - -type isAgentConfigurationData_Data_Expecter struct { - mock *mock.Mock -} - -func (_m *isAgentConfigurationData_Data) EXPECT() *isAgentConfigurationData_Data_Expecter { - return &isAgentConfigurationData_Data_Expecter{mock: &_m.Mock} -} - -// isAgentConfigurationData_Data provides a mock function with given fields: -func (_m *isAgentConfigurationData_Data) isAgentConfigurationData_Data() { - _m.Called() -} - -// isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'isAgentConfigurationData_Data' -type isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call struct { - *mock.Call -} - -// isAgentConfigurationData_Data is a helper method to define mock.On call -func (_e *isAgentConfigurationData_Data_Expecter) isAgentConfigurationData_Data() *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call { - return &isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call{Call: _e.mock.On("isAgentConfigurationData_Data")} -} - -func (_c *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call) Run(run func()) *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call) Return() *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call { - _c.Call.Return() - return _c -} - -func (_c *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call) RunAndReturn(run func()) *isAgentConfigurationData_Data_isAgentConfigurationData_Data_Call { - _c.Call.Return(run) - return _c -} - -type mockConstructorTestingTnewIsAgentConfigurationData_Data interface { - mock.TestingT - Cleanup(func()) -} - -// newIsAgentConfigurationData_Data creates a new instance of isAgentConfigurationData_Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func newIsAgentConfigurationData_Data(t mockConstructorTestingTnewIsAgentConfigurationData_Data) *isAgentConfigurationData_Data { - mock := &isAgentConfigurationData_Data{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/proto/redcarbon/agents_public/v1/agents_publicv1connect/v1.connect.go b/proto/redcarbon/agents_public/v1/agents_publicv1connect/v1.connect.go new file mode 100644 index 0000000..2b75d35 --- /dev/null +++ b/proto/redcarbon/agents_public/v1/agents_publicv1connect/v1.connect.go @@ -0,0 +1,177 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: redcarbon/agents_public/v1/v1.proto + +package agents_publicv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + http "net/http" + v1 "pkg.redcarbon.ai/proto/redcarbon/agents_public/v1" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // AgentsPublicAPIsV1SrvName is the fully-qualified name of the AgentsPublicAPIsV1Srv service. + AgentsPublicAPIsV1SrvName = "redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // AgentsPublicAPIsV1SrvHZProcedure is the fully-qualified name of the AgentsPublicAPIsV1Srv's HZ + // RPC. + AgentsPublicAPIsV1SrvHZProcedure = "/redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv/HZ" + // AgentsPublicAPIsV1SrvIngestIncidentProcedure is the fully-qualified name of the + // AgentsPublicAPIsV1Srv's IngestIncident RPC. + AgentsPublicAPIsV1SrvIngestIncidentProcedure = "/redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv/IngestIncident" + // AgentsPublicAPIsV1SrvFetchAgentConfigurationProcedure is the fully-qualified name of the + // AgentsPublicAPIsV1Srv's FetchAgentConfiguration RPC. + AgentsPublicAPIsV1SrvFetchAgentConfigurationProcedure = "/redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv/FetchAgentConfiguration" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + agentsPublicAPIsV1SrvServiceDescriptor = v1.File_redcarbon_agents_public_v1_v1_proto.Services().ByName("AgentsPublicAPIsV1Srv") + agentsPublicAPIsV1SrvHZMethodDescriptor = agentsPublicAPIsV1SrvServiceDescriptor.Methods().ByName("HZ") + agentsPublicAPIsV1SrvIngestIncidentMethodDescriptor = agentsPublicAPIsV1SrvServiceDescriptor.Methods().ByName("IngestIncident") + agentsPublicAPIsV1SrvFetchAgentConfigurationMethodDescriptor = agentsPublicAPIsV1SrvServiceDescriptor.Methods().ByName("FetchAgentConfiguration") +) + +// AgentsPublicAPIsV1SrvClient is a client for the redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv +// service. +type AgentsPublicAPIsV1SrvClient interface { + HZ(context.Context, *connect.Request[v1.HZRequest]) (*connect.Response[v1.HZResponse], error) + IngestIncident(context.Context, *connect.Request[v1.IngestIncidentRequest]) (*connect.Response[v1.IngestIncidentResponse], error) + FetchAgentConfiguration(context.Context, *connect.Request[v1.FetchAgentConfigurationRequest]) (*connect.Response[v1.FetchAgentConfigurationResponse], error) +} + +// NewAgentsPublicAPIsV1SrvClient constructs a client for the +// redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv service. By default, it uses the Connect +// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed +// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or +// connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewAgentsPublicAPIsV1SrvClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AgentsPublicAPIsV1SrvClient { + baseURL = strings.TrimRight(baseURL, "/") + return &agentsPublicAPIsV1SrvClient{ + hZ: connect.NewClient[v1.HZRequest, v1.HZResponse]( + httpClient, + baseURL+AgentsPublicAPIsV1SrvHZProcedure, + connect.WithSchema(agentsPublicAPIsV1SrvHZMethodDescriptor), + connect.WithClientOptions(opts...), + ), + ingestIncident: connect.NewClient[v1.IngestIncidentRequest, v1.IngestIncidentResponse]( + httpClient, + baseURL+AgentsPublicAPIsV1SrvIngestIncidentProcedure, + connect.WithSchema(agentsPublicAPIsV1SrvIngestIncidentMethodDescriptor), + connect.WithClientOptions(opts...), + ), + fetchAgentConfiguration: connect.NewClient[v1.FetchAgentConfigurationRequest, v1.FetchAgentConfigurationResponse]( + httpClient, + baseURL+AgentsPublicAPIsV1SrvFetchAgentConfigurationProcedure, + connect.WithSchema(agentsPublicAPIsV1SrvFetchAgentConfigurationMethodDescriptor), + connect.WithClientOptions(opts...), + ), + } +} + +// agentsPublicAPIsV1SrvClient implements AgentsPublicAPIsV1SrvClient. +type agentsPublicAPIsV1SrvClient struct { + hZ *connect.Client[v1.HZRequest, v1.HZResponse] + ingestIncident *connect.Client[v1.IngestIncidentRequest, v1.IngestIncidentResponse] + fetchAgentConfiguration *connect.Client[v1.FetchAgentConfigurationRequest, v1.FetchAgentConfigurationResponse] +} + +// HZ calls redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.HZ. +func (c *agentsPublicAPIsV1SrvClient) HZ(ctx context.Context, req *connect.Request[v1.HZRequest]) (*connect.Response[v1.HZResponse], error) { + return c.hZ.CallUnary(ctx, req) +} + +// IngestIncident calls redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.IngestIncident. +func (c *agentsPublicAPIsV1SrvClient) IngestIncident(ctx context.Context, req *connect.Request[v1.IngestIncidentRequest]) (*connect.Response[v1.IngestIncidentResponse], error) { + return c.ingestIncident.CallUnary(ctx, req) +} + +// FetchAgentConfiguration calls +// redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.FetchAgentConfiguration. +func (c *agentsPublicAPIsV1SrvClient) FetchAgentConfiguration(ctx context.Context, req *connect.Request[v1.FetchAgentConfigurationRequest]) (*connect.Response[v1.FetchAgentConfigurationResponse], error) { + return c.fetchAgentConfiguration.CallUnary(ctx, req) +} + +// AgentsPublicAPIsV1SrvHandler is an implementation of the +// redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv service. +type AgentsPublicAPIsV1SrvHandler interface { + HZ(context.Context, *connect.Request[v1.HZRequest]) (*connect.Response[v1.HZResponse], error) + IngestIncident(context.Context, *connect.Request[v1.IngestIncidentRequest]) (*connect.Response[v1.IngestIncidentResponse], error) + FetchAgentConfiguration(context.Context, *connect.Request[v1.FetchAgentConfigurationRequest]) (*connect.Response[v1.FetchAgentConfigurationResponse], error) +} + +// NewAgentsPublicAPIsV1SrvHandler builds an HTTP handler from the service implementation. It +// returns the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewAgentsPublicAPIsV1SrvHandler(svc AgentsPublicAPIsV1SrvHandler, opts ...connect.HandlerOption) (string, http.Handler) { + agentsPublicAPIsV1SrvHZHandler := connect.NewUnaryHandler( + AgentsPublicAPIsV1SrvHZProcedure, + svc.HZ, + connect.WithSchema(agentsPublicAPIsV1SrvHZMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + agentsPublicAPIsV1SrvIngestIncidentHandler := connect.NewUnaryHandler( + AgentsPublicAPIsV1SrvIngestIncidentProcedure, + svc.IngestIncident, + connect.WithSchema(agentsPublicAPIsV1SrvIngestIncidentMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + agentsPublicAPIsV1SrvFetchAgentConfigurationHandler := connect.NewUnaryHandler( + AgentsPublicAPIsV1SrvFetchAgentConfigurationProcedure, + svc.FetchAgentConfiguration, + connect.WithSchema(agentsPublicAPIsV1SrvFetchAgentConfigurationMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + return "/redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case AgentsPublicAPIsV1SrvHZProcedure: + agentsPublicAPIsV1SrvHZHandler.ServeHTTP(w, r) + case AgentsPublicAPIsV1SrvIngestIncidentProcedure: + agentsPublicAPIsV1SrvIngestIncidentHandler.ServeHTTP(w, r) + case AgentsPublicAPIsV1SrvFetchAgentConfigurationProcedure: + agentsPublicAPIsV1SrvFetchAgentConfigurationHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedAgentsPublicAPIsV1SrvHandler returns CodeUnimplemented from all methods. +type UnimplementedAgentsPublicAPIsV1SrvHandler struct{} + +func (UnimplementedAgentsPublicAPIsV1SrvHandler) HZ(context.Context, *connect.Request[v1.HZRequest]) (*connect.Response[v1.HZResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.HZ is not implemented")) +} + +func (UnimplementedAgentsPublicAPIsV1SrvHandler) IngestIncident(context.Context, *connect.Request[v1.IngestIncidentRequest]) (*connect.Response[v1.IngestIncidentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.IngestIncident is not implemented")) +} + +func (UnimplementedAgentsPublicAPIsV1SrvHandler) FetchAgentConfiguration(context.Context, *connect.Request[v1.FetchAgentConfigurationRequest]) (*connect.Response[v1.FetchAgentConfigurationResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.FetchAgentConfiguration is not implemented")) +} diff --git a/proto/redcarbon/agents_public/v1/types.pb.go b/proto/redcarbon/agents_public/v1/types.pb.go new file mode 100644 index 0000000..557108c --- /dev/null +++ b/proto/redcarbon/agents_public/v1/types.pb.go @@ -0,0 +1,251 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: redcarbon/agents_public/v1/types.proto + +package agents_publicv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 AgentConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QradarJobConfiguration *QRadarJobConfiguration `protobuf:"bytes,1,opt,name=qradar_job_configuration,json=qradarJobConfiguration,proto3,oneof" json:"qradar_job_configuration,omitempty"` +} + +func (x *AgentConfiguration) Reset() { + *x = AgentConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AgentConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentConfiguration) ProtoMessage() {} + +func (x *AgentConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentConfiguration.ProtoReflect.Descriptor instead. +func (*AgentConfiguration) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *AgentConfiguration) GetQradarJobConfiguration() *QRadarJobConfiguration { + if x != nil { + return x.QradarJobConfiguration + } + return nil +} + +type QRadarJobConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + VerifySsl bool `protobuf:"varint,3,opt,name=verify_ssl,json=verifySsl,proto3" json:"verify_ssl,omitempty"` +} + +func (x *QRadarJobConfiguration) Reset() { + *x = QRadarJobConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QRadarJobConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QRadarJobConfiguration) ProtoMessage() {} + +func (x *QRadarJobConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QRadarJobConfiguration.ProtoReflect.Descriptor instead. +func (*QRadarJobConfiguration) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_types_proto_rawDescGZIP(), []int{1} +} + +func (x *QRadarJobConfiguration) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *QRadarJobConfiguration) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *QRadarJobConfiguration) GetVerifySsl() bool { + if x != nil { + return x.VerifySsl + } + return false +} + +var File_redcarbon_agents_public_v1_types_proto protoreflect.FileDescriptor + +var file_redcarbon_agents_public_v1_types_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, + 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x2e, 0x76, 0x31, 0x22, 0xa4, 0x01, 0x0a, 0x12, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x71, 0x0a, 0x18, 0x71, + 0x72, 0x61, 0x64, 0x61, 0x72, 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, + 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x52, 0x61, 0x64, 0x61, + 0x72, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x00, 0x52, 0x16, 0x71, 0x72, 0x61, 0x64, 0x61, 0x72, 0x4a, 0x6f, 0x62, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x1b, + 0x0a, 0x19, 0x5f, 0x71, 0x72, 0x61, 0x64, 0x61, 0x72, 0x5f, 0x6a, 0x6f, 0x62, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x61, 0x0a, 0x16, 0x51, + 0x52, 0x61, 0x64, 0x61, 0x72, 0x4a, 0x6f, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x1d, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x73, 0x6c, 0x42, 0xf5, + 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x41, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, + 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, + 0x6e, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, + 0x76, 0x31, 0x3b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x19, 0x52, 0x65, 0x64, 0x63, 0x61, + 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x52, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, + 0x5c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x25, 0x52, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x5c, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x52, 0x65, 0x64, 0x63, 0x61, + 0x72, 0x62, 0x6f, 0x6e, 0x3a, 0x3a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_redcarbon_agents_public_v1_types_proto_rawDescOnce sync.Once + file_redcarbon_agents_public_v1_types_proto_rawDescData = file_redcarbon_agents_public_v1_types_proto_rawDesc +) + +func file_redcarbon_agents_public_v1_types_proto_rawDescGZIP() []byte { + file_redcarbon_agents_public_v1_types_proto_rawDescOnce.Do(func() { + file_redcarbon_agents_public_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_redcarbon_agents_public_v1_types_proto_rawDescData) + }) + return file_redcarbon_agents_public_v1_types_proto_rawDescData +} + +var file_redcarbon_agents_public_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_redcarbon_agents_public_v1_types_proto_goTypes = []interface{}{ + (*AgentConfiguration)(nil), // 0: redcarbon.agents_public.v1.AgentConfiguration + (*QRadarJobConfiguration)(nil), // 1: redcarbon.agents_public.v1.QRadarJobConfiguration +} +var file_redcarbon_agents_public_v1_types_proto_depIdxs = []int32{ + 1, // 0: redcarbon.agents_public.v1.AgentConfiguration.qradar_job_configuration:type_name -> redcarbon.agents_public.v1.QRadarJobConfiguration + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_redcarbon_agents_public_v1_types_proto_init() } +func file_redcarbon_agents_public_v1_types_proto_init() { + if File_redcarbon_agents_public_v1_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_redcarbon_agents_public_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AgentConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_redcarbon_agents_public_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QRadarJobConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_redcarbon_agents_public_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_redcarbon_agents_public_v1_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_redcarbon_agents_public_v1_types_proto_goTypes, + DependencyIndexes: file_redcarbon_agents_public_v1_types_proto_depIdxs, + MessageInfos: file_redcarbon_agents_public_v1_types_proto_msgTypes, + }.Build() + File_redcarbon_agents_public_v1_types_proto = out.File + file_redcarbon_agents_public_v1_types_proto_rawDesc = nil + file_redcarbon_agents_public_v1_types_proto_goTypes = nil + file_redcarbon_agents_public_v1_types_proto_depIdxs = nil +} diff --git a/proto/redcarbon/agents_public/v1/v1.pb.go b/proto/redcarbon/agents_public/v1/v1.pb.go new file mode 100644 index 0000000..2763a58 --- /dev/null +++ b/proto/redcarbon/agents_public/v1/v1.pb.go @@ -0,0 +1,561 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: redcarbon/agents_public/v1/v1.proto + +package agents_publicv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +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 HZRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` +} + +func (x *HZRequest) Reset() { + *x = HZRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HZRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HZRequest) ProtoMessage() {} + +func (x *HZRequest) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HZRequest.ProtoReflect.Descriptor instead. +func (*HZRequest) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP(), []int{0} +} + +func (x *HZRequest) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *HZRequest) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type HZResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` +} + +func (x *HZResponse) Reset() { + *x = HZResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HZResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HZResponse) ProtoMessage() {} + +func (x *HZResponse) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HZResponse.ProtoReflect.Descriptor instead. +func (*HZResponse) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP(), []int{1} +} + +func (x *HZResponse) GetReceivedAt() *timestamppb.Timestamp { + if x != nil { + return x.ReceivedAt + } + return nil +} + +type IngestIncidentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + RawData string `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` + Severity uint32 `protobuf:"varint,4,opt,name=severity,proto3" json:"severity,omitempty"` + Origin string `protobuf:"bytes,5,opt,name=origin,proto3" json:"origin,omitempty"` + OriginalId *string `protobuf:"bytes,6,opt,name=original_id,json=originalId,proto3,oneof" json:"original_id,omitempty"` +} + +func (x *IngestIncidentRequest) Reset() { + *x = IngestIncidentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IngestIncidentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IngestIncidentRequest) ProtoMessage() {} + +func (x *IngestIncidentRequest) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IngestIncidentRequest.ProtoReflect.Descriptor instead. +func (*IngestIncidentRequest) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP(), []int{2} +} + +func (x *IngestIncidentRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *IngestIncidentRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *IngestIncidentRequest) GetRawData() string { + if x != nil { + return x.RawData + } + return "" +} + +func (x *IngestIncidentRequest) GetSeverity() uint32 { + if x != nil { + return x.Severity + } + return 0 +} + +func (x *IngestIncidentRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *IngestIncidentRequest) GetOriginalId() string { + if x != nil && x.OriginalId != nil { + return *x.OriginalId + } + return "" +} + +type IngestIncidentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *IngestIncidentResponse) Reset() { + *x = IngestIncidentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IngestIncidentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IngestIncidentResponse) ProtoMessage() {} + +func (x *IngestIncidentResponse) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IngestIncidentResponse.ProtoReflect.Descriptor instead. +func (*IngestIncidentResponse) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP(), []int{3} +} + +type FetchAgentConfigurationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FetchAgentConfigurationRequest) Reset() { + *x = FetchAgentConfigurationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchAgentConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchAgentConfigurationRequest) ProtoMessage() {} + +func (x *FetchAgentConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchAgentConfigurationRequest.ProtoReflect.Descriptor instead. +func (*FetchAgentConfigurationRequest) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP(), []int{4} +} + +type FetchAgentConfigurationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Configuration *AgentConfiguration `protobuf:"bytes,1,opt,name=configuration,proto3" json:"configuration,omitempty"` +} + +func (x *FetchAgentConfigurationResponse) Reset() { + *x = FetchAgentConfigurationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchAgentConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchAgentConfigurationResponse) ProtoMessage() {} + +func (x *FetchAgentConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_redcarbon_agents_public_v1_v1_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchAgentConfigurationResponse.ProtoReflect.Descriptor instead. +func (*FetchAgentConfigurationResponse) Descriptor() ([]byte, []int) { + return file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP(), []int{5} +} + +func (x *FetchAgentConfigurationResponse) GetConfiguration() *AgentConfiguration { + if x != nil { + return x.Configuration + } + return nil +} + +var File_redcarbon_agents_public_v1_v1_proto protoreflect.FileDescriptor + +var file_redcarbon_agents_public_v1_v1_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x31, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, + 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, + 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x26, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x37, 0x0a, 0x09, 0x48, 0x5a, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x70, 0x22, 0x49, 0x0a, 0x0a, 0x48, 0x5a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0xd4, + 0x01, 0x0a, 0x15, 0x49, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x73, + 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, + 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, + 0x24, 0x0a, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, + 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x49, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x49, + 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x20, 0x0a, 0x1e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x77, 0x0a, 0x1f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x72, 0x65, + 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x80, 0x03, 0x0a, 0x15, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x50, 0x49, 0x73, 0x56, + 0x31, 0x53, 0x72, 0x76, 0x12, 0x55, 0x0a, 0x02, 0x48, 0x5a, 0x12, 0x25, 0x2e, 0x72, 0x65, 0x64, + 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x5a, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, + 0x5a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x79, 0x0a, 0x0e, 0x49, + 0x6e, 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x2e, + 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, + 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x67, 0x65, 0x73, + 0x74, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x32, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x67, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x94, 0x01, 0x0a, 0x17, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x3a, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, + 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, + 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, + 0x68, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xf2, 0x01, + 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, + 0x42, 0x07, 0x56, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x70, 0x6b, 0x67, + 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x69, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x52, 0x41, 0x58, 0xaa, 0x02, 0x19, 0x52, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, + 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x19, 0x52, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x5c, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x52, + 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x5c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x52, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, + 0x3a, 0x3a, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_redcarbon_agents_public_v1_v1_proto_rawDescOnce sync.Once + file_redcarbon_agents_public_v1_v1_proto_rawDescData = file_redcarbon_agents_public_v1_v1_proto_rawDesc +) + +func file_redcarbon_agents_public_v1_v1_proto_rawDescGZIP() []byte { + file_redcarbon_agents_public_v1_v1_proto_rawDescOnce.Do(func() { + file_redcarbon_agents_public_v1_v1_proto_rawDescData = protoimpl.X.CompressGZIP(file_redcarbon_agents_public_v1_v1_proto_rawDescData) + }) + return file_redcarbon_agents_public_v1_v1_proto_rawDescData +} + +var file_redcarbon_agents_public_v1_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_redcarbon_agents_public_v1_v1_proto_goTypes = []interface{}{ + (*HZRequest)(nil), // 0: redcarbon.agents_public.v1.HZRequest + (*HZResponse)(nil), // 1: redcarbon.agents_public.v1.HZResponse + (*IngestIncidentRequest)(nil), // 2: redcarbon.agents_public.v1.IngestIncidentRequest + (*IngestIncidentResponse)(nil), // 3: redcarbon.agents_public.v1.IngestIncidentResponse + (*FetchAgentConfigurationRequest)(nil), // 4: redcarbon.agents_public.v1.FetchAgentConfigurationRequest + (*FetchAgentConfigurationResponse)(nil), // 5: redcarbon.agents_public.v1.FetchAgentConfigurationResponse + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*AgentConfiguration)(nil), // 7: redcarbon.agents_public.v1.AgentConfiguration +} +var file_redcarbon_agents_public_v1_v1_proto_depIdxs = []int32{ + 6, // 0: redcarbon.agents_public.v1.HZResponse.received_at:type_name -> google.protobuf.Timestamp + 7, // 1: redcarbon.agents_public.v1.FetchAgentConfigurationResponse.configuration:type_name -> redcarbon.agents_public.v1.AgentConfiguration + 0, // 2: redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.HZ:input_type -> redcarbon.agents_public.v1.HZRequest + 2, // 3: redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.IngestIncident:input_type -> redcarbon.agents_public.v1.IngestIncidentRequest + 4, // 4: redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.FetchAgentConfiguration:input_type -> redcarbon.agents_public.v1.FetchAgentConfigurationRequest + 1, // 5: redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.HZ:output_type -> redcarbon.agents_public.v1.HZResponse + 3, // 6: redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.IngestIncident:output_type -> redcarbon.agents_public.v1.IngestIncidentResponse + 5, // 7: redcarbon.agents_public.v1.AgentsPublicAPIsV1Srv.FetchAgentConfiguration:output_type -> redcarbon.agents_public.v1.FetchAgentConfigurationResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_redcarbon_agents_public_v1_v1_proto_init() } +func file_redcarbon_agents_public_v1_v1_proto_init() { + if File_redcarbon_agents_public_v1_v1_proto != nil { + return + } + file_redcarbon_agents_public_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_redcarbon_agents_public_v1_v1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HZRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_redcarbon_agents_public_v1_v1_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HZResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_redcarbon_agents_public_v1_v1_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IngestIncidentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_redcarbon_agents_public_v1_v1_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IngestIncidentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_redcarbon_agents_public_v1_v1_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchAgentConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_redcarbon_agents_public_v1_v1_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchAgentConfigurationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_redcarbon_agents_public_v1_v1_proto_msgTypes[2].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_redcarbon_agents_public_v1_v1_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_redcarbon_agents_public_v1_v1_proto_goTypes, + DependencyIndexes: file_redcarbon_agents_public_v1_v1_proto_depIdxs, + MessageInfos: file_redcarbon_agents_public_v1_v1_proto_msgTypes, + }.Build() + File_redcarbon_agents_public_v1_v1_proto = out.File + file_redcarbon_agents_public_v1_v1_proto_rawDesc = nil + file_redcarbon_agents_public_v1_v1_proto_goTypes = nil + file_redcarbon_agents_public_v1_v1_proto_depIdxs = nil +} diff --git a/proto/redcarbon/public_apis/agents/api/v1/types.pb.go b/proto/redcarbon/public_apis/agents/api/v1/types.pb.go deleted file mode 100644 index f39e7ad..0000000 --- a/proto/redcarbon/public_apis/agents/api/v1/types.pb.go +++ /dev/null @@ -1,933 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1-devel -// protoc (unknown) -// source: redcarbon/public_apis/agents/api/v1/types.proto - -package agentsPublicApiV1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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 DataType int32 - -const ( - DataType_UNSUPPORTED DataType = 0 - DataType_SENTINEL_ONE DataType = 1 - DataType_GRAYLOG_IMPOSSIBLE_TRAVEL DataType = 2 - DataType_GRAYLOG_DATAMINE DataType = 3 -) - -// Enum value maps for DataType. -var ( - DataType_name = map[int32]string{ - 0: "UNSUPPORTED", - 1: "SENTINEL_ONE", - 2: "GRAYLOG_IMPOSSIBLE_TRAVEL", - 3: "GRAYLOG_DATAMINE", - } - DataType_value = map[string]int32{ - "UNSUPPORTED": 0, - "SENTINEL_ONE": 1, - "GRAYLOG_IMPOSSIBLE_TRAVEL": 2, - "GRAYLOG_DATAMINE": 3, - } -) - -func (x DataType) Enum() *DataType { - p := new(DataType) - *p = x - return p -} - -func (x DataType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataType) Descriptor() protoreflect.EnumDescriptor { - return file_redcarbon_public_apis_agents_api_v1_types_proto_enumTypes[0].Descriptor() -} - -func (DataType) Type() protoreflect.EnumType { - return &file_redcarbon_public_apis_agents_api_v1_types_proto_enumTypes[0] -} - -func (x DataType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DataType.Descriptor instead. -func (DataType) EnumDescriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{0} -} - -type AgentConfiguration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurationId string `protobuf:"bytes,1,opt,name=agent_configuration_id,json=agentConfigurationId,proto3" json:"agent_configuration_id,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Data *AgentConfigurationData `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` -} - -func (x *AgentConfiguration) Reset() { - *x = AgentConfiguration{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AgentConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentConfiguration) ProtoMessage() {} - -func (x *AgentConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentConfiguration.ProtoReflect.Descriptor instead. -func (*AgentConfiguration) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{0} -} - -func (x *AgentConfiguration) GetAgentConfigurationId() string { - if x != nil { - return x.AgentConfigurationId - } - return "" -} - -func (x *AgentConfiguration) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *AgentConfiguration) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *AgentConfiguration) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AgentConfiguration) GetData() *AgentConfigurationData { - if x != nil { - return x.Data - } - return nil -} - -func (x *AgentConfiguration) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -type AgentConfigurationData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Data: - // - // *AgentConfigurationData_SentinelOne - // *AgentConfigurationData_GraylogImpossibleTravel - // *AgentConfigurationData_GraylogDatamine - Data isAgentConfigurationData_Data `protobuf_oneof:"data"` -} - -func (x *AgentConfigurationData) Reset() { - *x = AgentConfigurationData{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AgentConfigurationData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentConfigurationData) ProtoMessage() {} - -func (x *AgentConfigurationData) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentConfigurationData.ProtoReflect.Descriptor instead. -func (*AgentConfigurationData) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{1} -} - -func (m *AgentConfigurationData) GetData() isAgentConfigurationData_Data { - if m != nil { - return m.Data - } - return nil -} - -func (x *AgentConfigurationData) GetSentinelOne() *SentinelOneData { - if x, ok := x.GetData().(*AgentConfigurationData_SentinelOne); ok { - return x.SentinelOne - } - return nil -} - -func (x *AgentConfigurationData) GetGraylogImpossibleTravel() *GrayLogImpossibleTravelData { - if x, ok := x.GetData().(*AgentConfigurationData_GraylogImpossibleTravel); ok { - return x.GraylogImpossibleTravel - } - return nil -} - -func (x *AgentConfigurationData) GetGraylogDatamine() *GrayLogDataMineData { - if x, ok := x.GetData().(*AgentConfigurationData_GraylogDatamine); ok { - return x.GraylogDatamine - } - return nil -} - -type isAgentConfigurationData_Data interface { - isAgentConfigurationData_Data() -} - -type AgentConfigurationData_SentinelOne struct { - SentinelOne *SentinelOneData `protobuf:"bytes,1,opt,name=sentinel_one,json=sentinelOne,proto3,oneof"` -} - -type AgentConfigurationData_GraylogImpossibleTravel struct { - GraylogImpossibleTravel *GrayLogImpossibleTravelData `protobuf:"bytes,2,opt,name=graylog_impossible_travel,json=graylogImpossibleTravel,proto3,oneof"` -} - -type AgentConfigurationData_GraylogDatamine struct { - GraylogDatamine *GrayLogDataMineData `protobuf:"bytes,3,opt,name=graylog_datamine,json=graylogDatamine,proto3,oneof"` -} - -func (*AgentConfigurationData_SentinelOne) isAgentConfigurationData_Data() {} - -func (*AgentConfigurationData_GraylogImpossibleTravel) isAgentConfigurationData_Data() {} - -func (*AgentConfigurationData_GraylogDatamine) isAgentConfigurationData_Data() {} - -type SentinelOneData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ApiToken string `protobuf:"bytes,1,opt,name=api_token,json=apiToken,proto3" json:"api_token,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` -} - -func (x *SentinelOneData) Reset() { - *x = SentinelOneData{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SentinelOneData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SentinelOneData) ProtoMessage() {} - -func (x *SentinelOneData) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SentinelOneData.ProtoReflect.Descriptor instead. -func (*SentinelOneData) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{2} -} - -func (x *SentinelOneData) GetApiToken() string { - if x != nil { - return x.ApiToken - } - return "" -} - -func (x *SentinelOneData) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -type GrayLogImpossibleTravelData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - SkipSsl bool `protobuf:"varint,3,opt,name=skip_ssl,json=skipSsl,proto3" json:"skip_ssl,omitempty"` - TimeWindow *durationpb.Duration `protobuf:"bytes,4,opt,name=time_window,json=timeWindow,proto3" json:"time_window,omitempty"` -} - -func (x *GrayLogImpossibleTravelData) Reset() { - *x = GrayLogImpossibleTravelData{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrayLogImpossibleTravelData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrayLogImpossibleTravelData) ProtoMessage() {} - -func (x *GrayLogImpossibleTravelData) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrayLogImpossibleTravelData.ProtoReflect.Descriptor instead. -func (*GrayLogImpossibleTravelData) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{3} -} - -func (x *GrayLogImpossibleTravelData) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *GrayLogImpossibleTravelData) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *GrayLogImpossibleTravelData) GetSkipSsl() bool { - if x != nil { - return x.SkipSsl - } - return false -} - -func (x *GrayLogImpossibleTravelData) GetTimeWindow() *durationpb.Duration { - if x != nil { - return x.TimeWindow - } - return nil -} - -type GrayLogDataMineData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - SkipSsl bool `protobuf:"varint,3,opt,name=skip_ssl,json=skipSsl,proto3" json:"skip_ssl,omitempty"` -} - -func (x *GrayLogDataMineData) Reset() { - *x = GrayLogDataMineData{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrayLogDataMineData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrayLogDataMineData) ProtoMessage() {} - -func (x *GrayLogDataMineData) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrayLogDataMineData.ProtoReflect.Descriptor instead. -func (*GrayLogDataMineData) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{4} -} - -func (x *GrayLogDataMineData) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *GrayLogDataMineData) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *GrayLogDataMineData) GetSkipSsl() bool { - if x != nil { - return x.SkipSsl - } - return false -} - -type GrayLogImpossibleTravelLog struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Logs map[string]string `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *GrayLogImpossibleTravelLog) Reset() { - *x = GrayLogImpossibleTravelLog{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrayLogImpossibleTravelLog) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrayLogImpossibleTravelLog) ProtoMessage() {} - -func (x *GrayLogImpossibleTravelLog) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrayLogImpossibleTravelLog.ProtoReflect.Descriptor instead. -func (*GrayLogImpossibleTravelLog) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{5} -} - -func (x *GrayLogImpossibleTravelLog) GetLogs() map[string]string { - if x != nil { - return x.Logs - } - return nil -} - -type GrayLogDataMineResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` - Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *GrayLogDataMineResult) Reset() { - *x = GrayLogDataMineResult{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrayLogDataMineResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrayLogDataMineResult) ProtoMessage() {} - -func (x *GrayLogDataMineResult) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrayLogDataMineResult.ProtoReflect.Descriptor instead. -func (*GrayLogDataMineResult) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{6} -} - -func (x *GrayLogDataMineResult) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *GrayLogDataMineResult) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *GrayLogDataMineResult) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - -func (x *GrayLogDataMineResult) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type GrayLogDataMineQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - SearchStartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=search_start_time,json=searchStartTime,proto3" json:"search_start_time,omitempty"` - SearchStopTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=search_stop_time,json=searchStopTime,proto3" json:"search_stop_time,omitempty"` - Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *GrayLogDataMineQuery) Reset() { - *x = GrayLogDataMineQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrayLogDataMineQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrayLogDataMineQuery) ProtoMessage() {} - -func (x *GrayLogDataMineQuery) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrayLogDataMineQuery.ProtoReflect.Descriptor instead. -func (*GrayLogDataMineQuery) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP(), []int{7} -} - -func (x *GrayLogDataMineQuery) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *GrayLogDataMineQuery) GetSearchStartTime() *timestamppb.Timestamp { - if x != nil { - return x.SearchStartTime - } - return nil -} - -func (x *GrayLogDataMineQuery) GetSearchStopTime() *timestamppb.Timestamp { - if x != nil { - return x.SearchStopTime - } - return nil -} - -func (x *GrayLogDataMineQuery) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -var File_redcarbon_public_apis_agents_api_v1_types_proto protoreflect.FileDescriptor - -var file_redcarbon_public_apis_agents_api_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x2f, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x23, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x02, 0x0a, 0x12, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, - 0x0a, 0x16, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x72, - 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x22, 0xe2, 0x02, 0x0a, 0x16, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x59, - 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x6c, 0x5f, 0x6f, 0x6e, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, - 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x69, - 0x6e, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x65, - 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x7e, 0x0a, 0x19, 0x67, 0x72, 0x61, - 0x79, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x5f, - 0x74, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x72, - 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, - 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, - 0x52, 0x17, 0x67, 0x72, 0x61, 0x79, 0x6c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, - 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x12, 0x65, 0x0a, 0x10, 0x67, 0x72, 0x61, - 0x79, 0x6c, 0x6f, 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, - 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, - 0x0f, 0x67, 0x72, 0x61, 0x79, 0x6c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, - 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x40, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x74, - 0x69, 0x6e, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x61, - 0x70, 0x69, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x61, 0x70, 0x69, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x9c, 0x01, 0x0a, 0x1b, 0x47, - 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, - 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x70, 0x53, 0x73, 0x6c, 0x12, 0x3a, 0x0a, - 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x74, - 0x69, 0x6d, 0x65, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x58, 0x0a, 0x13, 0x47, 0x72, 0x61, - 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x6b, 0x69, 0x70, - 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x70, - 0x53, 0x73, 0x6c, 0x22, 0xb4, 0x01, 0x0a, 0x1a, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, - 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x4c, - 0x6f, 0x67, 0x12, 0x5d, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x49, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, - 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x4c, 0x6f, - 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6c, 0x6f, 0x67, - 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x97, 0x01, 0x0a, 0x15, 0x47, - 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, - 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0xca, 0x01, 0x0a, 0x14, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x46, 0x0a, - 0x11, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, - 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2a, 0x62, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, - 0x0b, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, - 0x0a, 0x0c, 0x53, 0x45, 0x4e, 0x54, 0x49, 0x4e, 0x45, 0x4c, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, - 0x12, 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x41, 0x59, 0x4c, 0x4f, 0x47, 0x5f, 0x49, 0x4d, 0x50, 0x4f, - 0x53, 0x53, 0x49, 0x42, 0x4c, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x56, 0x45, 0x4c, 0x10, 0x02, 0x12, - 0x14, 0x0a, 0x10, 0x47, 0x52, 0x41, 0x59, 0x4c, 0x4f, 0x47, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x4d, - 0x49, 0x4e, 0x45, 0x10, 0x03, 0x42, 0x4e, 0x5a, 0x4c, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x64, - 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x61, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x41, 0x70, 0x69, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescOnce sync.Once - file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescData = file_redcarbon_public_apis_agents_api_v1_types_proto_rawDesc -) - -func file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescGZIP() []byte { - file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescOnce.Do(func() { - file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescData) - }) - return file_redcarbon_public_apis_agents_api_v1_types_proto_rawDescData -} - -var file_redcarbon_public_apis_agents_api_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_redcarbon_public_apis_agents_api_v1_types_proto_goTypes = []interface{}{ - (DataType)(0), // 0: redcarbon.public_apis.agents.api.v1.DataType - (*AgentConfiguration)(nil), // 1: redcarbon.public_apis.agents.api.v1.AgentConfiguration - (*AgentConfigurationData)(nil), // 2: redcarbon.public_apis.agents.api.v1.AgentConfigurationData - (*SentinelOneData)(nil), // 3: redcarbon.public_apis.agents.api.v1.SentinelOneData - (*GrayLogImpossibleTravelData)(nil), // 4: redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelData - (*GrayLogDataMineData)(nil), // 5: redcarbon.public_apis.agents.api.v1.GrayLogDataMineData - (*GrayLogImpossibleTravelLog)(nil), // 6: redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelLog - (*GrayLogDataMineResult)(nil), // 7: redcarbon.public_apis.agents.api.v1.GrayLogDataMineResult - (*GrayLogDataMineQuery)(nil), // 8: redcarbon.public_apis.agents.api.v1.GrayLogDataMineQuery - nil, // 9: redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelLog.LogsEntry - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 11: google.protobuf.Duration -} -var file_redcarbon_public_apis_agents_api_v1_types_proto_depIdxs = []int32{ - 10, // 0: redcarbon.public_apis.agents.api.v1.AgentConfiguration.created_at:type_name -> google.protobuf.Timestamp - 10, // 1: redcarbon.public_apis.agents.api.v1.AgentConfiguration.updated_at:type_name -> google.protobuf.Timestamp - 2, // 2: redcarbon.public_apis.agents.api.v1.AgentConfiguration.data:type_name -> redcarbon.public_apis.agents.api.v1.AgentConfigurationData - 3, // 3: redcarbon.public_apis.agents.api.v1.AgentConfigurationData.sentinel_one:type_name -> redcarbon.public_apis.agents.api.v1.SentinelOneData - 4, // 4: redcarbon.public_apis.agents.api.v1.AgentConfigurationData.graylog_impossible_travel:type_name -> redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelData - 5, // 5: redcarbon.public_apis.agents.api.v1.AgentConfigurationData.graylog_datamine:type_name -> redcarbon.public_apis.agents.api.v1.GrayLogDataMineData - 11, // 6: redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelData.time_window:type_name -> google.protobuf.Duration - 9, // 7: redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelLog.logs:type_name -> redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelLog.LogsEntry - 10, // 8: redcarbon.public_apis.agents.api.v1.GrayLogDataMineResult.timestamp:type_name -> google.protobuf.Timestamp - 10, // 9: redcarbon.public_apis.agents.api.v1.GrayLogDataMineQuery.search_start_time:type_name -> google.protobuf.Timestamp - 10, // 10: redcarbon.public_apis.agents.api.v1.GrayLogDataMineQuery.search_stop_time:type_name -> google.protobuf.Timestamp - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_redcarbon_public_apis_agents_api_v1_types_proto_init() } -func file_redcarbon_public_apis_agents_api_v1_types_proto_init() { - if File_redcarbon_public_apis_agents_api_v1_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AgentConfiguration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AgentConfigurationData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SentinelOneData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrayLogImpossibleTravelData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrayLogDataMineData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrayLogImpossibleTravelLog); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrayLogDataMineResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrayLogDataMineQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*AgentConfigurationData_SentinelOne)(nil), - (*AgentConfigurationData_GraylogImpossibleTravel)(nil), - (*AgentConfigurationData_GraylogDatamine)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_redcarbon_public_apis_agents_api_v1_types_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_redcarbon_public_apis_agents_api_v1_types_proto_goTypes, - DependencyIndexes: file_redcarbon_public_apis_agents_api_v1_types_proto_depIdxs, - EnumInfos: file_redcarbon_public_apis_agents_api_v1_types_proto_enumTypes, - MessageInfos: file_redcarbon_public_apis_agents_api_v1_types_proto_msgTypes, - }.Build() - File_redcarbon_public_apis_agents_api_v1_types_proto = out.File - file_redcarbon_public_apis_agents_api_v1_types_proto_rawDesc = nil - file_redcarbon_public_apis_agents_api_v1_types_proto_goTypes = nil - file_redcarbon_public_apis_agents_api_v1_types_proto_depIdxs = nil -} diff --git a/proto/redcarbon/public_apis/agents/api/v1/v1.pb.go b/proto/redcarbon/public_apis/agents/api/v1/v1.pb.go deleted file mode 100644 index 190b797..0000000 --- a/proto/redcarbon/public_apis/agents/api/v1/v1.pb.go +++ /dev/null @@ -1,1345 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1-devel -// protoc (unknown) -// source: redcarbon/public_apis/agents/api/v1/v1.proto - -package agentsPublicApiV1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -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 HZReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` - Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` -} - -func (x *HZReq) Reset() { - *x = HZReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HZReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HZReq) ProtoMessage() {} - -func (x *HZReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HZReq.ProtoReflect.Descriptor instead. -func (*HZReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{0} -} - -func (x *HZReq) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -func (x *HZReq) GetHostname() string { - if x != nil { - return x.Hostname - } - return "" -} - -type HZRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` -} - -func (x *HZRes) Reset() { - *x = HZRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HZRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HZRes) ProtoMessage() {} - -func (x *HZRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HZRes.ProtoReflect.Descriptor instead. -func (*HZRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{1} -} - -func (x *HZRes) GetReceivedAt() *timestamppb.Timestamp { - if x != nil { - return x.ReceivedAt - } - return nil -} - -type PullConfigurationsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PullConfigurationsReq) Reset() { - *x = PullConfigurationsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PullConfigurationsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PullConfigurationsReq) ProtoMessage() {} - -func (x *PullConfigurationsReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PullConfigurationsReq.ProtoReflect.Descriptor instead. -func (*PullConfigurationsReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{2} -} - -type PullConfigurationsRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurations []*AgentConfiguration `protobuf:"bytes,1,rep,name=agent_configurations,json=agentConfigurations,proto3" json:"agent_configurations,omitempty"` -} - -func (x *PullConfigurationsRes) Reset() { - *x = PullConfigurationsRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PullConfigurationsRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PullConfigurationsRes) ProtoMessage() {} - -func (x *PullConfigurationsRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PullConfigurationsRes.ProtoReflect.Descriptor instead. -func (*PullConfigurationsRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{3} -} - -func (x *PullConfigurationsRes) GetAgentConfigurations() []*AgentConfiguration { - if x != nil { - return x.AgentConfigurations - } - return nil -} - -type SendSentinelOneDataReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurationId string `protobuf:"bytes,1,opt,name=agent_configuration_id,json=agentConfigurationId,proto3" json:"agent_configuration_id,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *SendSentinelOneDataReq) Reset() { - *x = SendSentinelOneDataReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendSentinelOneDataReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendSentinelOneDataReq) ProtoMessage() {} - -func (x *SendSentinelOneDataReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendSentinelOneDataReq.ProtoReflect.Descriptor instead. -func (*SendSentinelOneDataReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{4} -} - -func (x *SendSentinelOneDataReq) GetAgentConfigurationId() string { - if x != nil { - return x.AgentConfigurationId - } - return "" -} - -func (x *SendSentinelOneDataReq) GetData() string { - if x != nil { - return x.Data - } - return "" -} - -type SendSentinelOneDataRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` -} - -func (x *SendSentinelOneDataRes) Reset() { - *x = SendSentinelOneDataRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendSentinelOneDataRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendSentinelOneDataRes) ProtoMessage() {} - -func (x *SendSentinelOneDataRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendSentinelOneDataRes.ProtoReflect.Descriptor instead. -func (*SendSentinelOneDataRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{5} -} - -func (x *SendSentinelOneDataRes) GetReceivedAt() *timestamppb.Timestamp { - if x != nil { - return x.ReceivedAt - } - return nil -} - -type SendGrayLogImpossibleTravelDataReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurationId string `protobuf:"bytes,1,opt,name=agent_configuration_id,json=agentConfigurationId,proto3" json:"agent_configuration_id,omitempty"` - User string `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` - Ips []string `protobuf:"bytes,3,rep,name=ips,proto3" json:"ips,omitempty"` - Countries []string `protobuf:"bytes,4,rep,name=countries,proto3" json:"countries,omitempty"` - ImpossibleTravelLogs []*GrayLogImpossibleTravelLog `protobuf:"bytes,5,rep,name=impossible_travel_logs,json=impossibleTravelLogs,proto3" json:"impossible_travel_logs,omitempty"` -} - -func (x *SendGrayLogImpossibleTravelDataReq) Reset() { - *x = SendGrayLogImpossibleTravelDataReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendGrayLogImpossibleTravelDataReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendGrayLogImpossibleTravelDataReq) ProtoMessage() {} - -func (x *SendGrayLogImpossibleTravelDataReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendGrayLogImpossibleTravelDataReq.ProtoReflect.Descriptor instead. -func (*SendGrayLogImpossibleTravelDataReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{6} -} - -func (x *SendGrayLogImpossibleTravelDataReq) GetAgentConfigurationId() string { - if x != nil { - return x.AgentConfigurationId - } - return "" -} - -func (x *SendGrayLogImpossibleTravelDataReq) GetUser() string { - if x != nil { - return x.User - } - return "" -} - -func (x *SendGrayLogImpossibleTravelDataReq) GetIps() []string { - if x != nil { - return x.Ips - } - return nil -} - -func (x *SendGrayLogImpossibleTravelDataReq) GetCountries() []string { - if x != nil { - return x.Countries - } - return nil -} - -func (x *SendGrayLogImpossibleTravelDataReq) GetImpossibleTravelLogs() []*GrayLogImpossibleTravelLog { - if x != nil { - return x.ImpossibleTravelLogs - } - return nil -} - -type SendGrayLogImpossibleTravelDataRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` -} - -func (x *SendGrayLogImpossibleTravelDataRes) Reset() { - *x = SendGrayLogImpossibleTravelDataRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendGrayLogImpossibleTravelDataRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendGrayLogImpossibleTravelDataRes) ProtoMessage() {} - -func (x *SendGrayLogImpossibleTravelDataRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendGrayLogImpossibleTravelDataRes.ProtoReflect.Descriptor instead. -func (*SendGrayLogImpossibleTravelDataRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{7} -} - -func (x *SendGrayLogImpossibleTravelDataRes) GetReceivedAt() *timestamppb.Timestamp { - if x != nil { - return x.ReceivedAt - } - return nil -} - -type SendGrayLogDatamineQueryResultsDataReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurationId string `protobuf:"bytes,1,opt,name=agent_configuration_id,json=agentConfigurationId,proto3" json:"agent_configuration_id,omitempty"` - QueryId string `protobuf:"bytes,2,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - Results []*GrayLogDataMineResult `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *SendGrayLogDatamineQueryResultsDataReq) Reset() { - *x = SendGrayLogDatamineQueryResultsDataReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendGrayLogDatamineQueryResultsDataReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendGrayLogDatamineQueryResultsDataReq) ProtoMessage() {} - -func (x *SendGrayLogDatamineQueryResultsDataReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendGrayLogDatamineQueryResultsDataReq.ProtoReflect.Descriptor instead. -func (*SendGrayLogDatamineQueryResultsDataReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{8} -} - -func (x *SendGrayLogDatamineQueryResultsDataReq) GetAgentConfigurationId() string { - if x != nil { - return x.AgentConfigurationId - } - return "" -} - -func (x *SendGrayLogDatamineQueryResultsDataReq) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -func (x *SendGrayLogDatamineQueryResultsDataReq) GetResults() []*GrayLogDataMineResult { - if x != nil { - return x.Results - } - return nil -} - -type SendGrayLogDatamineQueryResultsDataRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` -} - -func (x *SendGrayLogDatamineQueryResultsDataRes) Reset() { - *x = SendGrayLogDatamineQueryResultsDataRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendGrayLogDatamineQueryResultsDataRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendGrayLogDatamineQueryResultsDataRes) ProtoMessage() {} - -func (x *SendGrayLogDatamineQueryResultsDataRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendGrayLogDatamineQueryResultsDataRes.ProtoReflect.Descriptor instead. -func (*SendGrayLogDatamineQueryResultsDataRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{9} -} - -func (x *SendGrayLogDatamineQueryResultsDataRes) GetReceivedAt() *timestamppb.Timestamp { - if x != nil { - return x.ReceivedAt - } - return nil -} - -type SendGrayLogDatamineQueryErrorDataReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurationId string `protobuf:"bytes,1,opt,name=agent_configuration_id,json=agentConfigurationId,proto3" json:"agent_configuration_id,omitempty"` - QueryId string `protobuf:"bytes,2,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` -} - -func (x *SendGrayLogDatamineQueryErrorDataReq) Reset() { - *x = SendGrayLogDatamineQueryErrorDataReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendGrayLogDatamineQueryErrorDataReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendGrayLogDatamineQueryErrorDataReq) ProtoMessage() {} - -func (x *SendGrayLogDatamineQueryErrorDataReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendGrayLogDatamineQueryErrorDataReq.ProtoReflect.Descriptor instead. -func (*SendGrayLogDatamineQueryErrorDataReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{10} -} - -func (x *SendGrayLogDatamineQueryErrorDataReq) GetAgentConfigurationId() string { - if x != nil { - return x.AgentConfigurationId - } - return "" -} - -func (x *SendGrayLogDatamineQueryErrorDataReq) GetQueryId() string { - if x != nil { - return x.QueryId - } - return "" -} - -func (x *SendGrayLogDatamineQueryErrorDataReq) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -type SendGrayLogDatamineQueryErrorDataRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` -} - -func (x *SendGrayLogDatamineQueryErrorDataRes) Reset() { - *x = SendGrayLogDatamineQueryErrorDataRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendGrayLogDatamineQueryErrorDataRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendGrayLogDatamineQueryErrorDataRes) ProtoMessage() {} - -func (x *SendGrayLogDatamineQueryErrorDataRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendGrayLogDatamineQueryErrorDataRes.ProtoReflect.Descriptor instead. -func (*SendGrayLogDatamineQueryErrorDataRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{11} -} - -func (x *SendGrayLogDatamineQueryErrorDataRes) GetReceivedAt() *timestamppb.Timestamp { - if x != nil { - return x.ReceivedAt - } - return nil -} - -type RefreshTokenReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RefreshTokenReq) Reset() { - *x = RefreshTokenReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RefreshTokenReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshTokenReq) ProtoMessage() {} - -func (x *RefreshTokenReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RefreshTokenReq.ProtoReflect.Descriptor instead. -func (*RefreshTokenReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{12} -} - -type RefreshTokenRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` -} - -func (x *RefreshTokenRes) Reset() { - *x = RefreshTokenRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RefreshTokenRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshTokenRes) ProtoMessage() {} - -func (x *RefreshTokenRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RefreshTokenRes.ProtoReflect.Descriptor instead. -func (*RefreshTokenRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{13} -} - -func (x *RefreshTokenRes) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *RefreshTokenRes) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -type GetGrayLogDataMinePendingQueriesReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AgentConfigurationId string `protobuf:"bytes,1,opt,name=agent_configuration_id,json=agentConfigurationId,proto3" json:"agent_configuration_id,omitempty"` -} - -func (x *GetGrayLogDataMinePendingQueriesReq) Reset() { - *x = GetGrayLogDataMinePendingQueriesReq{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGrayLogDataMinePendingQueriesReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGrayLogDataMinePendingQueriesReq) ProtoMessage() {} - -func (x *GetGrayLogDataMinePendingQueriesReq) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGrayLogDataMinePendingQueriesReq.ProtoReflect.Descriptor instead. -func (*GetGrayLogDataMinePendingQueriesReq) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{14} -} - -func (x *GetGrayLogDataMinePendingQueriesReq) GetAgentConfigurationId() string { - if x != nil { - return x.AgentConfigurationId - } - return "" -} - -type GetGrayLogDataMinePendingQueriesRes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GraylogDatamineQueries []*GrayLogDataMineQuery `protobuf:"bytes,1,rep,name=graylog_datamine_queries,json=graylogDatamineQueries,proto3" json:"graylog_datamine_queries,omitempty"` -} - -func (x *GetGrayLogDataMinePendingQueriesRes) Reset() { - *x = GetGrayLogDataMinePendingQueriesRes{} - if protoimpl.UnsafeEnabled { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGrayLogDataMinePendingQueriesRes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGrayLogDataMinePendingQueriesRes) ProtoMessage() {} - -func (x *GetGrayLogDataMinePendingQueriesRes) ProtoReflect() protoreflect.Message { - mi := &file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGrayLogDataMinePendingQueriesRes.ProtoReflect.Descriptor instead. -func (*GetGrayLogDataMinePendingQueriesRes) Descriptor() ([]byte, []int) { - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP(), []int{15} -} - -func (x *GetGrayLogDataMinePendingQueriesRes) GetGraylogDatamineQueries() []*GrayLogDataMineQuery { - if x != nil { - return x.GraylogDatamineQueries - } - return nil -} - -var File_redcarbon_public_apis_agents_api_v1_v1_proto protoreflect.FileDescriptor - -var file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, - 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x05, 0x48, 0x5a, 0x52, 0x65, 0x71, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1a, - 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, 0x05, 0x48, 0x5a, - 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, - 0x22, 0x17, 0x0a, 0x15, 0x50, 0x75, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x22, 0x83, 0x01, 0x0a, 0x15, 0x50, 0x75, - 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x12, 0x6a, 0x0a, 0x14, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x37, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x62, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x6c, 0x4f, - 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x55, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6e, 0x74, 0x69, - 0x6e, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, - 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0x95, 0x02, 0x0a, 0x22, 0x53, - 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, - 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x71, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x14, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x69, - 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x75, 0x0a, 0x16, 0x69, - 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x76, 0x65, 0x6c, - 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x72, 0x65, - 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, - 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x4c, 0x6f, 0x67, 0x52, 0x14, 0x69, 0x6d, - 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x4c, 0x6f, - 0x67, 0x73, 0x22, 0x61, 0x0a, 0x22, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, - 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, - 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0xcf, 0x01, 0x0a, 0x26, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, - 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, - 0x12, 0x34, 0x0a, 0x16, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x14, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, - 0x64, 0x12, 0x54, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x65, 0x0a, 0x26, 0x53, 0x65, 0x6e, 0x64, 0x47, - 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0x8d, - 0x01, 0x0a, 0x24, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, - 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x34, 0x0a, 0x16, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, - 0x08, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x63, - 0x0a, 0x24, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, - 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0x41, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x4c, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5b, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x79, 0x4c, - 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x34, 0x0a, 0x16, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x51, - 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x18, 0x67, 0x72, 0x61, - 0x79, 0x6c, 0x6f, 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x72, 0x65, - 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, - 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x16, 0x67, 0x72, 0x61, 0x79, 0x6c, 0x6f, 0x67, 0x44, - 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x32, 0x8e, - 0x0a, 0x0a, 0x14, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, - 0x70, 0x69, 0x56, 0x31, 0x53, 0x72, 0x76, 0x12, 0x5e, 0x0a, 0x02, 0x48, 0x5a, 0x12, 0x2a, 0x2e, - 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x5a, 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x72, 0x65, 0x64, 0x63, - 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x48, 0x5a, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x12, 0x50, 0x75, 0x6c, 0x6c, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, - 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x3a, 0x2e, 0x72, 0x65, 0x64, - 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x91, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x6e, - 0x64, 0x53, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x3b, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6e, 0x74, 0x69, - 0x6e, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x3b, 0x2e, - 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x6c, - 0x4f, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0xb5, 0x01, 0x0a, - 0x1f, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, - 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x47, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, - 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, - 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x47, 0x2e, 0x72, 0x65, 0x64, 0x63, - 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x73, - 0x73, 0x69, 0x62, 0x6c, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x65, 0x73, 0x22, 0x00, 0x12, 0xc1, 0x01, 0x0a, 0x23, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, - 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4b, 0x2e, 0x72, - 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, - 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x4b, 0x2e, 0x72, 0x65, 0x64, 0x63, - 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, - 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0xbb, 0x01, 0x0a, 0x21, 0x53, 0x65, 0x6e, - 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x49, - 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, - 0x44, 0x61, 0x74, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x49, 0x2e, 0x72, 0x65, 0x64, 0x63, - 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x6d, - 0x69, 0x6e, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x7c, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x34, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, - 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x34, 0x2e, 0x72, - 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x73, 0x22, 0x00, 0x12, 0xb8, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x79, - 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x48, 0x2e, 0x72, 0x65, 0x64, 0x63, - 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, - 0x6e, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x1a, 0x48, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x2e, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, - 0x79, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, - 0x4e, 0x5a, 0x4c, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, 0x62, 0x6f, 0x6e, - 0x2e, 0x61, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x64, 0x63, 0x61, 0x72, - 0x62, 0x6f, 0x6e, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x73, 0x2f, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x70, 0x69, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescOnce sync.Once - file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescData = file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDesc -) - -func file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescGZIP() []byte { - file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescOnce.Do(func() { - file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescData = protoimpl.X.CompressGZIP(file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescData) - }) - return file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDescData -} - -var file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_redcarbon_public_apis_agents_api_v1_v1_proto_goTypes = []interface{}{ - (*HZReq)(nil), // 0: redcarbon.public_apis.agents.api.v1.HZReq - (*HZRes)(nil), // 1: redcarbon.public_apis.agents.api.v1.HZRes - (*PullConfigurationsReq)(nil), // 2: redcarbon.public_apis.agents.api.v1.PullConfigurationsReq - (*PullConfigurationsRes)(nil), // 3: redcarbon.public_apis.agents.api.v1.PullConfigurationsRes - (*SendSentinelOneDataReq)(nil), // 4: redcarbon.public_apis.agents.api.v1.SendSentinelOneDataReq - (*SendSentinelOneDataRes)(nil), // 5: redcarbon.public_apis.agents.api.v1.SendSentinelOneDataRes - (*SendGrayLogImpossibleTravelDataReq)(nil), // 6: redcarbon.public_apis.agents.api.v1.SendGrayLogImpossibleTravelDataReq - (*SendGrayLogImpossibleTravelDataRes)(nil), // 7: redcarbon.public_apis.agents.api.v1.SendGrayLogImpossibleTravelDataRes - (*SendGrayLogDatamineQueryResultsDataReq)(nil), // 8: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryResultsDataReq - (*SendGrayLogDatamineQueryResultsDataRes)(nil), // 9: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryResultsDataRes - (*SendGrayLogDatamineQueryErrorDataReq)(nil), // 10: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryErrorDataReq - (*SendGrayLogDatamineQueryErrorDataRes)(nil), // 11: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryErrorDataRes - (*RefreshTokenReq)(nil), // 12: redcarbon.public_apis.agents.api.v1.RefreshTokenReq - (*RefreshTokenRes)(nil), // 13: redcarbon.public_apis.agents.api.v1.RefreshTokenRes - (*GetGrayLogDataMinePendingQueriesReq)(nil), // 14: redcarbon.public_apis.agents.api.v1.GetGrayLogDataMinePendingQueriesReq - (*GetGrayLogDataMinePendingQueriesRes)(nil), // 15: redcarbon.public_apis.agents.api.v1.GetGrayLogDataMinePendingQueriesRes - (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp - (*AgentConfiguration)(nil), // 17: redcarbon.public_apis.agents.api.v1.AgentConfiguration - (*GrayLogImpossibleTravelLog)(nil), // 18: redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelLog - (*GrayLogDataMineResult)(nil), // 19: redcarbon.public_apis.agents.api.v1.GrayLogDataMineResult - (*GrayLogDataMineQuery)(nil), // 20: redcarbon.public_apis.agents.api.v1.GrayLogDataMineQuery -} -var file_redcarbon_public_apis_agents_api_v1_v1_proto_depIdxs = []int32{ - 16, // 0: redcarbon.public_apis.agents.api.v1.HZRes.received_at:type_name -> google.protobuf.Timestamp - 17, // 1: redcarbon.public_apis.agents.api.v1.PullConfigurationsRes.agent_configurations:type_name -> redcarbon.public_apis.agents.api.v1.AgentConfiguration - 16, // 2: redcarbon.public_apis.agents.api.v1.SendSentinelOneDataRes.received_at:type_name -> google.protobuf.Timestamp - 18, // 3: redcarbon.public_apis.agents.api.v1.SendGrayLogImpossibleTravelDataReq.impossible_travel_logs:type_name -> redcarbon.public_apis.agents.api.v1.GrayLogImpossibleTravelLog - 16, // 4: redcarbon.public_apis.agents.api.v1.SendGrayLogImpossibleTravelDataRes.received_at:type_name -> google.protobuf.Timestamp - 19, // 5: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryResultsDataReq.results:type_name -> redcarbon.public_apis.agents.api.v1.GrayLogDataMineResult - 16, // 6: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryResultsDataRes.received_at:type_name -> google.protobuf.Timestamp - 16, // 7: redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryErrorDataRes.received_at:type_name -> google.protobuf.Timestamp - 20, // 8: redcarbon.public_apis.agents.api.v1.GetGrayLogDataMinePendingQueriesRes.graylog_datamine_queries:type_name -> redcarbon.public_apis.agents.api.v1.GrayLogDataMineQuery - 0, // 9: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.HZ:input_type -> redcarbon.public_apis.agents.api.v1.HZReq - 2, // 10: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.PullConfigurations:input_type -> redcarbon.public_apis.agents.api.v1.PullConfigurationsReq - 4, // 11: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendSentinelOneData:input_type -> redcarbon.public_apis.agents.api.v1.SendSentinelOneDataReq - 6, // 12: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendGrayLogImpossibleTravelData:input_type -> redcarbon.public_apis.agents.api.v1.SendGrayLogImpossibleTravelDataReq - 8, // 13: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendGrayLogDatamineQueryResultsData:input_type -> redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryResultsDataReq - 10, // 14: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendGrayLogDatamineQueryErrorData:input_type -> redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryErrorDataReq - 12, // 15: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.RefreshToken:input_type -> redcarbon.public_apis.agents.api.v1.RefreshTokenReq - 14, // 16: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.GetGrayLogDataMinePendingQueries:input_type -> redcarbon.public_apis.agents.api.v1.GetGrayLogDataMinePendingQueriesReq - 1, // 17: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.HZ:output_type -> redcarbon.public_apis.agents.api.v1.HZRes - 3, // 18: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.PullConfigurations:output_type -> redcarbon.public_apis.agents.api.v1.PullConfigurationsRes - 5, // 19: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendSentinelOneData:output_type -> redcarbon.public_apis.agents.api.v1.SendSentinelOneDataRes - 7, // 20: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendGrayLogImpossibleTravelData:output_type -> redcarbon.public_apis.agents.api.v1.SendGrayLogImpossibleTravelDataRes - 9, // 21: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendGrayLogDatamineQueryResultsData:output_type -> redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryResultsDataRes - 11, // 22: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.SendGrayLogDatamineQueryErrorData:output_type -> redcarbon.public_apis.agents.api.v1.SendGrayLogDatamineQueryErrorDataRes - 13, // 23: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.RefreshToken:output_type -> redcarbon.public_apis.agents.api.v1.RefreshTokenRes - 15, // 24: redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv.GetGrayLogDataMinePendingQueries:output_type -> redcarbon.public_apis.agents.api.v1.GetGrayLogDataMinePendingQueriesRes - 17, // [17:25] is the sub-list for method output_type - 9, // [9:17] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_redcarbon_public_apis_agents_api_v1_v1_proto_init() } -func file_redcarbon_public_apis_agents_api_v1_v1_proto_init() { - if File_redcarbon_public_apis_agents_api_v1_v1_proto != nil { - return - } - file_redcarbon_public_apis_agents_api_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HZReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HZRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PullConfigurationsReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PullConfigurationsRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendSentinelOneDataReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendSentinelOneDataRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendGrayLogImpossibleTravelDataReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendGrayLogImpossibleTravelDataRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendGrayLogDatamineQueryResultsDataReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendGrayLogDatamineQueryResultsDataRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendGrayLogDatamineQueryErrorDataReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendGrayLogDatamineQueryErrorDataRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RefreshTokenReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RefreshTokenRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGrayLogDataMinePendingQueriesReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGrayLogDataMinePendingQueriesRes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDesc, - NumEnums: 0, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_redcarbon_public_apis_agents_api_v1_v1_proto_goTypes, - DependencyIndexes: file_redcarbon_public_apis_agents_api_v1_v1_proto_depIdxs, - MessageInfos: file_redcarbon_public_apis_agents_api_v1_v1_proto_msgTypes, - }.Build() - File_redcarbon_public_apis_agents_api_v1_v1_proto = out.File - file_redcarbon_public_apis_agents_api_v1_v1_proto_rawDesc = nil - file_redcarbon_public_apis_agents_api_v1_v1_proto_goTypes = nil - file_redcarbon_public_apis_agents_api_v1_v1_proto_depIdxs = nil -} diff --git a/proto/redcarbon/public_apis/agents/api/v1/v1_grpc.pb.go b/proto/redcarbon/public_apis/agents/api/v1/v1_grpc.pb.go deleted file mode 100644 index 320f4c1..0000000 --- a/proto/redcarbon/public_apis/agents/api/v1/v1_grpc.pb.go +++ /dev/null @@ -1,355 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: redcarbon/public_apis/agents/api/v1/v1.proto - -package agentsPublicApiV1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// AgentsPublicApiV1SrvClient is the client API for AgentsPublicApiV1Srv 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. -type AgentsPublicApiV1SrvClient interface { - HZ(ctx context.Context, in *HZReq, opts ...grpc.CallOption) (*HZRes, error) - PullConfigurations(ctx context.Context, in *PullConfigurationsReq, opts ...grpc.CallOption) (*PullConfigurationsRes, error) - SendSentinelOneData(ctx context.Context, in *SendSentinelOneDataReq, opts ...grpc.CallOption) (*SendSentinelOneDataRes, error) - SendGrayLogImpossibleTravelData(ctx context.Context, in *SendGrayLogImpossibleTravelDataReq, opts ...grpc.CallOption) (*SendGrayLogImpossibleTravelDataRes, error) - SendGrayLogDatamineQueryResultsData(ctx context.Context, in *SendGrayLogDatamineQueryResultsDataReq, opts ...grpc.CallOption) (*SendGrayLogDatamineQueryResultsDataRes, error) - SendGrayLogDatamineQueryErrorData(ctx context.Context, in *SendGrayLogDatamineQueryErrorDataReq, opts ...grpc.CallOption) (*SendGrayLogDatamineQueryErrorDataRes, error) - RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenRes, error) - GetGrayLogDataMinePendingQueries(ctx context.Context, in *GetGrayLogDataMinePendingQueriesReq, opts ...grpc.CallOption) (*GetGrayLogDataMinePendingQueriesRes, error) -} - -type agentsPublicApiV1SrvClient struct { - cc grpc.ClientConnInterface -} - -func NewAgentsPublicApiV1SrvClient(cc grpc.ClientConnInterface) AgentsPublicApiV1SrvClient { - return &agentsPublicApiV1SrvClient{cc} -} - -func (c *agentsPublicApiV1SrvClient) HZ(ctx context.Context, in *HZReq, opts ...grpc.CallOption) (*HZRes, error) { - out := new(HZRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/HZ", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) PullConfigurations(ctx context.Context, in *PullConfigurationsReq, opts ...grpc.CallOption) (*PullConfigurationsRes, error) { - out := new(PullConfigurationsRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/PullConfigurations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) SendSentinelOneData(ctx context.Context, in *SendSentinelOneDataReq, opts ...grpc.CallOption) (*SendSentinelOneDataRes, error) { - out := new(SendSentinelOneDataRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendSentinelOneData", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) SendGrayLogImpossibleTravelData(ctx context.Context, in *SendGrayLogImpossibleTravelDataReq, opts ...grpc.CallOption) (*SendGrayLogImpossibleTravelDataRes, error) { - out := new(SendGrayLogImpossibleTravelDataRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendGrayLogImpossibleTravelData", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) SendGrayLogDatamineQueryResultsData(ctx context.Context, in *SendGrayLogDatamineQueryResultsDataReq, opts ...grpc.CallOption) (*SendGrayLogDatamineQueryResultsDataRes, error) { - out := new(SendGrayLogDatamineQueryResultsDataRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendGrayLogDatamineQueryResultsData", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) SendGrayLogDatamineQueryErrorData(ctx context.Context, in *SendGrayLogDatamineQueryErrorDataReq, opts ...grpc.CallOption) (*SendGrayLogDatamineQueryErrorDataRes, error) { - out := new(SendGrayLogDatamineQueryErrorDataRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendGrayLogDatamineQueryErrorData", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenRes, error) { - out := new(RefreshTokenRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/RefreshToken", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *agentsPublicApiV1SrvClient) GetGrayLogDataMinePendingQueries(ctx context.Context, in *GetGrayLogDataMinePendingQueriesReq, opts ...grpc.CallOption) (*GetGrayLogDataMinePendingQueriesRes, error) { - out := new(GetGrayLogDataMinePendingQueriesRes) - err := c.cc.Invoke(ctx, "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/GetGrayLogDataMinePendingQueries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AgentsPublicApiV1SrvServer is the server API for AgentsPublicApiV1Srv service. -// All implementations should embed UnimplementedAgentsPublicApiV1SrvServer -// for forward compatibility -type AgentsPublicApiV1SrvServer interface { - HZ(context.Context, *HZReq) (*HZRes, error) - PullConfigurations(context.Context, *PullConfigurationsReq) (*PullConfigurationsRes, error) - SendSentinelOneData(context.Context, *SendSentinelOneDataReq) (*SendSentinelOneDataRes, error) - SendGrayLogImpossibleTravelData(context.Context, *SendGrayLogImpossibleTravelDataReq) (*SendGrayLogImpossibleTravelDataRes, error) - SendGrayLogDatamineQueryResultsData(context.Context, *SendGrayLogDatamineQueryResultsDataReq) (*SendGrayLogDatamineQueryResultsDataRes, error) - SendGrayLogDatamineQueryErrorData(context.Context, *SendGrayLogDatamineQueryErrorDataReq) (*SendGrayLogDatamineQueryErrorDataRes, error) - RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenRes, error) - GetGrayLogDataMinePendingQueries(context.Context, *GetGrayLogDataMinePendingQueriesReq) (*GetGrayLogDataMinePendingQueriesRes, error) -} - -// UnimplementedAgentsPublicApiV1SrvServer should be embedded to have forward compatible implementations. -type UnimplementedAgentsPublicApiV1SrvServer struct { -} - -func (UnimplementedAgentsPublicApiV1SrvServer) HZ(context.Context, *HZReq) (*HZRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method HZ not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) PullConfigurations(context.Context, *PullConfigurationsReq) (*PullConfigurationsRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method PullConfigurations not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) SendSentinelOneData(context.Context, *SendSentinelOneDataReq) (*SendSentinelOneDataRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendSentinelOneData not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) SendGrayLogImpossibleTravelData(context.Context, *SendGrayLogImpossibleTravelDataReq) (*SendGrayLogImpossibleTravelDataRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendGrayLogImpossibleTravelData not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) SendGrayLogDatamineQueryResultsData(context.Context, *SendGrayLogDatamineQueryResultsDataReq) (*SendGrayLogDatamineQueryResultsDataRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendGrayLogDatamineQueryResultsData not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) SendGrayLogDatamineQueryErrorData(context.Context, *SendGrayLogDatamineQueryErrorDataReq) (*SendGrayLogDatamineQueryErrorDataRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendGrayLogDatamineQueryErrorData not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") -} -func (UnimplementedAgentsPublicApiV1SrvServer) GetGrayLogDataMinePendingQueries(context.Context, *GetGrayLogDataMinePendingQueriesReq) (*GetGrayLogDataMinePendingQueriesRes, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetGrayLogDataMinePendingQueries not implemented") -} - -// UnsafeAgentsPublicApiV1SrvServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgentsPublicApiV1SrvServer will -// result in compilation errors. -type UnsafeAgentsPublicApiV1SrvServer interface { - mustEmbedUnimplementedAgentsPublicApiV1SrvServer() -} - -func RegisterAgentsPublicApiV1SrvServer(s grpc.ServiceRegistrar, srv AgentsPublicApiV1SrvServer) { - s.RegisterService(&AgentsPublicApiV1Srv_ServiceDesc, srv) -} - -func _AgentsPublicApiV1Srv_HZ_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HZReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).HZ(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/HZ", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).HZ(ctx, req.(*HZReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_PullConfigurations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PullConfigurationsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).PullConfigurations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/PullConfigurations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).PullConfigurations(ctx, req.(*PullConfigurationsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_SendSentinelOneData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendSentinelOneDataReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).SendSentinelOneData(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendSentinelOneData", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).SendSentinelOneData(ctx, req.(*SendSentinelOneDataReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_SendGrayLogImpossibleTravelData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendGrayLogImpossibleTravelDataReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).SendGrayLogImpossibleTravelData(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendGrayLogImpossibleTravelData", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).SendGrayLogImpossibleTravelData(ctx, req.(*SendGrayLogImpossibleTravelDataReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_SendGrayLogDatamineQueryResultsData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendGrayLogDatamineQueryResultsDataReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).SendGrayLogDatamineQueryResultsData(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendGrayLogDatamineQueryResultsData", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).SendGrayLogDatamineQueryResultsData(ctx, req.(*SendGrayLogDatamineQueryResultsDataReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_SendGrayLogDatamineQueryErrorData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendGrayLogDatamineQueryErrorDataReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).SendGrayLogDatamineQueryErrorData(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/SendGrayLogDatamineQueryErrorData", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).SendGrayLogDatamineQueryErrorData(ctx, req.(*SendGrayLogDatamineQueryErrorDataReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RefreshTokenReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).RefreshToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/RefreshToken", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).RefreshToken(ctx, req.(*RefreshTokenReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AgentsPublicApiV1Srv_GetGrayLogDataMinePendingQueries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetGrayLogDataMinePendingQueriesReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentsPublicApiV1SrvServer).GetGrayLogDataMinePendingQueries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv/GetGrayLogDataMinePendingQueries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentsPublicApiV1SrvServer).GetGrayLogDataMinePendingQueries(ctx, req.(*GetGrayLogDataMinePendingQueriesReq)) - } - return interceptor(ctx, in, info, handler) -} - -// AgentsPublicApiV1Srv_ServiceDesc is the grpc.ServiceDesc for AgentsPublicApiV1Srv service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AgentsPublicApiV1Srv_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "redcarbon.public_apis.agents.api.v1.AgentsPublicApiV1Srv", - HandlerType: (*AgentsPublicApiV1SrvServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "HZ", - Handler: _AgentsPublicApiV1Srv_HZ_Handler, - }, - { - MethodName: "PullConfigurations", - Handler: _AgentsPublicApiV1Srv_PullConfigurations_Handler, - }, - { - MethodName: "SendSentinelOneData", - Handler: _AgentsPublicApiV1Srv_SendSentinelOneData_Handler, - }, - { - MethodName: "SendGrayLogImpossibleTravelData", - Handler: _AgentsPublicApiV1Srv_SendGrayLogImpossibleTravelData_Handler, - }, - { - MethodName: "SendGrayLogDatamineQueryResultsData", - Handler: _AgentsPublicApiV1Srv_SendGrayLogDatamineQueryResultsData_Handler, - }, - { - MethodName: "SendGrayLogDatamineQueryErrorData", - Handler: _AgentsPublicApiV1Srv_SendGrayLogDatamineQueryErrorData_Handler, - }, - { - MethodName: "RefreshToken", - Handler: _AgentsPublicApiV1Srv_RefreshToken_Handler, - }, - { - MethodName: "GetGrayLogDataMinePendingQueries", - Handler: _AgentsPublicApiV1Srv_GetGrayLogDataMinePendingQueries_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "redcarbon/public_apis/agents/api/v1/v1.proto", -} diff --git a/scripts/post_install.sh b/scripts/post_install.sh deleted file mode 100644 index e989e92..0000000 --- a/scripts/post_install.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# Step 1, decide if we should use SystemD or init/upstart -use_systemctl="True" -systemd_version=0 -if ! command -V systemctl >/dev/null 2>&1; then - use_systemctl="False" -else - systemd_version=$(systemctl --version | head -1 | sed 's/systemd //g') -fi - -cleanup() { - # This is where you remove files that were not needed on this platform / system - if [ "${use_systemctl}" = "False" ]; then - rm -f /etc/systemd/system/redcarbon.service - else - rm -f /etc/chkconfig/redcarbon - rm -f /etc/init.d/redcarbon - fi -} - -cleanInstall() { - printf "\033[32m Post Install of an clean install\033[0m\n" - # Step 3 (clean install), enable the service in the proper way for this platform - if [ "${use_systemctl}" = "False" ]; then - if command -V chkconfig >/dev/null 2>&1; then - chkconfig --add redcarbon - fi - - service redcarbon restart ||: - else - # rhel/centos7 cannot use ExecStartPre=+ to specify the pre start should be run as root - # even if you want your service to run as non root. - if [ "${systemd_version}" -lt 231 ]; then - printf "\033[31m systemd version %s is less then 231, fixing the service file \033[0m\n" "${systemd_version}" - sed -i "s/=+/=/g" /etc/systemd/system/redcarbon.service - fi - printf "\033[32m Reload the service unit from disk\033[0m\n" - systemctl daemon-reload ||: - printf "\033[32m Unmask the service\033[0m\n" - systemctl unmask redcarbon ||: - printf "\033[32m Set the preset flag for the service unit\033[0m\n" - systemctl preset redcarbon ||: - printf "\033[32m Set the enabled flag for the service unit\033[0m\n" - systemctl enable redcarbon ||: - systemctl restart redcarbon ||: - fi -} - -# Step 2, check if this is a clean install or an upgrade -action="$1" -if [ "$1" = "configure" ] && [ -z "$2" ]; then - # Alpine linux does not pass args, and deb passes $1=configure - action="install" -fi - -case "$action" in - "1" | "install") - cleanInstall - ;; - *) - # $1 == version being installed - printf "\033[32m Alpine\033[0m" - cleanInstall - ;; -esac - -# Step 4, clean up unused files, yes you get a warning when you remove the package, but that is ok. -cleanup diff --git a/service/redcarbon.service b/service/redcarbon.service deleted file mode 100644 index 0b1e025..0000000 --- a/service/redcarbon.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=RedCarbon's Agent - -[Service] -KillMode=process -ExecStart=/usr/bin/redcarbon start -ExecStop=/bin/kill -HUP $MAINPID -Restart=always diff --git a/templates/redcarbon.agent.service.template b/templates/redcarbon.agent.service.template new file mode 100644 index 0000000..0a50a99 --- /dev/null +++ b/templates/redcarbon.agent.service.template @@ -0,0 +1,15 @@ +[Unit] +Description={{Description}} +After=network.target + +[Service] +ExecStart={{RunnerRoot}}/bin/redcarbon +User={{User}} +WorkingDirectory={{RunnerRoot}} +KillMode=process +KillSignal=SIGTERM +TimeoutStopSec=5min +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/tools.go b/tools.go deleted file mode 100644 index efc8ba2..0000000 --- a/tools.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build tools -// +build tools - -package main - -import ( - _ "github.com/bufbuild/buf/cmd/buf" - _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" - _ "google.golang.org/protobuf/cmd/protoc-gen-go" -)