Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Change Log

## 2025-03-18 - Runtime 0.17.4

- fix: dgraph connection should ignore key for localhost [#793](https://github.com/hypermodeinc/modus/pull/793)

## 2025-03-13 - CLI 0.17.1

- chore: cleanup unused dependencies and update remaining [#790](https://github.com/hypermodeinc/modus/pull/790)
Expand Down
27 changes: 9 additions & 18 deletions runtime/dgraphclient/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,11 @@ func createConnector(ctx context.Context, dgName string) (*dgraphConnector, erro
}

var opts []grpc.DialOption

if connection.Key != "" {
conKey, err := secrets.ApplySecretsToString(ctx, info, connection.Key)
if err != nil {
return nil, err
}

pool, err := x509.SystemCertPool()
if err != nil {
return nil, err
}
creds := credentials.NewClientTLSFromCert(pool, "")
if strings.Split(connection.GrpcTarget, ":")[0] == "localhost" {
opts = []grpc.DialOption{
grpc.WithTransportCredentials(creds),
grpc.WithPerRPCCredentials(&authCreds{conKey}),
grpc.WithTransportCredentials(insecure.NewCredentials()),
}
} else if strings.Split(connection.GrpcTarget, ":")[0] != "localhost" {
} else {
pool, err := x509.SystemCertPool()
if err != nil {
return nil, err
Expand All @@ -131,9 +119,12 @@ func createConnector(ctx context.Context, dgName string) (*dgraphConnector, erro
opts = []grpc.DialOption{
grpc.WithTransportCredentials(creds),
}
} else {
opts = []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
if connection.Key != "" {
if conKey, err := secrets.ApplySecretsToString(ctx, info, connection.Key); err != nil {
return nil, err
} else if conKey != "" {
opts = append(opts, grpc.WithPerRPCCredentials(&authCreds{conKey}))
}
}
}

Expand Down