This commit is contained in:
Stephan D
2026-03-10 12:31:09 +01:00
parent d87e709f43
commit e77d1ab793
287 changed files with 2089 additions and 1550 deletions

View File

@@ -11,6 +11,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts single URL credentials", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := "nats://alice:supersecret@localhost:4222"
sanitized := buildSafePublishableNATSURL(raw)
@@ -25,6 +26,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts credentials in gateway URL format", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := "nats://dev_nats:nats_password_123@dev-nats:4222"
sanitized := buildSafePublishableNATSURL(raw)
@@ -49,6 +51,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts each URL in server list", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := " nats://alice:one@localhost:4222, nats://bob:two@localhost:4223 "
sanitized := buildSafePublishableNATSURL(raw)
@@ -73,6 +76,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts malformed URL credentials via fallback", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := "nats://alice:pa%ss@localhost:4222"
sanitized := buildSafePublishableNATSURL(raw)

View File

@@ -24,7 +24,7 @@ func (acn *AccountNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return acn.Envelope.Wrap(data)
return acn.Wrap(data)
}
func NewAccountNotification(action nm.NotificationAction) model.NotificationEvent {

View File

@@ -24,7 +24,7 @@ func (prn *PasswordResetNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return prn.Envelope.Wrap(data)
return prn.Wrap(data)
}
func NewPasswordResetNotification(action nm.NotificationAction) model.NotificationEvent {

View File

@@ -27,7 +27,7 @@ func (ccn *ConfirmationCodeNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return ccn.Envelope.Wrap(data)
return ccn.Wrap(data)
}
func newConfirmationEvent(action nm.NotificationAction) model.NotificationEvent {

View File

@@ -20,7 +20,7 @@ func (crn *ConfirmationRequestNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return crn.Envelope.Wrap(data)
return crn.Wrap(data)
}
type ConfirmationResultNotification struct {
@@ -33,7 +33,7 @@ func (crn *ConfirmationResultNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return crn.Envelope.Wrap(data)
return crn.Wrap(data)
}
type ConfirmationDispatchNotification struct {
@@ -46,7 +46,7 @@ func (cdn *ConfirmationDispatchNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return cdn.Envelope.Wrap(data)
return cdn.Wrap(data)
}
func confirmationRequestEvent() model.NotificationEvent {

View File

@@ -29,7 +29,7 @@ func (nrn *NResultNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return nrn.Envelope.Wrap(data)
return nrn.Wrap(data)
}
func NewNRNotification() model.NotificationEvent {

View File

@@ -24,7 +24,7 @@ func (acn *ObjectNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return acn.Envelope.Wrap(data)
return acn.Wrap(data)
}
func NewObjectNotification(t mservice.Type, action nm.NotificationAction) model.NotificationEvent {

View File

@@ -19,7 +19,7 @@ func (pgn *PaymentGatewayIntentNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return pgn.Envelope.Wrap(data)
return pgn.Wrap(data)
}
type PaymentGatewayExecutionNotification struct {
@@ -32,7 +32,7 @@ func (pgn *PaymentGatewayExecutionNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return pgn.Envelope.Wrap(data)
return pgn.Wrap(data)
}
func intentEvent() model.NotificationEvent {

View File

@@ -20,7 +20,7 @@ func (psn *PaymentStatusUpdatedNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return psn.Envelope.Wrap(data)
return psn.Wrap(data)
}
func paymentStatusUpdatedEvent() model.NotificationEvent {

View File

@@ -74,7 +74,7 @@ func (srn *SiteRequestNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return srn.Envelope.Wrap(data)
return srn.Wrap(data)
}
func newSiteRequestEvent() model.NotificationEvent {

View File

@@ -19,7 +19,7 @@ func (trn *TelegramReactionNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return trn.Envelope.Wrap(data)
return trn.Wrap(data)
}
func telegramReactionEvent() model.NotificationEvent {
@@ -36,7 +36,7 @@ func (ttn *TelegramTextNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return ttn.Envelope.Wrap(data)
return ttn.Wrap(data)
}
func telegramTextEvent() model.NotificationEvent {
@@ -53,7 +53,7 @@ func (tun *TelegramUpdateNotification) Serialize() ([]byte, error) {
if err != nil {
return nil, err
}
return tun.Envelope.Wrap(data)
return tun.Wrap(data)
}
func telegramUpdateEvent() model.NotificationEvent {