Skip to content

Commit

Permalink
Update templates with latest build
Browse files Browse the repository at this point in the history
Signed-off-by: Radu Matei <[email protected]>
  • Loading branch information
radu-matei committed Apr 6, 2023
1 parent 732edf5 commit 6ab2629
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions explorer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/kv-explorer/content/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion templates/kv-explorer/metadata/snippets/component.txt
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down

0 comments on commit 6ab2629

Please sign in to comment.