The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/components/satokengen/cmd/main.go

36 lines
704 B

package main
import (
"fmt"
"os"
"strconv"
"github.com/grafana/grafana/pkg/components/satokengen"
)
// placeholder key generator
func main() {
// get number of keys to generate from args
numKeys := 1
if len(os.Args) > 1 {
var err error
numKeys, err = strconv.Atoi(os.Args[1])
if err != nil {
fmt.Println("ERROR: invalid number of keys to generate:", err)
return
}
}
for i := 0; i < numKeys; i++ {
key, err := satokengen.New("pl")
if err != nil {
fmt.Println("ERROR: generating key failed:", err)
return
}
fmt.Printf("\nGenerated key: %d:\n", i+1)
fmt.Println(key.ClientSecret)
fmt.Printf("\nGenerated key hash: %d \n", i+1)
fmt.Println(key.HashedKey)
}
}