temporary fix for login time regression:

- add go-proxmox as submodule for latest commit
- use WithEagerAuth option to preempt 3s delay on HTTP 401 caused by lazy auth
This commit is contained in:
2026-05-30 06:17:00 +00:00
parent b0bcaf61a2
commit 98a12ef3e4
3 changed files with 12 additions and 5 deletions
+3
View File
@@ -1,3 +1,6 @@
[submodule "proxmoxaas-common-lib"] [submodule "proxmoxaas-common-lib"]
path = proxmoxaas-common-lib path = proxmoxaas-common-lib
url = https://git.tronnet.net/tronnet/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
+7 -4
View File
@@ -28,6 +28,7 @@ func NewClientFromCredentials(config common.PVEConfig, username common.Username,
client := proxmox.NewClient(config.URL, client := proxmox.NewClient(config.URL,
proxmox.WithHTTPClient(&HTTPClient), proxmox.WithHTTPClient(&HTTPClient),
proxmox.WithCredentials(&proxmox.Credentials{Username: username.UserID, Realm: username.Realm, Password: password}), 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 // 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 { for _, domain := range domains {
if domain.Type != "pam" && domain.Type != "pve" { // pam and pve are not external realm types that require sync 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{ err := domain.Sync(context.Background(), proxmox.DomainSyncOptions{
DryRun: false, // we want to make modifications DryRun: false, // we want to make modifications
EnableNew: true, // allow new users and groups EnableNew: &e, // allow new users and groups
Scope: "both", // 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) RemoveVanished: &r, // remove deleted objects from ACL, entry in pve, and remove properties (probably not necessary)
}) })
if proxmox.IsNotAuthorized(err) { if proxmox.IsNotAuthorized(err) {
return http.StatusUnauthorized, err return http.StatusUnauthorized, err
+2 -1
View File
@@ -12,6 +12,7 @@ require (
) )
replace proxmoxaas-common-lib => ./proxmoxaas-common-lib replace proxmoxaas-common-lib => ./proxmoxaas-common-lib
replace github.com/luthermonson/go-proxmox v0.6.0 => ./go-proxmox
require ( require (
github.com/Azure/go-ntlmssp v0.1.1 // indirect 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-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.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-json v0.10.6 // indirect
github.com/goccy/go-yaml v1.19.2 // indirect github.com/goccy/go-yaml v1.19.2 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect