Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename config and command items to use permissions-api consistently #63

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ IDENTITYAPI_TRACING_PROVIDER=jaeger
IDENTITYAPI_TRACING_JAEGER_ENDPOINT=http://localhost:14268/api/traces
IDENTITYAPI_CRDB_URI="postgresql://root@crdb:26257/identityapi_dev?sslmode=disable"

PERMISSIONAPI_TRACING_ENABLED=true
PERMISSIONAPI_TRACING_PROVIDER=jaeger
PERMISSIONAPI_TRACING_JAEGER_ENDPOINT=http://localhost:14268/api/traces
PERMISSIONAPI_SPICEDB_ENDPOINT=spicedb:50051
PERMISSIONAPI_SPICEDB_KEY=$SPICEDB_GRPC_PRESHARED_KEY
PERMISSIONAPI_SPICEDB_INSECURE=true
PERMISSIONSAPI_TRACING_ENABLED=true
PERMISSIONSAPI_TRACING_PROVIDER=jaeger
PERMISSIONSAPI_TRACING_JAEGER_ENDPOINT=http://localhost:14268/api/traces
PERMISSIONSAPI_SPICEDB_ENDPOINT=spicedb:50051
PERMISSIONSAPI_SPICEDB_KEY=$SPICEDB_GRPC_PRESHARED_KEY
PERMISSIONSAPI_SPICEDB_INSECURE=true

# cockroachdb container config
COCKROACH_INSECURE=true
Expand Down
10 changes: 5 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import (
)

var (
appName = "permissionapi"
appName = "permissions-api"
cfgFile string
logger *zap.SugaredLogger
globalCfg *config.AppConfig
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "infra-permission-api",
Short: "Infratographer Permission API Service",
Use: appName,
Short: "Infratographer Permissions API Service",
}

// Execute adds all child commands to the root command and sets flags appropriately.
Expand All @@ -39,7 +39,7 @@ func Execute() {

func init() {
cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is /etc/infratographer/permission-api.yaml)")
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is /etc/infratographer/permissions-api.yaml)")
loggingx.MustViperFlags(viper.GetViper(), rootCmd.PersistentFlags())

// Add version command
Expand Down Expand Up @@ -69,7 +69,7 @@ func initConfig() {
}

viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.SetEnvPrefix(appName)
viper.SetEnvPrefix("permissionsapi")
viper.AutomaticEnv() // read in environment variables that match

// If a config file is found, read it in.
Expand Down
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (

var serverCmd = &cobra.Command{
Use: "server",
Short: "starts the permission api server",
Short: "starts the permissions-api server",
Run: func(cmd *cobra.Command, args []string) {
serve(cmd.Context(), globalCfg)
},
Expand Down