Documentation ¶
Index ¶
- Constants
- type AssetRequest
- type AssetsHandler
- type CountriesHandler
- type CreateUserRequest
- type DeletePhoneNumberHandler
- type DisbursementHandler
- func (d DisbursementHandler) GetDisbursement(w http.ResponseWriter, r *http.Request)
- func (d DisbursementHandler) GetDisbursementInstructions(w http.ResponseWriter, r *http.Request)
- func (d DisbursementHandler) GetDisbursementReceivers(w http.ResponseWriter, r *http.Request)
- func (d DisbursementHandler) GetDisbursements(w http.ResponseWriter, r *http.Request)
- func (d DisbursementHandler) PatchDisbursementStatus(w http.ResponseWriter, r *http.Request)
- func (d DisbursementHandler) PostDisbursement(w http.ResponseWriter, r *http.Request)
- func (d DisbursementHandler) PostDisbursementInstructions(w http.ResponseWriter, r *http.Request)
- type ErrorInformationNotFound
- type ErrorVerificationAttemptsExceeded
- type ForgotPasswordHandler
- type ForgotPasswordRequest
- type ForgotPasswordResponseBody
- type GetProfileResponse
- type GetReceiverResponse
- type HealthHandler
- type HealthResponse
- type ListRolesHandler
- type LoginHandler
- type LoginRequest
- type LoginResponse
- type MFAHandler
- type MFARequest
- type MFAResponse
- type PatchDisbursementStatusRequest
- type PatchOrganizationProfileRequest
- type PatchPaymentStatusRequest
- type PatchUserPasswordRequest
- type PatchUserProfileRequest
- type PaymentsHandler
- func (p PaymentsHandler) GetPayment(w http.ResponseWriter, r *http.Request)
- func (p PaymentsHandler) GetPayments(w http.ResponseWriter, r *http.Request)
- func (p PaymentsHandler) PatchPaymentStatus(w http.ResponseWriter, r *http.Request)
- func (p PaymentsHandler) RetryPayments(rw http.ResponseWriter, req *http.Request)
- type PostDisbursementRequest
- type ProfileHandler
- func (h ProfileHandler) GetOrganizationInfo(rw http.ResponseWriter, req *http.Request)
- func (h ProfileHandler) GetOrganizationLogo(rw http.ResponseWriter, req *http.Request)
- func (h ProfileHandler) GetProfile(rw http.ResponseWriter, req *http.Request)
- func (h ProfileHandler) PatchOrganizationProfile(rw http.ResponseWriter, req *http.Request)
- func (h ProfileHandler) PatchUserPassword(rw http.ResponseWriter, req *http.Request)
- func (h ProfileHandler) PatchUserProfile(rw http.ResponseWriter, req *http.Request)
- type ReceiverHandler
- type ReceiverRegistrationData
- type ReceiverRegistrationHandler
- type ReceiverSendOTPData
- type ReceiverSendOTPHandler
- type ReceiverSendOTPRequest
- type ReceiverSendOTPResponseBody
- type ReceiverWalletsHandler
- type RefreshTokenHandler
- type ResetPasswordHandler
- type ResetPasswordRequest
- type RetryInvitationSMSResponse
- type RetryPaymentsRequest
- type StatisticsHandler
- type Status
- type StellarTomlHandler
- type UpdateDisbursementStatusResponseBody
- type UpdatePaymentStatusResponseBody
- type UpdateReceiverHandler
- type UpdateRolesRequest
- type UserActivationRequest
- type UserHandler
- func (h UserHandler) CreateUser(rw http.ResponseWriter, req *http.Request)
- func (h UserHandler) GetAllUsers(rw http.ResponseWriter, req *http.Request)
- func (h UserHandler) UpdateUserRoles(rw http.ResponseWriter, req *http.Request)
- func (h UserHandler) UserActivation(rw http.ResponseWriter, req *http.Request)
- type UserSorterByEmail
- type UserSorterByIsActive
- type VerifyReceiverRegistrationHandler
- type WalletsHandler
- func (c WalletsHandler) DeleteWallet(rw http.ResponseWriter, req *http.Request)
- func (h WalletsHandler) GetWallets(w http.ResponseWriter, r *http.Request)
- func (h WalletsHandler) PatchWallets(rw http.ResponseWriter, req *http.Request)
- func (h WalletsHandler) PostWallets(rw http.ResponseWriter, req *http.Request)
Constants ¶
const DefaultMaxMemoryAllocation = 2 * 1024 * 1024
DefaultMaxMemoryAllocation limits the max of memory allocation up to 2MB when parsing the multipart form data request
const DeviceIDHeader = "Device-ID"
const (
InformationNotFoundOnServer = "the information you provided could not be found"
)
const OTPMessageDisclaimer = " If you did not request this code, please ignore. Do not share your code with anyone."
OTPMessageDisclaimer contains disclaimer text that needs to be added as part of the OTP message to remind the receiver how sensitive the data is.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetRequest ¶
type AssetsHandler ¶
type AssetsHandler struct { Models *data.Models engine.SubmitterEngine GetPreconditionsFn func() txnbuild.Preconditions }
func (AssetsHandler) CreateAsset ¶
func (c AssetsHandler) CreateAsset(w http.ResponseWriter, r *http.Request)
CreateAsset adds a new asset.
func (AssetsHandler) DeleteAsset ¶
func (c AssetsHandler) DeleteAsset(w http.ResponseWriter, r *http.Request)
DeleteAsset marks an asset for soft delete.
func (AssetsHandler) GetAssets ¶
func (c AssetsHandler) GetAssets(w http.ResponseWriter, r *http.Request)
GetAssets returns a list of assets.
type CountriesHandler ¶
func (CountriesHandler) GetCountries ¶
func (c CountriesHandler) GetCountries(w http.ResponseWriter, r *http.Request)
GetCountries returns a list of countries
type CreateUserRequest ¶
type DeletePhoneNumberHandler ¶
func (DeletePhoneNumberHandler) ServeHTTP ¶
func (d DeletePhoneNumberHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type DisbursementHandler ¶
type DisbursementHandler struct { Models *data.Models MonitorService monitor.MonitorServiceInterface AuthManager auth.AuthManager DisbursementManagementService *services.DisbursementManagementService DistributionAccountResolver signing.DistributionAccountResolver }
func (DisbursementHandler) GetDisbursement ¶
func (d DisbursementHandler) GetDisbursement(w http.ResponseWriter, r *http.Request)
func (DisbursementHandler) GetDisbursementInstructions ¶
func (d DisbursementHandler) GetDisbursementInstructions(w http.ResponseWriter, r *http.Request)
func (DisbursementHandler) GetDisbursementReceivers ¶
func (d DisbursementHandler) GetDisbursementReceivers(w http.ResponseWriter, r *http.Request)
func (DisbursementHandler) GetDisbursements ¶
func (d DisbursementHandler) GetDisbursements(w http.ResponseWriter, r *http.Request)
GetDisbursements returns a paginated list of disbursements
func (DisbursementHandler) PatchDisbursementStatus ¶
func (d DisbursementHandler) PatchDisbursementStatus(w http.ResponseWriter, r *http.Request)
PatchDisbursementStatus updates the status of a disbursement
func (DisbursementHandler) PostDisbursement ¶
func (d DisbursementHandler) PostDisbursement(w http.ResponseWriter, r *http.Request)
func (DisbursementHandler) PostDisbursementInstructions ¶
func (d DisbursementHandler) PostDisbursementInstructions(w http.ResponseWriter, r *http.Request)
type ErrorInformationNotFound ¶
type ErrorInformationNotFound struct {
// contains filtered or unexported fields
}
ErrorInformationNotFound implements the error interface.
func (*ErrorInformationNotFound) Error ¶
func (e *ErrorInformationNotFound) Error() string
type ErrorVerificationAttemptsExceeded ¶
type ErrorVerificationAttemptsExceeded struct {
// contains filtered or unexported fields
}
func (*ErrorVerificationAttemptsExceeded) Error ¶
func (e *ErrorVerificationAttemptsExceeded) Error() string
type ForgotPasswordHandler ¶
type ForgotPasswordHandler struct { AuthManager auth.AuthManager MessengerClient message.MessengerClient Models *data.Models ReCAPTCHAValidator validators.ReCAPTCHAValidator ReCAPTCHADisabled bool }
ForgotPasswordHandler searches for the user that is requesting a password reset and sends an email with a link to access the password reset page.
func (ForgotPasswordHandler) ServeHTTP ¶
func (h ForgotPasswordHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface.
type ForgotPasswordRequest ¶
type ForgotPasswordResponseBody ¶
type ForgotPasswordResponseBody struct {
Message string `json:"message"`
}
type GetProfileResponse ¶
type GetReceiverResponse ¶
type GetReceiverResponse struct { data.Receiver Wallets []data.ReceiverWallet `json:"wallets"` Verifications []data.ReceiverVerification `json:"verifications,omitempty"` }
type HealthHandler ¶
HealthHandler implements a simple handler that returns the health response.
func (HealthHandler) ServeHTTP ¶
func (h HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface.
type HealthResponse ¶
type HealthResponse struct { Status Status `json:"status"` Version string `json:"version,omitempty"` ServiceID string `json:"service_id,omitempty"` ReleaseID string `json:"release_id,omitempty"` }
HealthResponse follows the health check response format for HTTP APIs, based on the format defined in the draft IETF network working group standard, Health Check Response Format for HTTP APIs.
https://datatracker.ietf.org/doc/html/draft-inadarei-api-health-check-06#name-api-health-response
type ListRolesHandler ¶
type ListRolesHandler struct{}
func (ListRolesHandler) GetRoles ¶
func (h ListRolesHandler) GetRoles(rw http.ResponseWriter, req *http.Request)
GetRoles retrieves all the users roles available
type LoginHandler ¶
type LoginHandler struct { AuthManager auth.AuthManager ReCAPTCHAValidator validators.ReCAPTCHAValidator MessengerClient message.MessengerClient Models *data.Models ReCAPTCHADisabled bool MFADisabled bool }
func (LoginHandler) ServeHTTP ¶
func (h LoginHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
type MFAHandler ¶
type MFAHandler struct { AuthManager auth.AuthManager ReCAPTCHAValidator validators.ReCAPTCHAValidator Models *data.Models ReCAPTCHADisabled bool }
func (MFAHandler) ServeHTTP ¶
func (h MFAHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type MFARequest ¶
type MFAResponse ¶
type MFAResponse struct {
Token string `json:"token"`
}
type PatchDisbursementStatusRequest ¶
type PatchDisbursementStatusRequest struct {
Status string `json:"status"`
}
type PatchOrganizationProfileRequest ¶
type PatchOrganizationProfileRequest struct { OrganizationName string `json:"organization_name"` TimezoneUTCOffset string `json:"timezone_utc_offset"` IsApprovalRequired *bool `json:"is_approval_required"` SMSResendInterval *int64 `json:"sms_resend_interval"` PaymentCancellationPeriodDays *int64 `json:"payment_cancellation_period_days"` SMSRegistrationMessageTemplate *string `json:"sms_registration_message_template"` OTPMessageTemplate *string `json:"otp_message_template"` PrivacyPolicyLink *string `json:"privacy_policy_link"` }
func (*PatchOrganizationProfileRequest) AreAllFieldsEmpty ¶
func (r *PatchOrganizationProfileRequest) AreAllFieldsEmpty() bool
type PatchPaymentStatusRequest ¶
type PatchPaymentStatusRequest struct {
Status string `json:"status"`
}
type PatchUserProfileRequest ¶
type PaymentsHandler ¶
type PaymentsHandler struct { Models *data.Models DBConnectionPool db.DBConnectionPool AuthManager auth.AuthManager EventProducer events.Producer }
func (PaymentsHandler) GetPayment ¶
func (p PaymentsHandler) GetPayment(w http.ResponseWriter, r *http.Request)
func (PaymentsHandler) GetPayments ¶
func (p PaymentsHandler) GetPayments(w http.ResponseWriter, r *http.Request)
func (PaymentsHandler) PatchPaymentStatus ¶
func (p PaymentsHandler) PatchPaymentStatus(w http.ResponseWriter, r *http.Request)
func (PaymentsHandler) RetryPayments ¶
func (p PaymentsHandler) RetryPayments(rw http.ResponseWriter, req *http.Request)
type PostDisbursementRequest ¶
type PostDisbursementRequest struct { Name string `json:"name"` CountryCode string `json:"country_code"` WalletID string `json:"wallet_id"` AssetID string `json:"asset_id"` VerificationField data.VerificationField `json:"verification_field"` SMSRegistrationMessageTemplate string `json:"sms_registration_message_template"` }
type ProfileHandler ¶
type ProfileHandler struct { Models *data.Models AuthManager auth.AuthManager MaxMemoryAllocation int64 BaseURL string PublicFilesFS fs.FS DistributionAccountResolver signing.DistributionAccountResolver PasswordValidator *authUtils.PasswordValidator }
func (ProfileHandler) GetOrganizationInfo ¶
func (h ProfileHandler) GetOrganizationInfo(rw http.ResponseWriter, req *http.Request)
func (ProfileHandler) GetOrganizationLogo ¶
func (h ProfileHandler) GetOrganizationLogo(rw http.ResponseWriter, req *http.Request)
GetOrganizationLogo renders the stored organization logo. The image is rendered inline (not attached - the attached option downloads the content) so the client can embed the image.
func (ProfileHandler) GetProfile ¶
func (h ProfileHandler) GetProfile(rw http.ResponseWriter, req *http.Request)
func (ProfileHandler) PatchOrganizationProfile ¶
func (h ProfileHandler) PatchOrganizationProfile(rw http.ResponseWriter, req *http.Request)
func (ProfileHandler) PatchUserPassword ¶
func (h ProfileHandler) PatchUserPassword(rw http.ResponseWriter, req *http.Request)
func (ProfileHandler) PatchUserProfile ¶
func (h ProfileHandler) PatchUserProfile(rw http.ResponseWriter, req *http.Request)
type ReceiverHandler ¶
type ReceiverHandler struct { Models *data.Models DBConnectionPool db.DBConnectionPool }
func (ReceiverHandler) GetReceiver ¶
func (rh ReceiverHandler) GetReceiver(w http.ResponseWriter, r *http.Request)
func (ReceiverHandler) GetReceiverVerificationTypes ¶
func (rh ReceiverHandler) GetReceiverVerificationTypes(w http.ResponseWriter, r *http.Request)
GetReceiverVerification returns a list of verification types
func (ReceiverHandler) GetReceivers ¶
func (rh ReceiverHandler) GetReceivers(w http.ResponseWriter, r *http.Request)
type ReceiverRegistrationHandler ¶
type ReceiverRegistrationHandler struct { Models *data.Models ReceiverWalletModel *data.ReceiverWalletModel ReCAPTCHASiteKey string }
func (ReceiverRegistrationHandler) ServeHTTP ¶
func (h ReceiverRegistrationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP will serve the SEP-24 deposit page needed to register users.
type ReceiverSendOTPData ¶
type ReceiverSendOTPHandler ¶
type ReceiverSendOTPHandler struct { Models *data.Models SMSMessengerClient message.MessengerClient ReCAPTCHAValidator validators.ReCAPTCHAValidator }
func (ReceiverSendOTPHandler) ServeHTTP ¶
func (h ReceiverSendOTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ReceiverSendOTPRequest ¶
type ReceiverSendOTPResponseBody ¶
type ReceiverSendOTPResponseBody struct { Message string `json:"message"` VerificationField data.VerificationField `json:"verification_field"` }
type ReceiverWalletsHandler ¶
func (ReceiverWalletsHandler) RetryInvitation ¶
func (h ReceiverWalletsHandler) RetryInvitation(rw http.ResponseWriter, req *http.Request)
type RefreshTokenHandler ¶
type RefreshTokenHandler struct {
AuthManager auth.AuthManager
}
func (RefreshTokenHandler) PostRefreshToken ¶
func (h RefreshTokenHandler) PostRefreshToken(rw http.ResponseWriter, req *http.Request)
type ResetPasswordHandler ¶
type ResetPasswordHandler struct { AuthManager auth.AuthManager PasswordValidator *authUtils.PasswordValidator }
ResetPasswordHandler resets the user password by receiving a valid reset token and the new password.
func (ResetPasswordHandler) ServeHTTP ¶
func (h ResetPasswordHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface.
type ResetPasswordRequest ¶
type RetryPaymentsRequest ¶
type RetryPaymentsRequest struct {
PaymentIDs []string `json:"payment_ids"`
}
type StatisticsHandler ¶
type StatisticsHandler struct {
DBConnectionPool db.DBConnectionPool
}
func (StatisticsHandler) GetStatistics ¶
func (s StatisticsHandler) GetStatistics(w http.ResponseWriter, r *http.Request)
func (StatisticsHandler) GetStatisticsByDisbursement ¶
func (s StatisticsHandler) GetStatisticsByDisbursement(w http.ResponseWriter, r *http.Request)
type StellarTomlHandler ¶
type StellarTomlHandler struct { AnchorPlatformBaseSepURL string DistributionAccountResolver signing.DistributionAccountResolver NetworkPassphrase string Models *data.Models Sep10SigningPublicKey string InstanceName string }
func (StellarTomlHandler) ServeHTTP ¶
func (s StellarTomlHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP will serve the stellar.toml file needed to register users through SEP-24.
type UpdateDisbursementStatusResponseBody ¶
type UpdateDisbursementStatusResponseBody struct {
Message string `json:"message"`
}
type UpdatePaymentStatusResponseBody ¶
type UpdatePaymentStatusResponseBody struct {
Message string `json:"message"`
}
type UpdateReceiverHandler ¶
type UpdateReceiverHandler struct { Models *data.Models DBConnectionPool db.DBConnectionPool }
func (UpdateReceiverHandler) UpdateReceiver ¶
func (h UpdateReceiverHandler) UpdateReceiver(rw http.ResponseWriter, req *http.Request)
type UpdateRolesRequest ¶
type UserActivationRequest ¶
type UserHandler ¶
type UserHandler struct { AuthManager auth.AuthManager MessengerClient message.MessengerClient Models *data.Models }
func (UserHandler) CreateUser ¶
func (h UserHandler) CreateUser(rw http.ResponseWriter, req *http.Request)
func (UserHandler) GetAllUsers ¶
func (h UserHandler) GetAllUsers(rw http.ResponseWriter, req *http.Request)
func (UserHandler) UpdateUserRoles ¶
func (h UserHandler) UpdateUserRoles(rw http.ResponseWriter, req *http.Request)
func (UserHandler) UserActivation ¶
func (h UserHandler) UserActivation(rw http.ResponseWriter, req *http.Request)
type UserSorterByEmail ¶
func (UserSorterByEmail) Len ¶
func (a UserSorterByEmail) Len() int
func (UserSorterByEmail) Less ¶
func (a UserSorterByEmail) Less(i, j int) bool
func (UserSorterByEmail) Swap ¶
func (a UserSorterByEmail) Swap(i, j int)
type UserSorterByIsActive ¶
func (UserSorterByIsActive) Len ¶
func (a UserSorterByIsActive) Len() int
func (UserSorterByIsActive) Less ¶
func (a UserSorterByIsActive) Less(i, j int) bool
func (UserSorterByIsActive) Swap ¶
func (a UserSorterByIsActive) Swap(i, j int)
type VerifyReceiverRegistrationHandler ¶
type VerifyReceiverRegistrationHandler struct { AnchorPlatformAPIService anchorplatform.AnchorPlatformAPIServiceInterface Models *data.Models ReCAPTCHAValidator validators.ReCAPTCHAValidator NetworkPassphrase string EventProducer events.Producer }
func (VerifyReceiverRegistrationHandler) VerifyReceiverRegistration ¶
func (v VerifyReceiverRegistrationHandler) VerifyReceiverRegistration(w http.ResponseWriter, r *http.Request)
VerifyReceiverRegistration is the handler for the SEP-24 `POST /wallet-registration/verification` endpoint. It is where the SDP verifies the receiver's PII & OTP, update the receiver wallet with the Stellar account and memo, found in the JWT token, and PATCH the transaction on the AnchorPlatform.
type WalletsHandler ¶
func (WalletsHandler) DeleteWallet ¶
func (c WalletsHandler) DeleteWallet(rw http.ResponseWriter, req *http.Request)
func (WalletsHandler) GetWallets ¶
func (h WalletsHandler) GetWallets(w http.ResponseWriter, r *http.Request)
GetWallets returns a list of wallets
func (WalletsHandler) PatchWallets ¶
func (h WalletsHandler) PatchWallets(rw http.ResponseWriter, req *http.Request)
func (WalletsHandler) PostWallets ¶
func (h WalletsHandler) PostWallets(rw http.ResponseWriter, req *http.Request)
Source Files ¶
- assets_handler.go
- countries_handler.go
- delete_phone_number_handler.go
- disbursement_handler.go
- forgot_password_handler.go
- health_handler.go
- list_roles_handler.go
- login_handler.go
- mfa_handler.go
- payments_handler.go
- profile_handler.go
- receiver_handler.go
- receiver_registration.go
- receiver_send_otp_handler.go
- receiver_wallets_handler.go
- refresh_token_handler.go
- reset_password_handler.go
- statistics_handler.go
- stellar_toml_handler.go
- update_receiver_handler.go
- user_handler.go
- verifiy_receiver_registration_handler.go
- wallets_handler.go