generated from PenaSide/GolangTemplate
Merge branch 'staging'
This commit is contained in:
commit
c141d50f5a
@ -5,10 +5,13 @@ include:
|
|||||||
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
||||||
- project: "devops/pena-continuous-integration"
|
- project: "devops/pena-continuous-integration"
|
||||||
file: "/templates/docker/golint.gitlab-ci.yml"
|
file: "/templates/docker/golint.gitlab-ci.yml"
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/service-discovery.gitlab-ci.yml"
|
||||||
stages:
|
stages:
|
||||||
- lint
|
- lint
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
- service-discovery
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
extends: .golint_template
|
extends: .golint_template
|
||||||
@ -26,6 +29,8 @@ deploy-to-prod:
|
|||||||
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH"
|
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH"
|
||||||
tags:
|
tags:
|
||||||
- prod
|
- prod
|
||||||
after_script:
|
|
||||||
- ls
|
|
||||||
extends: .deploy_template
|
extends: .deploy_template
|
||||||
|
|
||||||
|
service-discovery:
|
||||||
|
extends: .sd_artefacts_template
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ INTERNAL:
|
|||||||
|
|
||||||
- Добавлено версионирование модели данных. На данный момент модель под версией 1
|
- Добавлено версионирование модели данных. На данный момент модель под версией 1
|
||||||
|
|
||||||
|
|
||||||
FIX:
|
FIX:
|
||||||
|
|
||||||
- При пустой корзине во время оплаты(/cart/pay) больше не будет возвращаться 500, а будет возвращаться 406
|
- При пустой корзине во время оплаты(/cart/pay) больше не будет возвращаться 500, а будет возвращаться 406
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# BUILD
|
# BUILD
|
||||||
FROM golang:1.22.0-alpine AS build
|
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang:main.3862 AS build
|
||||||
|
|
||||||
# Update packages and clear cache
|
# Update packages and clear cache
|
||||||
RUN apk add --no-cache curl
|
RUN apk add --no-cache curl
|
||||||
@ -21,7 +21,7 @@ RUN go mod download
|
|||||||
RUN GOOS=linux go build -o bin ./...
|
RUN GOOS=linux go build -o bin ./...
|
||||||
|
|
||||||
# PRODUCTION
|
# PRODUCTION
|
||||||
FROM alpine:3.18.3 AS production
|
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine:main.3862 AS production
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates
|
||||||
|
@ -2,10 +2,12 @@ version: "3.3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
customer-app-stagingv1.0.1:
|
customer-app-stagingv1.0.1:
|
||||||
hostname: customer-service-stagingv1.0.1
|
hostname: customerv1.0.1
|
||||||
container_name: customer-service-stagingv1.0.1
|
container_name: customerv1.0.1
|
||||||
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||||
tty: true
|
tty: true
|
||||||
|
labels:
|
||||||
|
com.pena.allowed_headers: content-type,authorization,response-type
|
||||||
environment:
|
environment:
|
||||||
- CLIENT_HTTP_HOST=0.0.0.0
|
- CLIENT_HTTP_HOST=0.0.0.0
|
||||||
- CLIENT_HTTP_PORT=8065
|
- CLIENT_HTTP_PORT=8065
|
||||||
@ -16,7 +18,7 @@ services:
|
|||||||
- GRPC_PORT=9065
|
- GRPC_PORT=9065
|
||||||
- GRPC_DOMEN=10.8.0.6:9060
|
- GRPC_DOMEN=10.8.0.6:9060
|
||||||
|
|
||||||
- MONGO_HOST=10.8.0.6
|
- MONGO_HOST=10.7.0.4
|
||||||
- MONGO_PORT=27017
|
- MONGO_PORT=27017
|
||||||
- MONGO_USER=$MONGO_USER
|
- MONGO_USER=$MONGO_USER
|
||||||
- MONGO_PASSWORD=$MONGO_PASSWORD
|
- MONGO_PASSWORD=$MONGO_PASSWORD
|
||||||
@ -31,7 +33,7 @@ services:
|
|||||||
- CURRENCY_MICROSERVICE_TRANSLATE_URL=http://10.8.0.6:3131/change
|
- CURRENCY_MICROSERVICE_TRANSLATE_URL=http://10.8.0.6:3131/change
|
||||||
- DISCOUNT_MICROSERVICE_GRPC_HOST=10.8.0.6:9001
|
- DISCOUNT_MICROSERVICE_GRPC_HOST=10.8.0.6:9001
|
||||||
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.6:9085
|
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.6:9085
|
||||||
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.6:7035/verification
|
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.6:7036/verification
|
||||||
- TEMPLATEGEN_MICROSERVICE_URL=http://10.6.0.17/generator/service
|
- TEMPLATEGEN_MICROSERVICE_URL=http://10.6.0.17/generator/service
|
||||||
- API_URL=https://api.smtp.bz/v1/smtp/send
|
- API_URL=https://api.smtp.bz/v1/smtp/send
|
||||||
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.6:59665
|
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.6:59665
|
||||||
|
@ -2,9 +2,9 @@ package wallet_client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"fmt"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
||||||
@ -395,18 +395,12 @@ func (receiver *WalletController) PostWalletRspay(ctx *fiber.Ctx) error {
|
|||||||
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not allowed for non organizations")
|
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not allowed for non organizations")
|
||||||
}
|
}
|
||||||
token := ctx.Get("Authorization")
|
token := ctx.Get("Authorization")
|
||||||
fmt.Println("HEADERS", ctx.Request().Header)
|
|
||||||
|
|
||||||
verification, err := receiver.verifyClient.GetVerification(ctx.Context(), token, userID)
|
verification, err := receiver.verifyClient.GetVerification(ctx.Context(), token, userID)
|
||||||
if err == errors.ErrNotFound {
|
if err == errors.ErrNotFound {
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "no verification data found")
|
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "no verification data found")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Status == models.AccountStatusOrg && len(verification.Files) != 3) ||
|
|
||||||
(user.Status == models.AccountStatusNko && len(verification.Files) != 4) {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not enough verification files")
|
|
||||||
}
|
|
||||||
|
|
||||||
authData, err := receiver.authClient.GetUser(ctx.Context(), userID)
|
authData, err := receiver.authClient.GetUser(ctx.Context(), userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user