This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: {{ .Release.Name }} | |
| namespace: {{ .Release.Namespace }} | |
| annotations: | |
| iam.gke.io/gcp-service-account: argocd-backup@<GCP-PROJECT_KEY>.iam.gserviceaccount.com | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRole |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": 17, | |
| "totalPrice": { | |
| "type": "centPrecision", | |
| "fractionDigits": 2, | |
| "currencyCode": "USD", | |
| "centAmount": 4930000 | |
| }, | |
| "taxedPrice": { | |
| "totalNet": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func calcTotalDiscount(currentCart *commercetools.Cart, response *cart_service.CartPriceSummeryResponse) { | |
| if len(currentCart.DiscountCodes) != 0 { | |
| for _, lineItem := range currentCart.LineItems { | |
| for _, discountedPrice := range lineItem.DiscountedPricePerQuantity { | |
| response.TotalDiscount += centAmount(discountedPrice.DiscountedPrice.Value) * int32(discountedPrice.Quantity) | |
| } | |
| } | |
| for _,code := range currentCart.DiscountCodes { | |
| if code.State == commercetools.DiscountCodeStateMatchesCart { | |
| for _, cartDiscount := range code.DiscountCode.Obj.CartDiscounts { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": 18, | |
| "totalPrice": { | |
| "type": "centPrecision", | |
| "fractionDigits": 2, | |
| "currencyCode": "USD", | |
| "centAmount": 77600 | |
| }, | |
| "taxRoundingMode": "HalfEven", | |
| "taxMode": "External", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package reverse_proxy | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "github.com/viggin/svc-api-gateway/internal/models" | |
| "github.com/gin-gonic/gin" | |
| "github.com/google/uuid" | |
| "github.com/palantir/stacktrace" | |
| "github.com/sirupsen/logrus" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh -o StrictHostKeyChecking=no -t -t \ | |
| -i ./github_id_rsa "${SHH_USER}@${BASTION_IP}" \ | |
| -L "3306:${MYSQL_IP}:3306" & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "google_service_account" "bastion" { | |
| project = var.project | |
| account_id = "bastion" | |
| display_name = "ssh bastion" | |
| } | |
| locals { | |
| bastion = "bastion" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo -n "${PRIVATE_KEY}" | base64 --decode > github_id_rsa | |
| sudo chmod 600 github_id_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: clean ssh key | |
| if: always() | |
| run: rm -rf github_id_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (this *usersService) IsMagicLinkVerified(ctx context.Context, in *users.IsMagicLinkVerifiedRequest) (*users.IsMagicLinkVerifiedResponse, error) { | |
| c, _ := context.WithDeadline(ctx, time.Now().Add(25*time.Second)) | |
| ticker := ImmediateTicker(c, time.Second) | |
| for { | |
| select { | |
| case <-c.Done(): | |
| return &users.IsMagicLinkVerifiedResponse{Status: users.MagicLinkStatus_unknown}, nil | |
| case <-ticker: | |
| status, token := this.tokensRepo.IsMagicLinkVerified(in.SessionId) | |
| if status != users.MagicLinkStatus_unknown { |