From 1e10f373701ee017171970820f68ff33aac8faa4 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 11 Apr 2021 13:50:04 +0200 Subject: [PATCH] outpost: fix check for changed providers Signed-off-by: Jens Langhammer --- outpost/pkg/ak/api_update.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/outpost/pkg/ak/api_update.go b/outpost/pkg/ak/api_update.go index acf992be4..d3211ef1b 100644 --- a/outpost/pkg/ak/api_update.go +++ b/outpost/pkg/ak/api_update.go @@ -3,6 +3,7 @@ package ak import ( "crypto/sha512" "encoding/hex" + "encoding/json" "goauthentik.io/outpost/pkg/client/outposts" "goauthentik.io/outpost/pkg/models" @@ -16,8 +17,11 @@ func (a *APIController) Update() ([]*models.ProxyOutpostConfig, error) { } // Check provider hash to see if anything is changed hasher := sha512.New() - bin, _ := providers.Payload.MarshalBinary() - hash := hex.EncodeToString(hasher.Sum(bin)) + out, err := json.Marshal(providers.Payload.Results) + if err != nil { + return nil, nil + } + hash := hex.EncodeToString(hasher.Sum(out)) if hash == a.lastBundleHash { return nil, nil }