Skip to content

Commit

Permalink
Remove unused JWT configuration and environment variable handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored Jul 15, 2024
2 parents c1d8afa + cdb7e39 commit 39be18e
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"os"
"os/user"
"strconv"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -200,30 +199,6 @@ func setConfig() {
panic(err)
}

//
// JWT
//

jwtConfigfileName := "jwt_auth"
viper.SetConfigName(jwtConfigfileName)
err = viper.MergeInConfig()
if err != nil {
log.Error().Err(err).Msgf("fatal error reading jwt_auth info from file: %w", err)
panic(err)
}

// Map environment variable names to config file key names
replacer := strings.NewReplacer("_", ".")
viper.SetEnvKeyReplacer(replacer)

// NOTE - the environment variable has higher priority than the config file
// Automatically recognize environment variables
viper.AutomaticEnv()

if viper.GetString("auth.jwt.publickey") == "" {
log.Panic().Msg("auth.jwt.publickey is not set, use the key in jwt_conf.yaml")
}

//
// Wait until CB-Spider is ready
//
Expand Down

0 comments on commit 39be18e

Please sign in to comment.