summaryrefslogtreecommitdiff
path: root/cmd/authzd
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-28 17:49:09 -0600
committermo khan <mo@mokhan.ca>2025-03-28 17:49:09 -0600
commit30bbdad4ef99449f29f412d0b770e4b9f76ede42 (patch)
treec295bb8b9020ba8a609d7a0a527a2a06fc5db342 /cmd/authzd
parente47813ecaa942631945215a8c0c938a240c3894a (diff)
refactor: move authorizers into authz package
Diffstat (limited to 'cmd/authzd')
-rw-r--r--cmd/authzd/main.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/cmd/authzd/main.go b/cmd/authzd/main.go
index 00d6247f..fad95fd3 100644
--- a/cmd/authzd/main.go
+++ b/cmd/authzd/main.go
@@ -1,27 +1,17 @@
package main
import (
- "context"
"log"
"net"
"github.com/xlgmokha/x/pkg/env"
"github.com/xlgmokha/x/pkg/x"
+ "gitlab.com/mokhax/spike/pkg/authz"
"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() {
- server := grpc.NewServer()
- rpc.RegisterAbilityServer(server, &CedarServer{})
+ server := rpc.New(authz.WithCedar())
log.Fatal(server.Serve(x.Must(net.Listen(
"tcp",
env.Fetch("BIND_ADDR", "localhost:50051"),