feat/add meta query (#38)

* feat: add meta query

* fix: readme
This commit is contained in:
Lakhan Samani
2021-07-28 13:25:52 +05:30
committed by GitHub
parent f9d2bb8799
commit e11476364c
13 changed files with 564 additions and 24 deletions

20
server/utils/meta.go Normal file
View File

@@ -0,0 +1,20 @@
package utils
import (
"github.com/authorizerdev/authorizer/server/constants"
"github.com/authorizerdev/authorizer/server/graph/model"
)
// GetMeta helps in getting the meta data about the deployment
// version,
func GetMetaInfo() model.Meta {
return model.Meta{
Version: constants.VERSION,
IsGoogleLoginEnabled: constants.GOOGLE_CLIENT_ID != "" && constants.GOOGLE_CLIENT_SECRET != "",
IsGithubLoginEnabled: constants.GITHUB_CLIENT_ID != "" && constants.GOOGLE_CLIENT_SECRET != "",
IsFacebookLoginEnabled: constants.FACEBOOK_CLIENT_ID != "" && constants.FACEBOOK_CLIENT_SECRET != "",
IsTwitterLoginEnabled: constants.TWITTER_CLIENT_ID != "" && constants.TWITTER_CLIENT_SECRET != "",
IsBasicAuthenticationEnabled: constants.DISABLE_BASIC_AUTHENTICATION != "false",
IsEmailVerificationEnabled: constants.DISABLE_EMAIL_VERICATION != "false",
}
}