fix: allow authorizer-domain as cli arg
This commit is contained in:
parent
464f9105c4
commit
2cda3ca8f4
|
@ -17,6 +17,7 @@ var Version string
|
|||
func ParseArgs() {
|
||||
dbURL := flag.String("database_url", "", "Database connection string")
|
||||
dbType := flag.String("databse_type", "", "Database type, possible values are postgres,mysql,sqlit")
|
||||
authroizerDomain := flag.String("authorizer_domain", "", "Domain name for authorizer instance, eg: https://xyz.herokuapp.com")
|
||||
flag.Parse()
|
||||
if *dbURL != "" {
|
||||
constants.DATABASE_URL = *dbURL
|
||||
|
@ -25,6 +26,10 @@ func ParseArgs() {
|
|||
if *dbType != "" {
|
||||
constants.DATABASE_TYPE = *dbType
|
||||
}
|
||||
|
||||
if *authroizerDomain != "" {
|
||||
constants.AUTHORIZER_DOMAIN = *authroizerDomain
|
||||
}
|
||||
}
|
||||
|
||||
// InitEnv -> to initialize env and through error if required env are not present
|
||||
|
@ -88,6 +93,12 @@ func InitEnv() {
|
|||
panic("Database type is required")
|
||||
}
|
||||
|
||||
if constants.AUTHORIZER_DOMAIN == "" {
|
||||
panic("Authroizer domain is required")
|
||||
}
|
||||
|
||||
log.Println("=> Authorizer domain=", constants.AUTHORIZER_DOMAIN)
|
||||
|
||||
if constants.JWT_TYPE == "" {
|
||||
constants.JWT_TYPE = "HS256"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user