diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-26 14:36:34 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-26 14:36:34 -0600 |
| commit | feca0a2a1680a0071e8223adcc861d8c0cc8aea9 (patch) | |
| tree | 436f5830b803223da24ee9e3ea0d1f011cfb6435 /cmd/authzd | |
| parent | 0275f5dca7c66640587294b95ce396dd6d6a02c8 (diff) | |
feat: connect to the remove authorization daemon
Diffstat (limited to 'cmd/authzd')
| -rw-r--r-- | cmd/authzd/main.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cmd/authzd/main.go b/cmd/authzd/main.go index 35f95a2..32a7cc7 100644 --- a/cmd/authzd/main.go +++ b/cmd/authzd/main.go @@ -7,16 +7,29 @@ import ( "os/signal" "syscall" + "github.com/xlgmokha/x/pkg/env" "github.com/xlgmokha/x/pkg/log" "github.com/xlgmokha/x/pkg/x" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/authz" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/pls" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) func main() { logger := log.New(os.Stdout, log.Fields{"app": "authzd"}) ctx := logger.WithContext(context.Background()) - server := authz.New(ctx) + + connection, err := grpc.NewClient( + env.Fetch("AUTHZD_HOST", "localhost:50051"), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + pls.LogErrorNow(ctx, err) + } + defer connection.Close() + + server := authz.New(authz.Connection.With(ctx, connection)) c := make(chan os.Signal, 1) signal.Notify(c, syscall.SIGINT, syscall.SIGTERM) |
