Commit ba422b05 authored by Gurvinder Singh's avatar Gurvinder Singh
Browse files

updated config file options and fixed failing test due to that

parent a12674cd
......@@ -6,6 +6,7 @@
# Folders
_obj
_test
vendor/
# Architecture specific extensions/prefixes
*.[568vq]
......
......@@ -3,6 +3,8 @@ PACKAGE_DIRS := $(shell glide nv)
VERSION := $(shell git describe --tags --dirty --always)
DIST_DIRS := find * -type d -exec
all: test build install dist
build:
mkdir -p dist/linux-amd64
${GO_EXECUTABLE} build -o dist/linux-amd64/jwt-tokenissuer -ldflags "-X main.version=${VERSION}"
......
......@@ -21,9 +21,19 @@ func init() {
// Log as JSON to stderr
log.SetFormatter(&log.JSONFormatter{})
log.SetOutput(os.Stderr)
// Parse flags
showVersion := flag.Bool("version", false, "Prints version information and exits")
configFile := flag.String("c", "jwt.example", "Use the specified `configfile`")
flag.Parse()
// Show version and exit
if *showVersion {
fmt.Println("jwt-tokenissuer version", version)
os.Exit(0)
}
// Find config file
err := conf.ReadConfig("jwt")
err := conf.ReadConfig(*configFile)
if err != nil {
log.WithFields(log.Fields{
"detail": err,
......@@ -73,15 +83,6 @@ func listenHTTP(ssl bool, port int) {
func main() {
// Set up a version option, until we get a /healthz endpoint or
// something similar
showVersion := flag.Bool("version", false, "Prints version information and exits")
flag.Parse()
if *showVersion {
fmt.Println("oidc-tokenissuer version", version)
os.Exit(0)
}
// Initialize Authentication middleware
auth.SetConfig(
[]string{"dataporten"},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment