linting
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user