Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(debug): hide dummypay from configs response when not in debug mode #316

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/api/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewModule(bind string, debug bool) fx.Option {
return NewRouter(backend, info, healthController, a, debug, versions...)
}, fx.ParamTags(``, ``, ``, ``, `group:"apiVersions"`))),
fx.Provide(func(storage storage.Storage, engine engine.Engine) backend.Backend {
return services.New(storage, engine)
return services.New(storage, engine, debug)
}),
)
}
2 changes: 1 addition & 1 deletion internal/api/services/accounts_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestAccountsCreate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/accounts_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestAccountsGet(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := models.AccountID{
Reference: "test",
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/accounts_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestAccountsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)
laouji marked this conversation as resolved.
Show resolved Hide resolved

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/balances_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestBalancesList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/bank_accounts_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestBankAccountsCreate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestBankAccountsForwardToConnector(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

connectorID := models.ConnectorID{
Reference: uuid.New(),
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/bank_accounts_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestBankAccountsGet(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/bank_accounts_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestBankAccountsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestBankAccountsUpdateMetadata(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connector_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func (s *Service) ConnectorsConfigs() registry.Configs {
return registry.GetConfigs()
return registry.GetConfigs(s.debug)
}

func (s *Service) ConnectorsConfig(ctx context.Context, connectorID models.ConnectorID) (json.RawMessage, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connector_configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestConnectorConfigs(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

require.NotNil(t, s.ConnectorsConfigs())
}
2 changes: 1 addition & 1 deletion internal/api/services/connectors_config_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestConnectorsConfigUpdate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)
genericErr := fmt.Errorf("error")

tests := []struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connectors_handle_webhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestConnectorsHandleWebhooks(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connectors_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestConnectorsInstall(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connectors_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestConnectorsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connectors_reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestConnectorsReset(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/connectors_uninstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestConnectorsUninstall(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestPaymentInitiationAdjustmentsGetLast(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPaymentInitiationAdjustmentsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}

Expand Down Expand Up @@ -69,7 +69,7 @@ func TestPaymentInitiationAdjustmentsListAll(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPaymentInitiationRelatedPaymentsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}

Expand Down Expand Up @@ -69,7 +69,7 @@ func TestPaymentInitiationRelatedPaymentsListAll(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestPaymentInitiationsApprove(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

query := storage.NewListPaymentInitiationAdjustmentsQuery(
bunpaginate.NewPaginatedQueryOptions(storage.PaymentInitiationAdjustmentsQuery{}).
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payment_initiations_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPaymentInitiationsCreate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

piWithoutScheduledAt := models.PaymentInitiation{
Type: models.PAYMENT_INITIATION_TYPE_TRANSFER,
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payment_initiations_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestPaymentInitiationsDelete(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}
rightLastAdj := models.PaymentInitiationAdjustment{
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payment_initiations_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPaymentInitiationsGet(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := models.PaymentInitiationID{}

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payment_initiations_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestPaymentInitiationsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payment_initiations_reject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestPaymentInitiationsReject(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}
rightLastAdj := models.PaymentInitiationAdjustment{
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payment_initiations_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestPaymentInitiationsRetry(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

query := storage.NewListPaymentInitiationAdjustmentsQuery(
bunpaginate.NewPaginatedQueryOptions(storage.PaymentInitiationAdjustmentsQuery{}).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPaymentInitiationsReversalCreate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

pid := models.PaymentInitiationID{}
piTransfer := models.PaymentInitiation{
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payments_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPaymentsCreate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payments_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPaymentGet(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := models.PaymentID{}

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payments_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestPaymentsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/payments_update_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPaymentsUpdateMetadata(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := models.PaymentID{}

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_add_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPoolsAddAccount(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_balances_at_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestPoolsBalancesAt(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()
poolsAccount := []models.AccountID{{}}
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPoolsCreate(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestPoolsDelete(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPoolsGet(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestPoolsList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)
laouji marked this conversation as resolved.
Show resolved Hide resolved

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/pools_remove_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPoolsRemoveAccount(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := uuid.New()

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/schedules_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestSchedulesGet(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

id := "test"

Expand Down
2 changes: 1 addition & 1 deletion internal/api/services/schedules_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestSchedulesList(t *testing.T) {
store := storage.NewMockStorage(ctrl)
eng := engine.NewMockEngine(ctrl)

s := New(store, eng)
s := New(store, eng, false)

tests := []struct {
name string
Expand Down
Loading