diff --git a/CHANGELOG.md b/CHANGELOG.md index b0b28eccd..b50266df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add sorting to `GET /users` endpoint [#104](https://github.com/stellar/stellar-disbursement-platform-backend/pull/104) +## [1.0.1](https://github.com/stellar/stellar-disbursement-platform-backend/compare/1.0.0...1.0.1) + +### Changed + +- Update log message for better debugging. [#125](https://github.com/stellar/stellar-disbursement-platform-backend/pull/125) + +### Fixed + +- Fix client_domain from the Viobrant Assist wallet. [#126](https://github.com/stellar/stellar-disbursement-platform-backend/pull/126) + ## [1.0.0](https://github.com/stellar/stellar-disbursement-platform-backend/compare/1.0.0-rc2...1.0.0) ### Added diff --git a/cmd/db_test.go b/cmd/db_test.go index 4a4855660..4d0195e6d 100644 --- a/cmd/db_test.go +++ b/cmd/db_test.go @@ -226,7 +226,7 @@ func Test_DatabaseCommand_db_setup_for_network(t *testing.T) { // Test the two wallets assert.Equal(t, "Vibrant Assist", vibrantAssist.Name) assert.Equal(t, "https://vibrantapp.com/vibrant-assist", vibrantAssist.Homepage) - assert.Equal(t, "api.vibrantapp.com", vibrantAssist.SEP10ClientDomain) + assert.Equal(t, "vibrantapp.com", vibrantAssist.SEP10ClientDomain) assert.Equal(t, "https://vibrantapp.com/sdp", vibrantAssist.DeepLinkSchema) assert.Equal(t, "Vibrant Assist RC", vibrantAssistRC.Name) @@ -244,7 +244,7 @@ func Test_DatabaseCommand_db_setup_for_network(t *testing.T) { "Name: Vibrant Assist", "Homepage: https://vibrantapp.com/vibrant-assist", "Deep Link Schema: https://vibrantapp.com/sdp", - "SEP-10 Client Domain: api.vibrantapp.com", + "SEP-10 Client Domain: vibrantapp.com", } logs := buf.String() diff --git a/helmchart/sdp/Chart.yaml b/helmchart/sdp/Chart.yaml index 30eed34ec..4fb5d9ffe 100644 --- a/helmchart/sdp/Chart.yaml +++ b/helmchart/sdp/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: stellar-disbursement-platform description: A Helm chart for the Stellar Disbursement Platform Backend (A.K.A. `sdp`) version: 0.9.3 -appVersion: "1.0.0" +appVersion: "1.0.1" type: application maintainers: - name: Stellar Development Foundation diff --git a/internal/serve/httphandler/receiver_send_otp_handler.go b/internal/serve/httphandler/receiver_send_otp_handler.go index f4315cb63..120136412 100644 --- a/internal/serve/httphandler/receiver_send_otp_handler.go +++ b/internal/serve/httphandler/receiver_send_otp_handler.go @@ -63,10 +63,11 @@ func (h ReceiverSendOTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request return } + truncatedPhoneNumber := utils.TruncateString(receiverSendOTPRequest.PhoneNumber, 3) if phoneValidateErr := utils.ValidatePhoneNumber(receiverSendOTPRequest.PhoneNumber); phoneValidateErr != nil { extras := map[string]interface{}{"phone_number": "phone_number is required"} if !errors.Is(phoneValidateErr, utils.ErrEmptyPhoneNumber) { - phoneValidateErr = fmt.Errorf("validating phone number %s: %w", utils.TruncateString(receiverSendOTPRequest.PhoneNumber, len(receiverSendOTPRequest.PhoneNumber)/4), phoneValidateErr) + phoneValidateErr = fmt.Errorf("validating phone number %s: %w", truncatedPhoneNumber, phoneValidateErr) log.Ctx(ctx).Error(phoneValidateErr) extras["phone_number"] = "invalid phone number provided" } @@ -117,7 +118,7 @@ func (h ReceiverSendOTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request } if numberOfUpdatedRows < 1 { - log.Ctx(ctx).Warnf("updated no rows in receiver send OTP handler for phone number: %s", utils.TruncateString(receiverSendOTPRequest.PhoneNumber, len(receiverSendOTPRequest.PhoneNumber)/4)) + log.Ctx(ctx).Warnf("updated no rows in ReceiverSendOTPHandler, please verify if the provided phone number (%s) and client_domain (%s) are both valid", truncatedPhoneNumber, sep24Claims.ClientDomainClaim) } else { sendOTPData := ReceiverSendOTPData{ OTP: newOTP, @@ -147,7 +148,7 @@ func (h ReceiverSendOTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request Message: builder.String(), } - log.Ctx(ctx).Infof("sending OTP message to phone number: %s", utils.TruncateString(receiverSendOTPRequest.PhoneNumber, 3)) + log.Ctx(ctx).Infof("sending OTP message to phone number: %s", truncatedPhoneNumber) err = h.SMSMessengerClient.SendMessage(smsMessage) if err != nil { httperror.InternalError(ctx, "Cannot send OTP message", err, nil).Render(w) diff --git a/internal/services/setup_wallets_for_network_service_test.go b/internal/services/setup_wallets_for_network_service_test.go index 6a6200b69..f476bfbd4 100644 --- a/internal/services/setup_wallets_for_network_service_test.go +++ b/internal/services/setup_wallets_for_network_service_test.go @@ -72,7 +72,7 @@ func Test_SetupWalletsForProperNetwork(t *testing.T) { "Name: Vibrant Assist", "Homepage: https://vibrantapp.com/vibrant-assist", "Deep Link Schema: https://vibrantapp.com/sdp", - "SEP-10 Client Domain: api.vibrantapp.com", + "SEP-10 Client Domain: vibrantapp.com", } logs := buf.String() @@ -101,7 +101,7 @@ func Test_SetupWalletsForProperNetwork(t *testing.T) { Name: "Vibrant Assist", Homepage: "https://vibrantapp.com/vibrant-assist", DeepLinkSchema: "https://aidpubnet.netlify.app", - SEP10ClientDomain: "api.vibrantapp.com", + SEP10ClientDomain: "vibrantapp.com", }, { Name: "BOSS Money", @@ -130,7 +130,7 @@ func Test_SetupWalletsForProperNetwork(t *testing.T) { assert.Equal(t, "Vibrant Assist", wallets[1].Name) assert.Equal(t, "https://vibrantapp.com/vibrant-assist", wallets[1].Homepage) - assert.Equal(t, "api.vibrantapp.com", wallets[1].SEP10ClientDomain) + assert.Equal(t, "vibrantapp.com", wallets[1].SEP10ClientDomain) assert.Equal(t, "https://aidpubnet.netlify.app", wallets[1].DeepLinkSchema) expectedLogs := []string{ @@ -142,7 +142,7 @@ func Test_SetupWalletsForProperNetwork(t *testing.T) { "Name: Vibrant Assist", "Homepage: https://vibrantapp.com/vibrant-assist", "Deep Link Schema: https://aidpubnet.netlify.app", - "SEP-10 Client Domain: api.vibrantapp.com", + "SEP-10 Client Domain: vibrantapp.com", } logs := buf.String() @@ -164,7 +164,7 @@ func Test_SetupWalletsForProperNetwork(t *testing.T) { Name: "Vibrant Assist", Homepage: "https://vibrantapp.com/vibrant-assist", DeepLinkSchema: "https://aidpubnet.netlify.app", - SEP10ClientDomain: "api.vibrantapp.com", + SEP10ClientDomain: "vibrantapp.com", Assets: []data.Asset{ { Code: "USDC", @@ -253,7 +253,7 @@ func Test_SetupWalletsForProperNetwork(t *testing.T) { "Name: Vibrant Assist", "Homepage: https://vibrantapp.com/vibrant-assist", "Deep Link Schema: https://aidpubnet.netlify.app", - "SEP-10 Client Domain: api.vibrantapp.com", + "SEP-10 Client Domain: vibrantapp.com", "Assets:", "* USDC - GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5", } diff --git a/internal/services/wallets/wallets_pubnet.go b/internal/services/wallets/wallets_pubnet.go index 772c8b6e8..22e31c28f 100644 --- a/internal/services/wallets/wallets_pubnet.go +++ b/internal/services/wallets/wallets_pubnet.go @@ -10,7 +10,7 @@ var PubnetWallets = []data.Wallet{ Name: "Vibrant Assist", Homepage: "https://vibrantapp.com/vibrant-assist", DeepLinkSchema: "https://vibrantapp.com/sdp", - SEP10ClientDomain: "api.vibrantapp.com", + SEP10ClientDomain: "vibrantapp.com", Assets: []data.Asset{ assets.USDCAssetPubnet, }, diff --git a/internal/transactionsubmission/utils/errors.go b/internal/transactionsubmission/utils/errors.go index 1a85d29c2..68a14fa21 100644 --- a/internal/transactionsubmission/utils/errors.go +++ b/internal/transactionsubmission/utils/errors.go @@ -67,7 +67,7 @@ func NewHorizonErrorWrapper(err error) *HorizonErrorWrapper { resultCodes, resCodeErr := hError.ResultCodes() if resCodeErr != nil { - log.Errorf("parsing result_codes: %v", resCodeErr) + log.Warnf("parsing result_codes: %v", resCodeErr) } return &HorizonErrorWrapper{ diff --git a/main.go b/main.go index 4521fd22e..32771ad60 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,7 @@ import ( // Version is the official version of this application. Whenever it's changed // here, it also needs to be updated at the `helmchart/Chart.yaml#appVersionā€œ. -const Version = "1.0.0" +const Version = "1.0.1" // GitCommit is populated at build time by // go build -ldflags "-X main.GitCommit=$GIT_COMMIT"