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:
@@ -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
|
||||
|
||||
+5
-2
@@ -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
|
||||
EnableNew: &e, // 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) {
|
||||
return http.StatusUnauthorized, err
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user