diff options
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/authzd/main.go | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/cmd/authzd/main.go b/cmd/authzd/main.go index f7b60bd..00d6247 100644 --- a/cmd/authzd/main.go +++ b/cmd/authzd/main.go @@ -1,7 +1,29 @@ package main -import "fmt" +import ( + "context" + "log" + "net" + + "github.com/xlgmokha/x/pkg/env" + "github.com/xlgmokha/x/pkg/x" + "gitlab.com/mokhax/spike/pkg/rpc" + "google.golang.org/grpc" +) + +type CedarServer struct { + rpc.UnimplementedAbilityServer +} + +func (srv *CedarServer) Allowed(context.Context, *rpc.AllowRequest) (*rpc.AllowReply, error) { + return &rpc.AllowReply{Result: true}, nil +} func main() { - fmt.Println("Hello, world!") + server := grpc.NewServer() + rpc.RegisterAbilityServer(server, &CedarServer{}) + log.Fatal(server.Serve(x.Must(net.Listen( + "tcp", + env.Fetch("BIND_ADDR", "localhost:50051"), + )))) } |
