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

Fix typos #1135

Merged
merged 1 commit into from
Jul 3, 2024
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
4 changes: 2 additions & 2 deletions buildopts/buildoptsfunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// SetLogger is called by TrcDb and other utilities to provide the extensions
// a handle to the error logger for custom libraries that need a hook into the
// logging infrastructure. In extension implementation,
// set global variables iwth type func(string, ...interface{})
// set global variables with type func(string, ...interface{})
// assign the globals to the return value of convLogger...
// You'll have to copy convLogger into your custom library implementation.
func SetLogger(logger interface{}) {
Expand All @@ -20,7 +20,7 @@ func SetLogger(logger interface{}) {
// SetErrorLogger is called by TrcDb and other utilities to provide the extensions
// a handle to the error logger for custom libraries that need a hook into the
// logging infrastructure. In extension implementation,
// set global variables iwth type func(string, ...interface{})
// set global variables with type func(string, ...interface{})
// assign the globals to the return value of convLogger...
// You'll have to copy convLogger into your custom library implementation.
func SetErrorLogger(logger interface{}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ Tokens can only be created when logged in to the vault with token creation permi

## Create Seed Files
Seed files are written in a YAML format. Each seed file is seeded under a single environment.
Seperate values for different environments in different files. [Example](tierceron/trc_seeds/seed.yml)
Separate values for different environments in different files. [Example](tierceron/trc_seeds/seed.yml)
Data is organized in the vault as key-values pairs in a file system. The seed file should reflect this organization.
All values in the seed fall under 5 'root' categories.

### templates
The templates folder should be seperated by service, then file. The keys match the name of what is being substituted in the
The templates folder should be separated by service, then file. The keys match the name of what is being substituted in the
template file (e.g. `{{.username}}`). The value for each key provides a reference to where the secret is stored in the vault.
This allows viewing what's stored in the vault without seeing the actual value. The value is a 2 element array. The first
entry is the location of the secret in the vault, the second entry is the key for the secret.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/trcconfigbase/utils/dataStorePopulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (cds *ConfigDataStore) GetConfigValues(service string, config string) (map[
return nil, false
}

// GetConfigValue gets an invididual configuration value for a service from the data store.
// GetConfigValue gets an individual configuration value for a service from the data store.
func (cds *ConfigDataStore) GetConfigValue(service string, config string, key string) (string, bool) {
key = strings.Replace(key, ".", "_", -1)
if serviceValues, okServiceValues := cds.dataMap[service].(map[string]interface{}); okServiceValues {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/trcinitbase/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func CommonMain(envPtr *string,
_, _, _, err = v.Unseal()
eUtils.LogErrorObject(&driverConfig.CoreConfig, err, true)
}
logger.Printf("Succesfully connected to vault at %s\n", *addrPtr)
logger.Printf("Successfully connected to vault at %s\n", *addrPtr)

if !*newPtr && *namespaceVariable != "" && *namespaceVariable != "vault" && !(*rotateTokens || *updatePolicy || *updateRole || *tokenExpiration) {
if *initNamespace {
Expand Down
6 changes: 3 additions & 3 deletions pkg/core/util/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ func NewProperties(config *core.CoreConfig, v *sys.Vault, mod *helperkv.Modifier
return &properties, nil
}

// GetValue gets an invididual configuration value for a service from the data store.
// GetValue gets an individal configuration value for a service from the data store.
func (p *Properties) GetValue(service string, keyPath []string, key string) (string, error) {
return p.cds.GetValue(service, keyPath, key)
}

// GetConfigValue gets an invididual configuration value for a service from the data store.
// GetConfigValue gets an individal configuration value for a service from the data store.
func (p *Properties) GetConfigValue(service string, config string, key string) (string, bool) {
return p.cds.GetConfigValue(service, config, key)
}

// GetConfigValues gets an invididual configuration value for a service from the data store.
// GetConfigValues gets an individal configuration value for a service from the data store.
func (p *Properties) GetConfigValues(service string, config string) (map[string]interface{}, bool) {
return p.cds.GetConfigValues(service, config)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/trcinit/initlib/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
sys "github.com/trimble-oss/tierceron/pkg/vaulthelper/system"
)

// UploadPolicies accepts a file directory and vault object to upload policies to. Logs to pased logger
// UploadPolicies accepts a file directory and vault object to upload policies to. Logs to passed logger
func UploadPolicies(config *core.CoreConfig, dir string, v *sys.Vault, noPermissions bool) error {
config.Log.SetPrefix("[POLICY]")
config.Log.Printf("Writing policies from %s\n", dir)
Expand Down Expand Up @@ -41,7 +41,7 @@ func UploadPolicies(config *core.CoreConfig, dir string, v *sys.Vault, noPermiss
return nil
}

// GetExistsPolicies accepts a file directory and vault object to check policies for. Logs to pased logger
// GetExistsPolicies accepts a file directory and vault object to check policies for. Logs to passed logger
func GetExistsPolicies(config *core.CoreConfig, dir string, v *sys.Vault) (bool, error) {
config.Log.SetPrefix("[POLICY]")
config.Log.Printf("Checking exists token policies from %s\n", dir)
Expand Down
4 changes: 2 additions & 2 deletions pkg/trcinit/initlib/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
sys "github.com/trimble-oss/tierceron/pkg/vaulthelper/system"
)

// UploadTokenCidrRoles accepts a file directory and vault object to upload token roles to. Logs to pased logger
// UploadTokenCidrRoles accepts a file directory and vault object to upload token roles to. Logs to passed logger
func UploadTokenCidrRoles(config *core.CoreConfig, dir string, v *sys.Vault) error {
config.Log.SetPrefix("[ROLE]")
config.Log.Printf("Writing token roles from %s\n", dir)
Expand All @@ -35,7 +35,7 @@ func UploadTokenCidrRoles(config *core.CoreConfig, dir string, v *sys.Vault) err
return nil
}

// GetExistsRole accepts a file directory and vault object to check existence of token roles. Logs to pased logger
// GetExistsRole accepts a file directory and vault object to check existence of token roles. Logs to passed logger
func GetExistsRoles(config *core.CoreConfig, dir string, v *sys.Vault) (bool, error) {
config.Log.SetPrefix("[ROLE]")
config.Log.Printf("Checking exists token roles from %s\n", dir)
Expand Down
2 changes: 1 addition & 1 deletion pkg/trcinit/initlib/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
pb "github.com/trimble-oss/tierceron/trcweb/rpc/apinator"
)

// UploadTokens accepts a file directory and vault object to upload tokens to. Logs to pased logger
// UploadTokens accepts a file directory and vault object to upload tokens to. Logs to passed logger
func UploadTokens(config *core.CoreConfig, dir string, fileFilterPtr *string, v *sys.Vault) []*pb.InitResp_Token {
tokens := []*pb.InitResp_Token{}
config.Log.SetPrefix("[TOKEN]")
Expand Down
2 changes: 1 addition & 1 deletion pkg/trcinit/initlib/vault-seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ func SeedVaultFromData(driverConfig *eUtils.DriverConfig, filepath string, fData
for _, entry := range writeStack {
seedCert := false
// Output data being written
// Write data and ouput any errors
// Write data and output any errors
_, isCertData := entry.data["certData"]

seedData := !driverConfig.CoreConfig.WantCerts && !isCertData
Expand Down
2 changes: 1 addition & 1 deletion pkg/trcinit/initlib/vpub.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func UploadTemplates(config *core.CoreConfig, mod *helperkv.Modifier, dirName st
}
}

// Seperate name and extension one more time for saving to vault
// Separate name and extension one more time for saving to vault
ext = filepath.Ext(name)
name = name[0 : len(name)-len(ext)]
config.Log.Printf("dirName: %s\n", dirName)
Expand Down
8 changes: 4 additions & 4 deletions pkg/trcinit/initlib/vsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func DownloadTemplates(config *core.CoreConfig, mod *helperkv.Modifier, dirName
if !strings.HasSuffix(filterTemplatePath, "/") {
path = filterTemplatePath + "/"
}
tfMap, err := mod.ReadData(fmt.Sprintf("templates/%stemplate-file", path)) //Grab extention of file
tfMap, err := mod.ReadData(fmt.Sprintf("templates/%stemplate-file", path)) //Grab extension of file
if err != nil {
eUtils.LogErrorMessage(config, "Skipping template: "+path+" Error: "+err.Error(), false)
continue
Expand Down Expand Up @@ -80,7 +80,7 @@ func DownloadTemplates(config *core.CoreConfig, mod *helperkv.Modifier, dirName
eUtils.LogErrorMessage(config, fmt.Sprintf("Couldn't sync file: %s", templateFile), false)
continue
}
fmt.Printf("File has been writen to %s\n", templateFile)
fmt.Printf("File has been written to %s\n", templateFile)
}
}

Expand Down Expand Up @@ -153,7 +153,7 @@ func DownloadTemplateDirectory(config *core.CoreConfig, mod *helperkv.Modifier,
continue
}
ext := ""
tfMap, err := mod.ReadData(path + "template-file") //Grab extention of file
tfMap, err := mod.ReadData(path + "template-file") //Grab extension of file
if err != nil {
eUtils.LogErrorMessage(config, "Skipping template: "+path+" Error: "+err.Error(), false)
continue
Expand Down Expand Up @@ -210,7 +210,7 @@ func DownloadTemplateDirectory(config *core.CoreConfig, mod *helperkv.Modifier,
eUtils.LogErrorMessage(config, "Couldn't sync file: "+dirPath+file+ext+".tmpl", false)
continue
}
fmt.Println("File has been writen to " + dirPath + file + ext + ".tmpl")
fmt.Println("File has been written to " + dirPath + file + ext + ".tmpl")
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/trcx/xencrypt/xencrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@ func SetEncryptionSecret(driverConfig *eUtils.DriverConfig) error {
}

func GetEncryptors(secSection map[string]map[string]map[string]string) (map[string]interface{}, error) {
encrpytion := map[string]interface{}{}
encrpytionList := []string{"salt", "initial_value"}
for _, encryptionField := range encrpytionList {
encryption := map[string]interface{}{}
encryptionList := []string{"salt", "initial_value"}
for _, encryptionField := range encryptionList {
for secretSectionMap := range secSection["super-secrets"] {
if value, ok := secSection["super-secrets"][secretSectionMap][encryptionField]; ok {
if value != "" {
encrpytion[encryptionField] = value
encryption[encryptionField] = value
}
}
}
}

if ok, ok1 := encrpytion["salt"], encrpytion["initial_value"]; ok == nil || ok1 == nil {
if ok, ok1 := encryption["salt"], encryption["initial_value"]; ok == nil || ok1 == nil {
return nil, errors.New("could not find encryption values")
}

return encrpytion, nil
return encryption, nil
}

func CreateEncryptedReadMap(encryptedKeys string) map[string]interface{} {
Expand Down
2 changes: 1 addition & 1 deletion pkg/trcx/xutil/xmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func GenerateSeedSectionFromVaultRaw(driverConfig *eUtils.DriverConfig, template
if driverConfig.Token != "novault" && mod.Version != "0" { //If version isn't latest or is a flag
var noCertPaths []string
var certPaths []string
for _, templatePath := range templatePaths { //Seperate cert vs normal paths
for _, templatePath := range templatePaths { //Separate cert vs normal paths
if !strings.Contains(templatePath, "Common") {
noCertPaths = append(noCertPaths, templatePath)
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/diffUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func LineByLineDiff(stringA *string, stringB *string, patchData bool, colorSkip
diffs = diffs[:0]
}

//Seperates diff into red and green lines
//Separates diff into red and green lines
var redBuffer bytes.Buffer
var greenBuffer bytes.Buffer
for _, diff := range diffs {
Expand Down
2 changes: 1 addition & 1 deletion trcweb/server/gqlTemplates.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *Server) getTemplateData() (*pb.ValuesRes, error) {
continue

} else {
// Construct a string -> bool map to track accessable environments
// Construct a string -> bool map to track accessible environments

if vDataKeys, ok := vSecret.Data["keys"]; ok {
if vKeys, okKeys := vDataKeys.([]interface{}); okKeys {
Expand Down