Skip to content

Commit

Permalink
fix management api.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Jul 12, 2024
1 parent 12f4f35 commit 3f9b8de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ go 1.21.4
toolchain go1.21.6

require (
github.com/fiatjaf/eventstore v0.5.0
github.com/fiatjaf/khatru v0.6.0
github.com/fiatjaf/eventstore v0.5.1
github.com/fiatjaf/khatru v0.6.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/nbd-wtf/go-nostr v0.34.2
github.com/nbd-wtf/go-nostr v0.34.4
github.com/nbd-wtf/nostr-sdk v0.1.0
github.com/rs/zerolog v1.31.0
github.com/theplant/htmlgo v1.0.3
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/fasthttp/websocket v1.5.7 h1:0a6o2OfeATvtGgoMKleURhLT6JqWPg7fYfWnH4KHau4=
github.com/fasthttp/websocket v1.5.7/go.mod h1:bC4fxSono9czeXHQUVKxsC0sNjbm7lPJR04GDFqClfU=
github.com/fiatjaf/eventstore v0.5.0 h1:s+oROGUylAJhntIAPLgLekpTtxpExNd+QhSw0tby7Es=
github.com/fiatjaf/eventstore v0.5.0/go.mod h1:A3SgQ8hwDjZuhZ1aFT250BA70EsWsTIw0KRjm6PDh0w=
github.com/fiatjaf/eventstore v0.5.1 h1:tTh+JYP0RME51VY2QB2Gvtzj6QTaZAnSVhgZtrYqY2A=
github.com/fiatjaf/eventstore v0.5.1/go.mod h1:r5yCFmrVNT2b1xUOuMnDVS3xPGh97y8IgTcLyY2rYP8=
github.com/fiatjaf/generic-ristretto v0.0.1 h1:LUJSU87X/QWFsBXTwnH3moFe4N8AjUxT+Rfa0+bo6YM=
github.com/fiatjaf/generic-ristretto v0.0.1/go.mod h1:cvV6ANHDA/GrfzVrig7N7i6l8CWnkVZvtQ2/wk9DPVE=
github.com/fiatjaf/khatru v0.6.0 h1:o8O1gwHCBRccIbdJGiWjbwezHvKTCuwS2edQH7qIB8I=
github.com/fiatjaf/khatru v0.6.0/go.mod h1:BsEwqxe0wL/py1qN9539kw1ma+aG0GoJDDYcJB2f0sM=
github.com/fiatjaf/khatru v0.6.1 h1:bH9GKhsGY83rTJSYZznXUf7iOFpNKg1zV8vzG0Jrr/4=
github.com/fiatjaf/khatru v0.6.1/go.mod h1:dYTEXVwYQ2tB+whuL9DGg/GLV3y//io/FsQP7qY1jCs=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
Expand Down Expand Up @@ -95,8 +95,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/nbd-wtf/go-nostr v0.34.2 h1:9b4qZ29DhQf9xEWN8/7zfDD868r1jFbpjrR3c+BHc+E=
github.com/nbd-wtf/go-nostr v0.34.2/go.mod h1:NZQkxl96ggbO8rvDpVjcsojJqKTPwqhP4i82O7K5DJs=
github.com/nbd-wtf/go-nostr v0.34.4 h1:bWjUnD5B6vdK8o+Un2EKAJ8cA2o+myQKzdZa/HxqTMk=
github.com/nbd-wtf/go-nostr v0.34.4/go.mod h1:NZQkxl96ggbO8rvDpVjcsojJqKTPwqhP4i82O7K5DJs=
github.com/nbd-wtf/nostr-sdk v0.1.0 h1:uhWH9qzJx4HXp7b/mvPhAxwN5v9pXl4Mb6QFlX0ty7k=
github.com/nbd-wtf/nostr-sdk v0.1.0/go.mod h1:A1dWNqcqw/ZxDhcNpCc+y2u9mMTkWEh0dD11QEKrMNE=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down
6 changes: 5 additions & 1 deletion management.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func listAllowedPubKeysHandler(ctx context.Context) ([]nip86.PubKeyReason, error
list := make([]nip86.PubKeyReason, len(whitelist))
i := 0
for pubkey, inviter := range whitelist {
list[i] = nip86.PubKeyReason{PubKey: pubkey, Reason: fmt.Sprintf("invited by %s", inviter)}
reason := fmt.Sprintf("invited by %s", inviter)
if inviter == "" {
reason = "root user"
}
list[i] = nip86.PubKeyReason{PubKey: pubkey, Reason: reason}
i++
}
return list, nil
Expand Down

0 comments on commit 3f9b8de

Please sign in to comment.