diff --git a/explorer/main.go b/explorer/main.go index 3719040..caabe56 100644 --- a/explorer/main.go +++ b/explorer/main.go @@ -207,7 +207,7 @@ func GetCredentials() (string, string, error) { if err != nil { return "", "", fmt.Errorf("failed to generate random string for user: %v", err) } - defaultPassword, err := GenerateRandomString(10) + defaultPassword, err := GenerateRandomString(30) if err != nil { return "", "", fmt.Errorf("failed to generate random string for password: %v", err) } @@ -235,14 +235,14 @@ func GetCredentials() (string, string, error) { // number generator fails to function correctly, in which // case the caller should not continue. func GenerateRandomString(n int) (string, error) { - const letters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-" + const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-!@#$%^&*" ret := make([]byte, n) for i := 0; i < n; i++ { - num, err := rand.Int(rand.Reader, big.NewInt(int64(len(letters)))) + num, err := rand.Int(rand.Reader, big.NewInt(int64(len(chars)))) if err != nil { return "", err } - ret[i] = letters[num.Int64()] + ret[i] = chars[num.Int64()] } return string(ret), nil diff --git a/templates/kv-explorer/content/spin.toml b/templates/kv-explorer/content/spin.toml index 420ca20..5cdf095 100644 --- a/templates/kv-explorer/content/spin.toml +++ b/templates/kv-explorer/content/spin.toml @@ -4,7 +4,7 @@ trigger = { type = "http", base = "/" } version = "0.1.0" [[component]] -source = { url = "https://github.com/radu-matei/spin-kv-explorer/releases/download/v0.7.0/spin-kv-explorer.wasm", digest = "sha256:4d4985cb076161509641a7e6ad782202ae2d934f3c4ad8dfa1e37d220e9ed128 " } +source = { url = "https://github.com/radu-matei/spin-kv-explorer/releases/download/v0.7.0/spin-kv-explorer.wasm", digest = "sha256:31a7ad7d7f72cdfa77855e4fe1a607bcdd0129d1ca4bbeff599e6ec09c8ce93c" } id = "kv-explorer" # add or remove stores you want to explore here key_value_stores = ["default"] diff --git a/templates/kv-explorer/metadata/snippets/component.txt b/templates/kv-explorer/metadata/snippets/component.txt index 937fd45..b1ff0da 100644 --- a/templates/kv-explorer/metadata/snippets/component.txt +++ b/templates/kv-explorer/metadata/snippets/component.txt @@ -1,5 +1,5 @@ [[component]] -source = { url = "https://github.com/radu-matei/spin-kv-explorer/releases/download/v0.7.0/spin-kv-explorer.wasm", digest = "sha256:4d4985cb076161509641a7e6ad782202ae2d934f3c4ad8dfa1e37d220e9ed128 " } +source = { url = "https://github.com/radu-matei/spin-kv-explorer/releases/download/v0.7.0/spin-kv-explorer.wasm", digest = "sha256:31a7ad7d7f72cdfa77855e4fe1a607bcdd0129d1ca4bbeff599e6ec09c8ce93c" } id = "kv-explorer" # add or remove stores you want to explore here key_value_stores = ["default"]