feat: added pre-shared-key for read endpoints
All checks were successful
ci / build (push) Successful in 30s
All checks were successful
ci / build (push) Successful in 30s
This commit is contained in:
parent
90c89583a0
commit
042ce77ddc
5 changed files with 152 additions and 38 deletions
|
|
@ -22,6 +22,7 @@ const (
|
|||
func main() {
|
||||
addr := flag.String("addr", defaultAddr, "HTTP listen address")
|
||||
dbPath := flag.String("db", defaultDBPath, "SQLite database path")
|
||||
readToken := flag.String("read-token", os.Getenv("RECEIVER_READ_TOKEN"), "Pre-shared token for read endpoints (or set RECEIVER_READ_TOKEN)")
|
||||
flag.Parse()
|
||||
|
||||
logger := slog.New(slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{
|
||||
|
|
@ -35,7 +36,7 @@ func main() {
|
|||
}
|
||||
defer func() { _ = store.Close() }()
|
||||
|
||||
handler := receiver.NewHandler(store, logger)
|
||||
handler := receiver.NewHandler(store, logger, *readToken)
|
||||
mux := http.NewServeMux()
|
||||
handler.RegisterRoutes(mux)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue