trufflehog/scripts/gen_proto.sh
Miccah 2424683923
Analyze (#3099)
* Add POC analyze sub-command

* Address lint errors

* [chore] Embed scopes at compile time

* [chore] Move subcommand check up to prevent printing metrics

* added http logging to most analyzers

* Use custom RoundTripper with default http.Client

* Create framework of interfaces, structs, and protos

* Merge main

* Add AnalysisInfo to detectors.Result

* Hide analyze subcommand

* Update gen_proto.sh

* Update protos

* Make protos

* Update analyzer data types

* Rename argument to credentialInfo

---------

Co-authored-by: Joe Leon <joe.leon@trufflesec.com>
2024-07-25 12:06:05 -07:00

26 lines
915 B
Bash
Executable file

#!/bin/bash
set -eux
for pbfile in $(ls proto/); do
mod=${pbfile%%.proto}
protoc -I proto/ \
-I ${GOPATH}/src \
-I /usr/local/include \
-I ${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate \
--go_out=plugins=grpc:./pkg/pb/${mod}pb --go_opt=paths=source_relative \
--validate_out="lang=go,paths=source_relative:./pkg/pb/${mod}pb" \
proto/${mod}.proto
done
for pbfile in $(ls pkg/analyzer/proto/); do
mod=${pbfile%%.proto}
mkdir -p "./pkg/analyzer/pb/${mod}pb"
protoc -I pkg/analyzer/proto/ \
-I ${GOPATH}/src \
-I /usr/local/include \
-I ${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate \
--go_out=plugins=grpc:./pkg/analyzer/pb/${mod}pb --go_opt=paths=source_relative \
--validate_out="lang=go,paths=source_relative:./pkg/analyzer/pb/${mod}pb" \
pkg/analyzer/proto/${mod}.proto
done