-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dev cli #30
base: main
Are you sure you want to change the base?
Conversation
parse json file that contain informations and variables imported in thr CLI
… / Implemente push function: read .env file and create/modify all variables that not begin with SECURE_ENV_
… / Implemente push function: read .env file and create/modify all variables that not begin with SECURE_ENV_
CLI/main.go
Outdated
var ( | ||
rootFlagSet = flag.NewFlagSet("textctl", flag.ExitOnError) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var ( | |
rootFlagSet = flag.NewFlagSet("textctl", flag.ExitOnError) | |
) | |
rootFlagSet := flag.NewFlagSet("textctl", flag.ExitOnError) |
CLI/main.go
Outdated
vault_actions.Push(client) | ||
return nil | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move these commands in their respective files and import them in the main, it will be cleaner as we will add more and more commands in the future
CLI/secure-env.env
Outdated
SECURE_ENV_PROJECT_NAME="secure-env" | ||
SECURE_ENV_HOST="https://secure-env.poc-innovation.com:8200/" | ||
SECURE_ENV_PORT=8200 | ||
SECURE_ENV_TOKEN="hvs.NWAqB95aaCepzz7GXVrO43KW" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove it from your commit, and rename it .env
for a more conventional name
CLI/parse_file/parse_file.go
Outdated
err := godotenv.Load("secure-env.env") | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err := godotenv.Load("secure-env.env") | |
if err != nil { | |
if err := godotenv.Load("env"); err != nil { |
CLI/vault_actions/push.go
Outdated
return variable | ||
} | ||
|
||
func IsVariableSecureEnvLocal(variable Variable) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you add an uppercase if it's only used in this file ?
func IsVariableSecureEnvLocal(variable Variable) bool { | |
func isVariableSecureEnvLocal(variable Variable) bool { |
CLI/vault_actions/push.go
Outdated
return result | ||
} | ||
|
||
func Create_var(data string) Variable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
CLI/vault_actions/push.go
Outdated
Value string | ||
} | ||
|
||
func LinesInFile(fileName string) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
CLI/vault_actions/push.go
Outdated
} | ||
return push | ||
} | ||
|
||
func Push(client *vault.Client) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it's this function that is exported for nothing imo as it's only used in this file
} | ||
return screate | ||
} | ||
|
||
func Screate(name string, secretData map[string]interface{}, client *vault.Client) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
CLI/vault_actions/sdelete.go
Outdated
} | ||
return sdelete | ||
} | ||
|
||
func Sdelete(name string, client *vault.Client) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
CLI/vault_actions/sget.go
Outdated
} | ||
return sget | ||
} | ||
|
||
func Sget(name string, key string, client *vault.Client) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and again 😄
…create function's name since it's used in push.go file
Description
Add push function that :
Edit Screate function :
Changes include
Bugfixe on Screate function
New push function
Checklist