Skip to content

Commit

Permalink
print urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonis, Matthias authored and Simonis, Matthias committed Mar 1, 2024
1 parent 590ca78 commit c938a52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions golang/vaas/cmd/git-scan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ func main() {
if !exists {
vaasUrl = "wss://gateway.production.vaas.gdatasecurity.de/"
}
log.Println("vaas url: ", vaasUrl)
tokenUrl, exists := os.LookupEnv("VAAS_TOKEN_URL")
if !exists {
tokenUrl = "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token"
}
log.Println("token url: ", tokenUrl)

gitRevParseCommand := exec.Command("git", "rev-parse", "--show-toplevel")
rootDirectoryBytes, err := gitRevParseCommand.CombinedOutput()
Expand All @@ -72,22 +74,21 @@ func main() {
log.Println("no changed files found in diff")
os.Exit(0)
}
log.Println("found changed files: ", string(diffBytes))

authenticator := authenticator.New(clientID, clientSecret, tokenUrl)

vaas := vaas.New(options.DefaultOptions(), vaasUrl)
ctx, webSocketCancel := context.WithCancel(context.Background())
termChan, err := vaas.Connect(ctx, authenticator)
if err != nil {
log.Fatal("vaas connect error", err)
log.Fatal("vaas connect error: ", err)
}
if termChan == nil {
log.Fatal("vaas connect error")
}
var maliciousFileFound bool
for _, file := range files {
if file != "" {
log.Println("checking file: ", file)
pathToFile := filepath.Join(rootDirectory, file)
verdict, err := vaas.ForFile(context.Background(), pathToFile)
if err != nil {
Expand Down

0 comments on commit c938a52

Please sign in to comment.