diff --git a/.env-issuer.sample b/.env-issuer.sample index 963569e9..8b99356c 100644 --- a/.env-issuer.sample +++ b/.env-issuer.sample @@ -87,3 +87,6 @@ ISSUER_PAYMENTS_SETTINGS_PATH=./payment_settings.yaml #if you want, you can specify the content of the payments configuration encoded in base64. In this case ISSUER_PAYMENTS_SETTINGS_PATH have to be empty ISSUER_PAYMENTS_SETTINGS_FILE= + +# localstack credentials (only needed if you are using localstack) +LOCALSTACK_AUTH_TOKEN= \ No newline at end of file diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 89d3a075..ad3fd3df 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,6 +14,8 @@ jobs: touch .env-ui - name: Docker Compose uses: hoverkraft-tech/compose-action@v2.0.1 + env: + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} with: compose-file: './infrastructure/local/docker-compose-infra.yml' services: | diff --git a/Dockerfile-kms-importer b/Dockerfile-kms-importer index 5e126cbc..3fad1f41 100644 --- a/Dockerfile-kms-importer +++ b/Dockerfile-kms-importer @@ -1,4 +1,4 @@ -FROM golang:1.22 AS base +FROM golang:1.24 AS base ARG VERSION ARG ISSUER_KMS_ETH_PROVIDER_AWS_ACCESS_KEY diff --git a/Makefile b/Makefile index d5adc9db..4d3d60b1 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,8 @@ REQUIRED_FILE := ${ISSUER_RESOLVER_PATH} DOTENV_CMD = $(BIN)/godotenv ENV = $(DOTENV_CMD) -f .env-issuer +export LOCALSTACK_AUTH_TOKEN + .PHONY: run-all-registry run-all-registry: @make down diff --git a/api/api.yaml b/api/api.yaml index 4a55f050..00cda297 100644 --- a/api/api.yaml +++ b/api/api.yaml @@ -1862,6 +1862,32 @@ paths: $ref: '#/components/responses/400' '500': $ref: '#/components/responses/500' + + /v2/identities/{identifier}/payment-request/nonce/{nonce}: + get: + summary: Get Payment Request By Nonce + operationId: GetPaymentRequestByNonce + description: Get a specific payment request for the provided identity by nonce. + tags: + - Payment + security: + - basicAuth: [ ] + parameters: + - $ref: '#/components/parameters/pathIdentifier' + - $ref: '#/components/parameters/pathPaymentNonce' + responses: + '200': + description: Retrieve a payment request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePaymentRequestResponse' + '400': + $ref: '#/components/responses/400' + '404': + $ref: '#/components/responses/404' + '500': + $ref: '#/components/responses/500' /v2/payment/settings: get: @@ -3526,6 +3552,13 @@ components: schema: type: string + pathPaymentNonce: + name: nonce + in: path + required: true + description: Payment nonce + schema: + type: string responses: '400': diff --git a/infrastructure/local/docker-compose-infra.yml b/infrastructure/local/docker-compose-infra.yml index ab8cdb0a..b352f175 100644 --- a/infrastructure/local/docker-compose-infra.yml +++ b/infrastructure/local/docker-compose-infra.yml @@ -84,12 +84,13 @@ services: command: ./vault/scripts/init.sh localstack: - image: localstack/localstack:latest + image: localstack/localstack:2026.3 ports: - "4566:4566" environment: - SERVICES=secretsmanager,kms - DEBUG=1 + - LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN} networks: default: diff --git a/internal/api/api.gen.go b/internal/api/api.gen.go index 56f8b27b..b9e53941 100644 --- a/internal/api/api.gen.go +++ b/internal/api/api.gen.go @@ -817,6 +817,9 @@ type PathKeyID = string // PathNonce defines model for pathNonce. type PathNonce = int64 +// PathPaymentNonce defines model for pathPaymentNonce. +type PathPaymentNonce = string + // SessionID defines model for sessionID. type SessionID = uuid.UUID @@ -1264,6 +1267,9 @@ type ServerInterface interface { // Create Payment Request // (POST /v2/identities/{identifier}/payment-request) CreatePaymentRequest(w http.ResponseWriter, r *http.Request, identifier PathIdentifier) + // Get Payment Request By Nonce + // (GET /v2/identities/{identifier}/payment-request/nonce/{nonce}) + GetPaymentRequestByNonce(w http.ResponseWriter, r *http.Request, identifier PathIdentifier, nonce PathPaymentNonce) // Delete Payment Request // (DELETE /v2/identities/{identifier}/payment-request/{id}) DeletePaymentRequest(w http.ResponseWriter, r *http.Request, identifier PathIdentifier, id Id) @@ -1588,6 +1594,12 @@ func (_ Unimplemented) CreatePaymentRequest(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNotImplemented) } +// Get Payment Request By Nonce +// (GET /v2/identities/{identifier}/payment-request/nonce/{nonce}) +func (_ Unimplemented) GetPaymentRequestByNonce(w http.ResponseWriter, r *http.Request, identifier PathIdentifier, nonce PathPaymentNonce) { + w.WriteHeader(http.StatusNotImplemented) +} + // Delete Payment Request // (DELETE /v2/identities/{identifier}/payment-request/{id}) func (_ Unimplemented) DeletePaymentRequest(w http.ResponseWriter, r *http.Request, identifier PathIdentifier, id Id) { @@ -3394,6 +3406,46 @@ func (siw *ServerInterfaceWrapper) CreatePaymentRequest(w http.ResponseWriter, r handler.ServeHTTP(w, r) } +// GetPaymentRequestByNonce operation middleware +func (siw *ServerInterfaceWrapper) GetPaymentRequestByNonce(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "identifier" ------------- + var identifier PathIdentifier + + err = runtime.BindStyledParameterWithOptions("simple", "identifier", chi.URLParam(r, "identifier"), &identifier, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "identifier", Err: err}) + return + } + + // ------------- Path parameter "nonce" ------------- + var nonce PathPaymentNonce + + err = runtime.BindStyledParameterWithOptions("simple", "nonce", chi.URLParam(r, "nonce"), &nonce, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "nonce", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + r = r.WithContext(ctx) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetPaymentRequestByNonce(w, r, identifier, nonce) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + // DeletePaymentRequest operation middleware func (siw *ServerInterfaceWrapper) DeletePaymentRequest(w http.ResponseWriter, r *http.Request) { @@ -4361,6 +4413,9 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/v2/identities/{identifier}/payment-request", wrapper.CreatePaymentRequest) }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/v2/identities/{identifier}/payment-request/nonce/{nonce}", wrapper.GetPaymentRequestByNonce) + }) r.Group(func(r chi.Router) { r.Delete(options.BaseURL+"/v2/identities/{identifier}/payment-request/{id}", wrapper.DeletePaymentRequest) }) @@ -6300,6 +6355,51 @@ func (response CreatePaymentRequest500JSONResponse) VisitCreatePaymentRequestRes return json.NewEncoder(w).Encode(response) } +type GetPaymentRequestByNonceRequestObject struct { + Identifier PathIdentifier `json:"identifier"` + Nonce PathPaymentNonce `json:"nonce"` +} + +type GetPaymentRequestByNonceResponseObject interface { + VisitGetPaymentRequestByNonceResponse(w http.ResponseWriter) error +} + +type GetPaymentRequestByNonce200JSONResponse CreatePaymentRequestResponse + +func (response GetPaymentRequestByNonce200JSONResponse) VisitGetPaymentRequestByNonceResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetPaymentRequestByNonce400JSONResponse struct{ N400JSONResponse } + +func (response GetPaymentRequestByNonce400JSONResponse) VisitGetPaymentRequestByNonceResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(400) + + return json.NewEncoder(w).Encode(response) +} + +type GetPaymentRequestByNonce404JSONResponse struct{ N404JSONResponse } + +func (response GetPaymentRequestByNonce404JSONResponse) VisitGetPaymentRequestByNonceResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type GetPaymentRequestByNonce500JSONResponse struct{ N500JSONResponse } + +func (response GetPaymentRequestByNonce500JSONResponse) VisitGetPaymentRequestByNonceResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + type DeletePaymentRequestRequestObject struct { Identifier PathIdentifier `json:"identifier"` Id Id `json:"id"` @@ -7262,6 +7362,9 @@ type StrictServerInterface interface { // Create Payment Request // (POST /v2/identities/{identifier}/payment-request) CreatePaymentRequest(ctx context.Context, request CreatePaymentRequestRequestObject) (CreatePaymentRequestResponseObject, error) + // Get Payment Request By Nonce + // (GET /v2/identities/{identifier}/payment-request/nonce/{nonce}) + GetPaymentRequestByNonce(ctx context.Context, request GetPaymentRequestByNonceRequestObject) (GetPaymentRequestByNonceResponseObject, error) // Delete Payment Request // (DELETE /v2/identities/{identifier}/payment-request/{id}) DeletePaymentRequest(ctx context.Context, request DeletePaymentRequestRequestObject) (DeletePaymentRequestResponseObject, error) @@ -8606,6 +8709,33 @@ func (sh *strictHandler) CreatePaymentRequest(w http.ResponseWriter, r *http.Req } } +// GetPaymentRequestByNonce operation middleware +func (sh *strictHandler) GetPaymentRequestByNonce(w http.ResponseWriter, r *http.Request, identifier PathIdentifier, nonce PathPaymentNonce) { + var request GetPaymentRequestByNonceRequestObject + + request.Identifier = identifier + request.Nonce = nonce + + handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) { + return sh.ssi.GetPaymentRequestByNonce(ctx, request.(GetPaymentRequestByNonceRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetPaymentRequestByNonce") + } + + response, err := handler(r.Context(), w, r, request) + + if err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } else if validResponse, ok := response.(GetPaymentRequestByNonceResponseObject); ok { + if err := validResponse.VisitGetPaymentRequestByNonceResponse(w); err != nil { + sh.options.ResponseErrorHandlerFunc(w, r, err) + } + } else if response != nil { + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) + } +} + // DeletePaymentRequest operation middleware func (sh *strictHandler) DeletePaymentRequest(w http.ResponseWriter, r *http.Request, identifier PathIdentifier, id Id) { var request DeletePaymentRequestRequestObject diff --git a/internal/api/payment.go b/internal/api/payment.go index c6f52271..fc7a0d2c 100644 --- a/internal/api/payment.go +++ b/internal/api/payment.go @@ -176,6 +176,26 @@ func (s *Server) GetPaymentRequest(ctx context.Context, request GetPaymentReques return GetPaymentRequest200JSONResponse(toCreatePaymentRequestResponse(ctx, paymentRequest)), nil } +// GetPaymentRequestByNonce is the controller to get payment request by nonce +func (s *Server) GetPaymentRequestByNonce(ctx context.Context, request GetPaymentRequestByNonceRequestObject) (GetPaymentRequestByNonceResponseObject, error) { + issuerDID, err := w3c.ParseDID(request.Identifier) + if err != nil { + log.Error(ctx, "parsing issuer did", "err", err, "did", request.Identifier) + return GetPaymentRequestByNonce400JSONResponse{N400JSONResponse{Message: "invalid issuer did"}}, nil + } + const base10 = 10 + nonce, ok := new(big.Int).SetString(request.Nonce, base10) + if !ok { + log.Error(ctx, "parsing nonce on get payment request by nonce", "nonce", request.Nonce) + return GetPaymentRequestByNonce400JSONResponse{N400JSONResponse{Message: fmt.Sprintf("invalid nonce: <%s>", request.Nonce)}}, nil + } + paymentRequest, err := s.paymentService.GetPaymentRequestByNonce(ctx, issuerDID, nonce) + if err != nil { + return GetPaymentRequestByNonce500JSONResponse{N500JSONResponse{Message: fmt.Sprintf("can't get payment-request: %s", err)}}, nil + } + return GetPaymentRequestByNonce200JSONResponse(toCreatePaymentRequestResponse(ctx, paymentRequest)), nil +} + // DeletePaymentRequest is the controller to delete payment request func (s *Server) DeletePaymentRequest(ctx context.Context, request DeletePaymentRequestRequestObject) (DeletePaymentRequestResponseObject, error) { issuerDID, err := w3c.ParseDID(request.Identifier) diff --git a/internal/core/ports/payment_service.go b/internal/core/ports/payment_service.go index 69bfd272..6b6b5b98 100644 --- a/internal/core/ports/payment_service.go +++ b/internal/core/ports/payment_service.go @@ -43,6 +43,7 @@ type PaymentService interface { CreatePaymentRequest(ctx context.Context, req *CreatePaymentRequestReq) (*domain.PaymentRequest, error) GetPaymentRequests(ctx context.Context, issuerDID *w3c.DID, queryParams *domain.PaymentRequestsQueryParams) ([]domain.PaymentRequest, error) GetPaymentRequest(ctx context.Context, issuerDID *w3c.DID, id uuid.UUID) (*domain.PaymentRequest, error) + GetPaymentRequestByNonce(ctx context.Context, issuerDID *w3c.DID, nonce *big.Int) (*domain.PaymentRequest, error) DeletePaymentRequest(ctx context.Context, issuerDID *w3c.DID, id uuid.UUID) error CreatePaymentRequestForProposalRequest(ctx context.Context, proposalRequest *protocol.CredentialsProposalRequestMessage) (*comm.BasicMessage, error) GetSettings() payments.Config diff --git a/internal/core/services/payment.go b/internal/core/services/payment.go index 7da0c845..48a4cf14 100644 --- a/internal/core/services/payment.go +++ b/internal/core/services/payment.go @@ -235,6 +235,23 @@ func (p *payment) GetPaymentRequest(ctx context.Context, issuerDID *w3c.DID, ID return paymentRequests, nil } +// GetPaymentRequestByNonce returns payment request by nonce and issuer DID +func (p *payment) GetPaymentRequestByNonce(ctx context.Context, issuerDID *w3c.DID, nonce *big.Int) (*domain.PaymentRequest, error) { + paymentReqItem, err := p.paymentsStore.GetPaymentRequestItem(ctx, *issuerDID, nonce) + if err != nil { + log.Error(ctx, "failed to get payment request item by nonce", "err", err, "issuerDID", issuerDID, "nonce", nonce) + return nil, fmt.Errorf("failed to get payment request item by nonce: %w", err) + } + + paymentReq, err := p.paymentsStore.GetPaymentRequestByID(ctx, *issuerDID, paymentReqItem.PaymentRequestID) + if err != nil { + log.Error(ctx, "failed to get payment request by ID", "err", err, "issuerDID", issuerDID, "paymentRequestID", paymentReqItem.PaymentRequestID) + return nil, fmt.Errorf("failed to get payment request by ID: %w", err) + } + + return paymentReq, nil +} + // DeletePaymentRequest deletes a payment request func (p *payment) DeletePaymentRequest(ctx context.Context, issuerDID *w3c.DID, ID uuid.UUID) error { err := p.paymentsStore.DeletePaymentRequest(ctx, *issuerDID, ID) diff --git a/internal/kms/aws_kms_eth_key_provider.go b/internal/kms/aws_kms_eth_key_provider.go index 39972e23..a9392ae1 100644 --- a/internal/kms/aws_kms_eth_key_provider.go +++ b/internal/kms/aws_kms_eth_key_provider.go @@ -57,6 +57,7 @@ func NewAwsKMSEthKeyProvider(ctx context.Context, keyType KeyType, issuerETHTran options = make([]func(*kms.Options), 1) options[0] = func(o *kms.Options) { o.BaseEndpoint = aws.String(awsKmsEthKeyProviderConfig.URL) + o.Region = "us-east-1" } } diff --git a/internal/kms/aws_secret_storage_provider.go b/internal/kms/aws_secret_storage_provider.go index 9cb6cbec..490fdd31 100644 --- a/internal/kms/aws_secret_storage_provider.go +++ b/internal/kms/aws_secret_storage_provider.go @@ -52,6 +52,7 @@ func NewAwsSecretStorageProvider(ctx context.Context, conf AwsSecretStorageProvi options = make([]func(*secretsmanager.Options), 1) options[0] = func(o *secretsmanager.Options) { o.BaseEndpoint = aws.String(conf.URL) + o.Region = "us-east-1" } } diff --git a/k8s/helm/templates/issuer-node-api-deployment.yaml b/k8s/helm/templates/issuer-node-api-deployment.yaml index dad199ac..012d405c 100644 --- a/k8s/helm/templates/issuer-node-api-deployment.yaml +++ b/k8s/helm/templates/issuer-node-api-deployment.yaml @@ -19,7 +19,6 @@ spec: annotations: rollme: {{ randAlphaNum 5 | quote }} spec: - serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.apiIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-notifications.yaml b/k8s/helm/templates/issuer-node-notifications.yaml index b1e06fd6..b088de3b 100644 --- a/k8s/helm/templates/issuer-node-notifications.yaml +++ b/k8s/helm/templates/issuer-node-notifications.yaml @@ -19,7 +19,6 @@ spec: annotations: rollme: {{ randAlphaNum 5 | quote }} spec: - serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.notificationsIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-pending-publisher.yaml b/k8s/helm/templates/issuer-node-pending-publisher.yaml index 9b59366d..504df99e 100644 --- a/k8s/helm/templates/issuer-node-pending-publisher.yaml +++ b/k8s/helm/templates/issuer-node-pending-publisher.yaml @@ -19,7 +19,6 @@ spec: annotations: rollme: {{ randAlphaNum 5 | quote }} spec: - serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.pendingPublisherIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_repository_image }}:{{ .Values.issuernode_repository_tag }} diff --git a/k8s/helm/templates/issuer-node-service-account.yaml b/k8s/helm/templates/issuer-node-service-account.yaml deleted file mode 100644 index 988c4aab..00000000 --- a/k8s/helm/templates/issuer-node-service-account.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "helpers.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "privadoid-issuer.staticLabel" . | nindent 4}} - {{- include "privadoid-issuer.labels" . | nindent 4 }} - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - namespace: {{ .Release.Namespace }} - name: {{ .Release.Name }}-pod-reader - labels: - {{- include "privadoid-issuer.staticLabel" . | nindent 4}} - {{- include "privadoid-issuer.labels" . | nindent 4 }} -rules: - - apiGroups: [""] - resources: ["pods"] - verbs: ["get", "watch", "list"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ .Release.Name }}-pod-reader-binding - namespace: {{ .Release.Namespace }} - labels: - {{- include "privadoid-issuer.staticLabel" . | nindent 4}} - {{- include "privadoid-issuer.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ .Release.Name }}-pod-reader -subjects: # points to the ServiceAccount - - kind: ServiceAccount - name: {{ include "helpers.serviceAccountName" . }} # service account to bind to - namespace: {{ .Release.Namespace }} # ns of service account \ No newline at end of file diff --git a/k8s/helm/templates/issuer-node-ui-deployment.yaml b/k8s/helm/templates/issuer-node-ui-deployment.yaml index 2c147be0..5b041068 100644 --- a/k8s/helm/templates/issuer-node-ui-deployment.yaml +++ b/k8s/helm/templates/issuer-node-ui-deployment.yaml @@ -19,7 +19,6 @@ spec: annotations: rollme: {{ randAlphaNum 5 | quote }} spec: - serviceAccountName: {{ include "helpers.serviceAccountName" . }} containers: - name: {{ .Values.uiIssuerNode.deployment.containerName }} image: {{ .Values.issuernode_ui_repository_image }}:{{ .Values.issuernode_ui_repository_tag }} diff --git a/k8s/helm/values-develop.yaml b/k8s/helm/values-develop.yaml index 3b5c9f8a..f52fb739 100644 --- a/k8s/helm/values-develop.yaml +++ b/k8s/helm/values-develop.yaml @@ -77,7 +77,7 @@ apiIssuerNode: issuerDbUser: polygonid issuerKMSBJJProvider: vault issuerKMSETHProvider: vault - issuerKMSSOLProvider: "" + issuerKMSSOLProvider: vault issuerKeyStorePluginIden3MountPath: iden3 issuerKeyStorePort: "8200" issuerLogLevel: "-4" diff --git a/k8s/routers/develop/httproutes.yaml b/k8s/routers/develop/httproutes.yaml index fb605fc1..b18fdc5e 100644 --- a/k8s/routers/develop/httproutes.yaml +++ b/k8s/routers/develop/httproutes.yaml @@ -1,7 +1,7 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: issuer-node-api + name: {{ .Release.Name }}-api spec: parentRefs: @@ -9,6 +9,7 @@ spec: namespace: infra hostnames: - "issuer-node-core-api-testing.privado.id" + - "issuer-node-core-api-testing-k8s.internal-iden3-dev.com" rules: - backendRefs: - name: issuer-node-develop-api-svc @@ -17,14 +18,15 @@ spec: apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: issuer-node-ui + name: {{ .Release.Name }}-ui spec: parentRefs: - name: main namespace: infra hostnames: - - "issuer-node-ui-testing.privado.id" + - "issuer-node-testing.privado.id" + - "issuer-node-ui-testing-k8s.internal-iden3-dev.com" rules: - backendRefs: - name: issuer-node-develop-ui-svc diff --git a/ui/Dockerfile.eks b/ui/Dockerfile.eks index 3c485030..35c2639f 100644 --- a/ui/Dockerfile.eks +++ b/ui/Dockerfile.eks @@ -1,3 +1,4 @@ +# check=skip=SecretsUsedInArgOrEnv # ── Stage 1: build ─────────────────────────────────────────────────────────── FROM node:20-alpine AS builder @@ -24,6 +25,12 @@ ARG VITE_DISPLAY_METHOD_BUILDER_URL ARG VITE_BASE_URL ARG VITE_PAYMENT_PAGES_ENABLED +RUN test -n "$VITE_API_URL" || (echo "ERROR: VITE_API_URL is required" && exit 1) \ + && test -n "$VITE_API_PASSWORD" || (echo "ERROR: VITE_API_PASSWORD is required" && exit 1) \ + && test -n "$VITE_API_USERNAME" || (echo "ERROR: VITE_API_USERNAME is required" && exit 1) \ + && test -n "$VITE_ISSUER_NAME" || (echo "ERROR: VITE_ISSUER_NAME is required" && exit 1) \ + && test -n "$VITE_IPFS_GATEWAY_URL" || (echo "ERROR: VITE_IPFS_GATEWAY_URL is required" && exit 1) + RUN echo "VITE_API_URL=$VITE_API_URL" >> .env \ && echo "VITE_API_PASSWORD=$VITE_API_PASSWORD" >> .env \ && echo "VITE_API_USERNAME=$VITE_API_USERNAME" >> .env \