diff --git a/.gitmodules b/.gitmodules index 69f71d5..71c1532 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "proxmoxaas-common-lib"] path = proxmoxaas-common-lib url = https://git.tronnet.net/tronnet/proxmoxaas-common-lib +[submodule "go-proxmox"] + path = go-proxmox + url = https://github.com/luthermonson/go-proxmox diff --git a/app/pve/pve.go b/app/pve/pve.go index 6b44154..6b640c8 100644 --- a/app/pve/pve.go +++ b/app/pve/pve.go @@ -28,6 +28,7 @@ func NewClientFromCredentials(config common.PVEConfig, username common.Username, client := proxmox.NewClient(config.URL, proxmox.WithHTTPClient(&HTTPClient), proxmox.WithCredentials(&proxmox.Credentials{Username: username.UserID, Realm: username.Realm, Password: password}), + proxmox.WithEagerAuth(), ) // check that the user is authenticated because proxmox.NewClient does not return an error @@ -49,11 +50,13 @@ func (pve ProxmoxClient) SyncRealms() (int, error) { } for _, domain := range domains { if domain.Type != "pam" && domain.Type != "pve" { // pam and pve are not external realm types that require sync + e := proxmox.IntOrBool(true) + r := string("acl;entry;properties") err := domain.Sync(context.Background(), proxmox.DomainSyncOptions{ - DryRun: false, // we want to make modifications - EnableNew: true, // allow new users and groups - Scope: "both", // allow new users and groups - RemoveVanished: "acl;entry;properties", // remove deleted objects from ACL, entry in pve, and remove properties (probably not necessary) + DryRun: false, // we want to make modifications + EnableNew: &e, // allow new users and groups + Scope: "both", // allow new users and groups + RemoveVanished: &r, // remove deleted objects from ACL, entry in pve, and remove properties (probably not necessary) }) if proxmox.IsNotAuthorized(err) { return http.StatusUnauthorized, err diff --git a/go.mod b/go.mod index 1ca768e..0dc1be9 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( ) replace proxmoxaas-common-lib => ./proxmoxaas-common-lib +replace github.com/luthermonson/go-proxmox v0.6.0 => ./go-proxmox require ( github.com/Azure/go-ntlmssp v0.1.1 // indirect @@ -27,7 +28,7 @@ require ( github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.30.2 // indirect + github.com/go-playground/validator/v10 v10.30.3 // indirect github.com/goccy/go-json v0.10.6 // indirect github.com/goccy/go-yaml v1.19.2 // indirect github.com/google/uuid v1.6.0 // indirect