Skip to content

Commit 5bddb3a

Browse files
committed
fix: fix cli flag
1 parent 0b9c5af commit 5bddb3a

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ sqlite-rest migrate ./migrates
1414

1515
```
1616
$ echo test > test.token
17-
$ sqlite-rest serve --auth-token-file test.token
17+
$ sqlite-rest serve --auth-token-file test.token --security-allow-table test
1818
```
1919

2020
## License

server_security.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"fmt"
54
"net/http"
65

76
"github.com/go-chi/chi/v5"
@@ -18,7 +17,7 @@ type ServerSecurityOptions struct {
1817
func (opts *ServerSecurityOptions) bindCLIFlags(fs *pflag.FlagSet) {
1918
fs.StringSliceVar(
2019
&opts.EnabledTableOrViews,
21-
"--security-allow-table",
20+
"security-allow-table",
2221
[]string{},
2322
"list of table or view names that are accessible (read & write)",
2423
)
@@ -36,7 +35,6 @@ func (opts *ServerSecurityOptions) createTableOrViewAccessCheckMiddleware(
3635
for _, t := range opts.EnabledTableOrViews {
3736
accesibleTableOrViews[t] = struct{}{}
3837
}
39-
fmt.Println(accesibleTableOrViews)
4038

4139
return func(next http.Handler) http.Handler {
4240
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {

0 commit comments

Comments
 (0)