[MM-28694] Add MM User information in the CWS request headers (#15824)

* Include user data in the cloud endpoints

Those headers will include the user ID and Email so we can use them
in CWS

* Removed AppError from enterprise/cloud

We're removing the AppError from all the places that don't belong
to the app or api4 packages.

* Remove unused i18n strings

* Move it to the server init of enterprise

Also moved the initialization of the enterprise part in the server after the store is initialized

* Initialize after the store is set in NewServer

The ideal way to do it should be to move the initEnterprise call after
the store is set but that would lead to undesired side-effects so we
initialize the cloud part alone.

Signed-off-by: Mario de Frutos <mario@defrutos.org>
Этот коммит содержится в:
Mario de Frutos Dieguez
2021-03-05 09:23:39 +01:00
коммит произвёл GitHub
родитель 633d82f0ac
Коммит 5203fc8608
8 изменённых файлов: 190 добавлений и 166 удалений

Просмотреть файл

@@ -8,16 +8,16 @@ import (
)
type CloudInterface interface {
GetCloudProducts() ([]*model.Product, *model.AppError)
GetCloudProducts(userID string) ([]*model.Product, error)
CreateCustomerPayment() (*model.StripeSetupIntent, *model.AppError)
ConfirmCustomerPayment(*model.ConfirmPaymentMethodRequest) *model.AppError
CreateCustomerPayment(userID string) (*model.StripeSetupIntent, error)
ConfirmCustomerPayment(userID string, confirmRequest *model.ConfirmPaymentMethodRequest) error
GetCloudCustomer() (*model.CloudCustomer, *model.AppError)
UpdateCloudCustomer(customerInfo *model.CloudCustomerInfo) (*model.CloudCustomer, *model.AppError)
UpdateCloudCustomerAddress(address *model.Address) (*model.CloudCustomer, *model.AppError)
GetCloudCustomer(userID string) (*model.CloudCustomer, error)
UpdateCloudCustomer(userID string, customerInfo *model.CloudCustomerInfo) (*model.CloudCustomer, error)
UpdateCloudCustomerAddress(userID string, address *model.Address) (*model.CloudCustomer, error)
GetSubscription() (*model.Subscription, *model.AppError)
GetInvoicesForSubscription() ([]*model.Invoice, *model.AppError)
GetInvoicePDF(invoiceID string) ([]byte, string, *model.AppError)
GetSubscription(userID string) (*model.Subscription, error)
GetInvoicesForSubscription(userID string) ([]*model.Invoice, error)
GetInvoicePDF(userID, invoiceID string) ([]byte, string, error)
}