fixed client id

This commit is contained in:
Stephan D
2026-03-01 13:40:02 +01:00
parent d0368f5a00
commit 38077c1ed8
4 changed files with 5 additions and 4 deletions

View File

@@ -69,6 +69,7 @@ func hasGrantType(grants []string, target string) bool {
func (pr *PublicRouter) validateClientIPPolicy(r *http.Request, clientID string, client *model.Client) http.HandlerFunc {
if client == nil {
pr.logger.Info("Client not found, rejecting authorization", zap.String("client_id", clientID))
return response.Unauthorized(pr.logger, pr.service, "client not found")
}
clientIP := ipguard.ClientIP(r)

View File

@@ -14,12 +14,12 @@ func (b *NatsBroker) Publish(envelope me.Envelope) error {
// Serialize the message
data, err := envelope.Serialize()
if err != nil {
b.logger.Error("Failed to serialize message", zap.Error(err), mzap.Envelope(envelope))
b.logger.Warn("Failed to serialize message", zap.Error(err), mzap.Envelope(envelope))
return err
}
if err := b.nc.Publish(subject, data); err != nil {
b.logger.Error("Error publishing message", zap.Error(err), mzap.Envelope(envelope))
b.logger.Warn("Error publishing message", zap.Error(err), mzap.Envelope(envelope))
return err
}