mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-20 23:51:26 +08:00
NM-38: User Config Fixes (#3559)
* Build(deps): bump gorm.io/datatypes from 1.2.5 to 1.2.6 Bumps [gorm.io/datatypes](https://github.com/go-gorm/datatypes) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/go-gorm/datatypes/releases) - [Commits](https://github.com/go-gorm/datatypes/compare/v1.2.5...v1.2.6) --- updated-dependencies: - dependency-name: gorm.io/datatypes dependency-version: 1.2.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Build(deps): bump google.golang.org/api from 0.238.0 to 0.240.0 (#3541) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.238.0 to 0.240.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.238.0...v0.240.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-version: 0.240.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Build(deps): bump github.com/go-playground/validator/v10 (#3539) Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.26.0 to 10.27.0. - [Release notes](https://github.com/go-playground/validator/releases) - [Commits](https://github.com/go-playground/validator/compare/v10.26.0...v10.27.0) --- updated-dependencies: - dependency-name: github.com/go-playground/validator/v10 dependency-version: 10.27.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(go): prevent idp user from being deleted; (#3538) * fix(go): use correct method for pro; fixes: User Config nodes are always reported online. * fix(go): add device id to extclient; * fix(go): try match device id; * fix(go): set device id if not set; * feat(go): return best match offline extclient; * fix(go): match device id with owner and gateway; * fix(go): remove check for rac id; * fix(go): check status on get node status; * fix(go): allow offline or unknown extclient; * feat(go): add count db method; * feat(go): revert change; --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Abhishek K <abhi281342@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -726,8 +726,17 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
for _, extclient := range extclients {
|
||||
if extclient.RemoteAccessClientID != "" &&
|
||||
extclient.RemoteAccessClientID == customExtClient.RemoteAccessClientID && extclient.OwnerID == caller.UserName && nodeid == extclient.IngressGatewayID {
|
||||
// if device id is sent, then make sure extclient with the same device id
|
||||
// does not exist.
|
||||
if customExtClient.DeviceID != "" && extclient.DeviceID == customExtClient.DeviceID &&
|
||||
extclient.OwnerID == caller.UserName && nodeid == extclient.IngressGatewayID {
|
||||
err = errors.New("remote client config already exists on the gateway")
|
||||
slog.Error("failed to create extclient", "user", userName, "error", err)
|
||||
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
|
||||
return
|
||||
}
|
||||
|
||||
if extclient.OwnerID == caller.UserName && nodeid == extclient.IngressGatewayID {
|
||||
// extclient on the gw already exists for the remote access client
|
||||
err = errors.New("remote client config already exists on the gateway")
|
||||
slog.Error("failed to create extclient", "user", userName, "error", err)
|
||||
@@ -774,6 +783,7 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
|
||||
extclient.Enabled = parentNetwork.DefaultACL == "yes"
|
||||
}
|
||||
extclient.Os = customExtClient.Os
|
||||
extclient.DeviceID = customExtClient.DeviceID
|
||||
extclient.DeviceName = customExtClient.DeviceName
|
||||
if customExtClient.IsAlreadyConnectedToInetGw {
|
||||
slog.Warn("RAC/Client is already connected to internet gateway. this may mask their real IP address", "client IP", customExtClient.PublicEndpoint)
|
||||
|
Reference in New Issue
Block a user