Skip to content

Commit b307fad

Browse files
authored
remove EE license and oss build (#9369)
1 parent 54f787c commit b307fad

65 files changed

Lines changed: 4335 additions & 4938 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-dgraph-oss-build.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ dgraph:
3030
dgraph-coverage:
3131
$(MAKE) -w -C dgraph test-coverage-binary
3232

33-
.PHONY: oss
34-
oss:
35-
$(MAKE) BUILD_TAGS=oss
36-
3733
.PHONY: version
3834
version:
3935
@echo Dgraph: ${BUILD_VERSION}
@@ -48,10 +44,6 @@ install:
4844
@echo "Installing Dgraph..."; \
4945
$(MAKE) -C dgraph install; \
5046

51-
.PHONY: install_oss oss_install
52-
install_oss oss_install:
53-
$(MAKE) BUILD_TAGS=oss,jemalloc install
54-
5547
.PHONY: uninstall
5648
uninstall:
5749
@echo "Uninstalling Dgraph ..."; \
@@ -105,7 +97,6 @@ help:
10597
@echo
10698
@echo Build commands:
10799
@echo " make [all] - Build all targets [EE]"
108-
@echo " make oss - Build all targets [OSS]"
109100
@echo " make dgraph - Build dgraph binary"
110101
@echo " make install - Install all targets"
111102
@echo " make uninstall - Uninstall known targets"

dgraph/cmd/alpha/http.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/pkg/errors"
2525
"google.golang.org/grpc/metadata"
2626
jsonpb "google.golang.org/protobuf/encoding/protojson"
27+
"google.golang.org/protobuf/proto"
2728

2829
"github.com/dgraph-io/dgo/v240/protos/api"
2930
"github.com/hypermodeinc/dgraph/v24/dql"
@@ -133,6 +134,50 @@ func parseDuration(r *http.Request, name string) (time.Duration, error) {
133134
return durationValue, nil
134135
}
135136

137+
func loginHandler(w http.ResponseWriter, r *http.Request) {
138+
if commonHandler(w, r) {
139+
return
140+
}
141+
142+
// Pass in PoorMan's auth, IP information if present.
143+
ctx := x.AttachRemoteIP(context.Background(), r)
144+
ctx = x.AttachAuthToken(ctx, r)
145+
146+
body := readRequest(w, r)
147+
loginReq := api.LoginRequest{}
148+
if err := json.Unmarshal(body, &loginReq); err != nil {
149+
x.SetStatusWithData(w, x.Error, err.Error())
150+
return
151+
}
152+
153+
resp, err := (&edgraph.Server{}).Login(ctx, &loginReq)
154+
if err != nil {
155+
x.SetStatusWithData(w, x.ErrorInvalidRequest, err.Error())
156+
return
157+
}
158+
159+
jwt := &api.Jwt{}
160+
if err := proto.Unmarshal(resp.Json, jwt); err != nil {
161+
x.SetStatusWithData(w, x.Error, err.Error())
162+
}
163+
164+
response := map[string]interface{}{}
165+
mp := make(map[string]string)
166+
mp["accessJWT"] = jwt.AccessJwt
167+
mp["refreshJWT"] = jwt.RefreshJwt
168+
response["data"] = mp
169+
170+
js, err := json.Marshal(response)
171+
if err != nil {
172+
x.SetStatusWithData(w, x.Error, err.Error())
173+
return
174+
}
175+
176+
if _, err := x.WriteResponse(w, r, js); err != nil {
177+
glog.Errorf("Error while writing response: %v", err)
178+
}
179+
}
180+
136181
// This method should just build the request and proxy it to the Query method of dgraph.Server.
137182
// It can then encode the response as appropriate before sending it back to the user.
138183
func queryHandler(w http.ResponseWriter, r *http.Request) {

dgraph/cmd/alpha/login_ee.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

dgraph/cmd/alpha/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ func setupServer(closer *z.Closer) {
500500
baseMux := http.NewServeMux()
501501
http.Handle("/", audit.AuditRequestHttp(baseMux))
502502

503+
http.HandleFunc("/login", loginHandler)
503504
baseMux.HandleFunc("/query", queryHandler)
504505
baseMux.HandleFunc("/query/", queryHandler)
505506
baseMux.HandleFunc("/mutate", mutationHandler)

dgraph/cmd/root.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import (
3434
"github.com/hypermodeinc/dgraph/v24/dgraph/cmd/migrate"
3535
"github.com/hypermodeinc/dgraph/v24/dgraph/cmd/version"
3636
"github.com/hypermodeinc/dgraph/v24/dgraph/cmd/zero"
37+
"github.com/hypermodeinc/dgraph/v24/ee/acl"
38+
"github.com/hypermodeinc/dgraph/v24/ee/audit"
39+
"github.com/hypermodeinc/dgraph/v24/ee/backup"
3740
"github.com/hypermodeinc/dgraph/v24/upgrade"
3841
"github.com/hypermodeinc/dgraph/v24/x"
3942
)
@@ -74,7 +77,8 @@ var rootConf = viper.New()
7477
var subcommands = []*x.SubCommand{
7578
&bulk.Bulk, &cert.Cert, &conv.Conv, &live.Live, &alpha.Alpha, &zero.Zero, &version.Version,
7679
&debug.Debug, &migrate.Migrate, &debuginfo.DebugInfo, &upgrade.Upgrade, &decrypt.Decrypt, &increment.Increment,
77-
&checkupgrade.CheckUpgrade,
80+
&checkupgrade.CheckUpgrade, &backup.Restore, &backup.LsBackup, &backup.ExportBackup, &acl.CmdAcl,
81+
&audit.CmdAudit,
7882
}
7983

8084
func initCmds() {

dgraph/cmd/root_ee.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)