groupware: refactoring the API mechanisms

This commit is contained in:
Pascal Bleser
2025-07-29 15:49:38 +02:00
parent 127cd7406c
commit 5862bebbcc
7 changed files with 158 additions and 122 deletions

View File

@@ -7,6 +7,7 @@ import (
"fmt"
"io"
"net/http"
"net/http/httputil"
"net/url"
"github.com/opencloud-eu/opencloud/pkg/log"
@@ -127,6 +128,15 @@ func (h *HttpJmapApiClient) Command(ctx context.Context, logger *log.Logger, ses
req.Header.Add("User-Agent", h.userAgent)
h.auth(session.Username, logger, req)
{
if logger.Trace().Enabled() {
safereq := req.Clone(ctx)
safereq.Header.Set("Authorization", "***")
bytes, _ := httputil.DumpRequest(safereq, false)
logger.Info().Msgf("sending command: %s", string(bytes))
}
}
res, err := h.client.Do(req)
if err != nil {
logger.Error().Err(err).Msgf("failed to perform POST %v", jmapUrl)