httphandler

package
v0.0.0-...-173bebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OTPExpirationTimeMinutes    = 5
	OTPMaxAttempts              = 5
	InformationNotFoundOnServer = "The information you provided could not be found"
)
View Source
const DefaultMaxMemoryAllocation = 2 * 1024 * 1024

DefaultMaxMemoryAllocation limits the max of memory allocation up to 2MB when parsing the multipart form data request

View Source
const DeviceIDHeader = "Device-ID"
View Source
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

View Source
var (
	ErrOTPMaxAttemptsExceeded = errors.New("the number of attempts to confirm the OTP exceeded the max attempts")
	ErrOTPExpired             = errors.New("the OTP is expired, please request a new one")
	ErrOTPDoesNotMatch        = errors.New("the OTP does not match the one saved in the database")
)
View Source
var ErrUnsupportedStatusTransition = errors.New("invalid target status")

Functions

This section is empty.

Types

type APIKeyHandler

type APIKeyHandler struct {
	Models *data.Models
}

func (APIKeyHandler) CreateAPIKey

func (h APIKeyHandler) CreateAPIKey(w http.ResponseWriter, r *http.Request)

func (APIKeyHandler) DeleteApiKey

func (h APIKeyHandler) DeleteApiKey(w http.ResponseWriter, r *http.Request)

func (APIKeyHandler) GetAllApiKeys

func (h APIKeyHandler) GetAllApiKeys(w http.ResponseWriter, r *http.Request)

func (APIKeyHandler) GetApiKeyByID

func (h APIKeyHandler) GetApiKeyByID(w http.ResponseWriter, r *http.Request)

func (APIKeyHandler) UpdateKey

func (h APIKeyHandler) UpdateKey(w http.ResponseWriter, r *http.Request)

type AssetRequest

type AssetRequest struct {
	Code   string `json:"code"`
	Issuer string `json:"issuer"`
}

type AssetWithEnabledInfo

type AssetWithEnabledInfo struct {
	data.Asset
	Enabled bool     `json:"enabled"`
	Balance *float64 `json:"balance,omitempty"`
}

type AssetsHandler

type AssetsHandler struct {
	Models *data.Models
	engine.SubmitterEngine
	GetPreconditionsFn         func() txnbuild.Preconditions
	DistributionAccountService services.DistributionAccountServiceInterface
}

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 Balance

type Balance struct {
	Amount      string `json:"amount"`
	AssetCode   string `json:"asset_code"`
	AssetIssuer string `json:"asset_issuer"`
}

type BalancesHandler

type BalancesHandler struct {
	DistributionAccountResolver signing.DistributionAccountResolver
	CircleService               circle.ServiceInterface
	NetworkType                 utils.NetworkType
}

func (BalancesHandler) Get

Get returns the balances of the distribution account.

type BridgeIntegrationHandler

type BridgeIntegrationHandler struct {
	BridgeService               bridge.ServiceInterface
	AuthManager                 auth.AuthManager
	Models                      *data.Models
	DistributionAccountResolver signing.DistributionAccountResolver
}

BridgeIntegrationHandler handles Bridge integration endpoints.

func (BridgeIntegrationHandler) Get

Get handles GET /bridge-integration

func (BridgeIntegrationHandler) Patch

Patch handles PATCH /bridge-integration

type CircleConfigHandler

type CircleConfigHandler struct {
	NetworkType                 sdpUtils.NetworkType
	CircleFactory               circle.ClientFactory
	TenantManager               tenant.ManagerInterface
	Encrypter                   sdpUtils.PrivateKeyEncrypter
	EncryptionPassphrase        string
	CircleClientConfigModel     circle.ClientConfigModelInterface
	DistributionAccountResolver signing.DistributionAccountResolver
	MonitorService              monitor.MonitorServiceInterface
}

CircleConfigHandler implements a handler to configure the Circle API access.

func (CircleConfigHandler) Patch

Patch is a handler to configure the Circle API access.

type CreateAPIKeyRequest

type CreateAPIKeyRequest struct {
	Name        string                  `json:"name"`
	Permissions []data.APIKeyPermission `json:"permissions"`
	ExpiryDate  *time.Time              `json:"expiry_date,omitempty"`
	AllowedIPs  any                     `json:"allowed_ips,omitempty"` // Can be a string or array of strings
}

type CreateUserRequest

type CreateUserRequest struct {
	FirstName string          `json:"first_name"`
	LastName  string          `json:"last_name"`
	Email     string          `json:"email"`
	Roles     []data.UserRole `json:"roles"`
}

type DeleteContactInfoHandler

type DeleteContactInfoHandler struct {
	NetworkPassphrase string
	Models            *data.Models
}

func (DeleteContactInfoHandler) ServeHTTP

type DisbursementHandler

type DisbursementHandler struct {
	Models                        *data.Models
	MonitorService                monitor.MonitorServiceInterface
	AuthManager                   auth.AuthManager
	DisbursementManagementService *services.DisbursementManagementService
	DistributionAccountResolver   signing.DistributionAccountResolver
}

func (DisbursementHandler) DeleteDisbursement

func (d DisbursementHandler) DeleteDisbursement(w http.ResponseWriter, r *http.Request)

DeleteDisbursement deletes a draft or ready disbursement and its associated payments

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

type ExportHandler

type ExportHandler struct {
	Models *data.Models
}

func (ExportHandler) ExportDisbursements

func (e ExportHandler) ExportDisbursements(rw http.ResponseWriter, r *http.Request)

func (ExportHandler) ExportPayments

func (e ExportHandler) ExportPayments(rw http.ResponseWriter, r *http.Request)

func (ExportHandler) ExportReceivers

func (e ExportHandler) ExportReceivers(rw http.ResponseWriter, r *http.Request)

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) SendForgotPasswordMessage

func (h ForgotPasswordHandler) SendForgotPasswordMessage(ctx context.Context, uiBaseURL, email, resetToken string) error

func (ForgotPasswordHandler) ServeHTTP

ServeHTTP implements the http.Handler interface.

type ForgotPasswordRequest

type ForgotPasswordRequest struct {
	Email          string `json:"email"`
	ReCAPTCHAToken string `json:"recaptcha_token"`
}

type GetBalanceResponse

type GetBalanceResponse struct {
	Account  schema.TransactionAccount `json:"account"`
	Balances []Balance                 `json:"balances"`
}

type GetProfileResponse

type GetProfileResponse struct {
	ID               string   `json:"id"`
	FirstName        string   `json:"first_name"`
	LastName         string   `json:"last_name"`
	Email            string   `json:"email"`
	Roles            []string `json:"roles"`
	OrganizationName string   `json:"organization_name"`
}

type GetReceiverResponse

type GetReceiverResponse struct {
	data.Receiver
	Wallets       []data.ReceiverWallet       `json:"wallets"`
	Verifications []data.ReceiverVerification `json:"verifications,omitempty"`
}

type HealthHandler

type HealthHandler struct {
	Version          string
	ServiceID        string
	ReleaseID        string
	DBConnectionPool db.DBConnectionPool
	Producer         events.Producer
}

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"`
	Services  map[string]Status `json:"services,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 LoginRequest struct {
	Email          string `json:"email"`
	Password       string `json:"password"`
	ReCAPTCHAToken string `json:"recaptcha_token"`
}

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 MFARequest struct {
	MFACode        string `json:"mfa_code"`
	RememberMe     bool   `json:"remember_me"`
	ReCAPTCHAToken string `json:"recaptcha_token"`
}

type MFAResponse

type MFAResponse struct {
	Token string `json:"token"`
}

type OTPRegistrationType

type OTPRegistrationType string

type OrganizationLogoHandler

type OrganizationLogoHandler struct {
	PublicFilesFS fs.FS
	Models        *data.Models
}
func (h OrganizationLogoHandler) 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.

type PatchCircleConfigRequest

type PatchCircleConfigRequest struct {
	WalletID *string `json:"wallet_id"`
	APIKey   *string `json:"api_key"`
}

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"`
	IsLinkShortenerEnabled              *bool   `json:"is_link_shortener_enabled"`
	IsMemoTracingEnabled                *bool   `json:"is_memo_tracing_enabled"`
	ReceiverInvitationResendInterval    *int64  `json:"receiver_invitation_resend_interval_days"`
	PaymentCancellationPeriodDays       *int64  `json:"payment_cancellation_period_days"`
	ReceiverRegistrationMessageTemplate *string `json:"receiver_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 PatchReceiverWalletStatusRequest

type PatchReceiverWalletStatusRequest struct {
	Status string `json:"status"`
}

type PatchRequest

type PatchRequest struct {
	Status   data.BridgeIntegrationStatus `json:"status"`
	Email    string                       `json:"email,omitempty"`
	FullName string                       `json:"full_name,omitempty"`
	KYCType  bridge.KYCType               `json:"kyc_type,omitempty"`
}

PatchRequest represents the request to opt into Bridge integration

func (PatchRequest) Validate

func (r PatchRequest) Validate() error

Validate validates the opt-in request and returns an error if validation fails.

type PatchUserPasswordRequest

type PatchUserPasswordRequest struct {
	CurrentPassword string `json:"current_password"`
	NewPassword     string `json:"new_password"`
}

type PatchUserProfileRequest

type PatchUserProfileRequest struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
}

type PaymentCSV

type PaymentCSV struct {
	ID                      string
	Amount                  string
	StellarTransactionID    string
	Status                  data.PaymentStatus
	DisbursementID          string `csv:"Disbursement.ID"`
	Asset                   data.Asset
	Wallet                  data.Wallet
	ReceiverID              string                     `csv:"Receiver.ID"`
	ReceiverPhoneNumber     string                     `csv:"Receiver.PhoneNumber"`
	ReceiverEmail           string                     `csv:"Receiver.Email"`
	ReceiverExternalID      string                     `csv:"Receiver.ExternalID"`
	ReceiverWalletAddress   string                     `csv:"ReceiverWallet.Address"`
	ReceiverWalletStatus    data.ReceiversWalletStatus `csv:"ReceiverWallet.Status"`
	CreatedAt               time.Time
	UpdatedAt               time.Time
	ExternalPaymentID       string
	CircleTransferRequestID *string
}

type PaymentsHandler

type PaymentsHandler struct {
	Models                      *data.Models
	DBConnectionPool            db.DBConnectionPool
	AuthManager                 auth.AuthManager
	EventProducer               events.Producer
	CrashTrackerClient          crashtracker.CrashTrackerClient
	DistributionAccountResolver signing.DistributionAccountResolver
	DirectPaymentService        *services.DirectPaymentService
}

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) PostDirectPayment

func (p PaymentsHandler) PostDirectPayment(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"`
	WalletID                            string                       `json:"wallet_id"`
	AssetID                             string                       `json:"asset_id"`
	VerificationField                   data.VerificationType        `json:"verification_field"`
	RegistrationContactType             data.RegistrationContactType `json:"registration_contact_type"`
	ReceiverRegistrationMessageTemplate string                       `json:"receiver_registration_message_template"`
}

type ProfileHandler

type ProfileHandler struct {
	Models                      *data.Models
	AuthManager                 auth.AuthManager
	MaxMemoryAllocation         int64
	DistributionAccountResolver signing.DistributionAccountResolver
	PasswordValidator           *authUtils.PasswordValidator
	utils.NetworkType
}

func (ProfileHandler) GetOrganizationInfo

func (h ProfileHandler) GetOrganizationInfo(rw http.ResponseWriter, req *http.Request)

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) CreateReceiver

func (rh ReceiverHandler) CreateReceiver(w http.ResponseWriter, r *http.Request)

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
	ReCAPTCHADisabled   bool
	ReCAPTCHASiteKey    string
}

func (ReceiverRegistrationHandler) ServeHTTP

ServeHTTP will serve the SEP-24 deposit page needed to register users.

type ReceiverRegistrationResponse

type ReceiverRegistrationResponse struct {
	PrivacyPolicyLink    string `json:"privacy_policy_link"`
	OrganizationName     string `json:"organization_name"`
	TruncatedContactInfo string `json:"truncated_contact_info,omitempty"`
	IsRegistered         bool   `json:"is_registered"`
	IsRecaptchaDisabled  bool   `json:"is_recaptcha_disabled"`
	ReCAPTCHASiteKey     string `json:"recaptcha_site_key,omitempty"`
}

type ReceiverSendOTPData

type ReceiverSendOTPData struct {
	OTP              string
	OrganizationName string
}

type ReceiverSendOTPHandler

type ReceiverSendOTPHandler struct {
	Models             *data.Models
	MessageDispatcher  message.MessageDispatcherInterface
	ReCAPTCHAValidator validators.ReCAPTCHAValidator
	ReCAPTCHADisabled  bool
}

func (ReceiverSendOTPHandler) ServeHTTP

type ReceiverSendOTPRequest

type ReceiverSendOTPRequest struct {
	PhoneNumber    string `json:"phone_number"`
	Email          string `json:"email"`
	ReCAPTCHAToken string `json:"recaptcha_token"`
}

type ReceiverSendOTPResponseBody

type ReceiverSendOTPResponseBody struct {
	Message           string                `json:"message"`
	VerificationField data.VerificationType `json:"verification_field"`
}

type ReceiverWalletsHandler

type ReceiverWalletsHandler struct {
	Models             *data.Models
	EventProducer      events.Producer
	CrashTrackerClient crashtracker.CrashTrackerClient
}

func (ReceiverWalletsHandler) PatchReceiverWalletStatus

func (h ReceiverWalletsHandler) PatchReceiverWalletStatus(rw http.ResponseWriter, req *http.Request)

PatchReceiverWalletStatus updates a receiver wallet’s status.

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 RegistrationContactTypesHandler

type RegistrationContactTypesHandler struct{}

func (RegistrationContactTypesHandler) Get

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

ServeHTTP implements the http.Handler interface.

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Password   string `json:"password"`
	ResetToken string `json:"reset_token"`
}

type RetryInvitationMessageResponse

type RetryInvitationMessageResponse struct {
	ID               string     `json:"id"`
	ReceiverID       string     `json:"receiver_id"`
	WalletID         string     `json:"wallet_id"`
	CreatedAt        time.Time  `json:"created_at"`
	InvitationSentAt *time.Time `json:"invitation_sent_at"`
}

type RetryPaymentsRequest

type RetryPaymentsRequest struct {
	PaymentIDs []string `json:"payment_ids"`
}

type SEP24InteractiveDepositHandler

type SEP24InteractiveDepositHandler struct {
	App      fs.FS
	BasePath string
}

func (SEP24InteractiveDepositHandler) ServeApp

ServeApp services the SEP-24 interactive deposit app.

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 Status

type Status string

Status indicates whether the service is health or not.

const (
	// StatusPass indicates that the service is healthy.
	StatusPass Status = "pass"
	// StatusFail indicates that the service is unhealthy.
	StatusFail Status = "fail"
)

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 URLShortenerHandler

type URLShortenerHandler struct {
	Models *data.Models
}

func (URLShortenerHandler) HandleRedirect

func (u URLShortenerHandler) HandleRedirect(w http.ResponseWriter, r *http.Request)

type UpdateAPIKeyRequest

type UpdateAPIKeyRequest struct {
	Permissions []data.APIKeyPermission `json:"permissions"`
	AllowedIPs  any                     `json:"allowed_ips,omitempty"` // Can be a string or array of strings
}

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
	AuthManager      auth.AuthManager
}

func (UpdateReceiverHandler) UpdateReceiver

func (h UpdateReceiverHandler) UpdateReceiver(rw http.ResponseWriter, req *http.Request)

type UpdateRolesRequest

type UpdateRolesRequest struct {
	UserID string          `json:"user_id"`
	Roles  []data.UserRole `json:"roles"`
}

type UserActivationRequest

type UserActivationRequest struct {
	UserID   string `json:"user_id"`
	IsActive *bool  `json:"is_active"`
}

type UserHandler

type UserHandler struct {
	AuthManager        auth.AuthManager
	CrashTrackerClient crashtracker.CrashTrackerClient
	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

type UserSorterByEmail []auth.User

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

type UserSorterByIsActive []auth.User

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
	ReCAPTCHADisabled           bool
	NetworkPassphrase           string
	EventProducer               events.Producer
	CrashTrackerClient          crashtracker.CrashTrackerClient
	DistributionAccountResolver signing.DistributionAccountResolver
}

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

type WalletsHandler struct {
	Models              *data.Models
	NetworkType         utils.NetworkType
	WalletAssetResolver *services.WalletAssetResolver
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL