File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11package main
22
33import (
4- "fmt"
54 "net/http"
65
76 "github.com/go-chi/chi/v5"
@@ -18,7 +17,7 @@ type ServerSecurityOptions struct {
1817func (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 ) {
You can’t perform that action at this time.
0 commit comments