Skip to content

Commit

Permalink
[Automated] Release 0.4.0 (#208)
Browse files Browse the repository at this point in the history
Changelog:
https://github.com/saleor/saleor-app-payment-stripe/releases/tag/v0.4.0

---------

Co-authored-by: Michał Miszczyszyn <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonatan Witoszek <[email protected]>
Co-authored-by: Lukasz Ostrowski <[email protected]>
Co-authored-by: Lukasz Ostrowski <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MaisonMisechy <[email protected]>
Co-authored-by: Krzysztof Żuraw <[email protected]>
  • Loading branch information
9 people authored Feb 12, 2024
1 parent 835fb0d commit 4720d93
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
12 changes: 6 additions & 6 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ TEST_SALEOR_API_URL="https://saleor.localhost:8080/graphql/"
TEST_SALEOR_JWKS='{\"keys\": [{\"kty\": \"RSA\", \"key_ops\": [\"verify\"], \"n\": \"1dBwlEgrHxAM64KH-pupx-VBeISR4Jkh6NLIDStGarXQkLECSMrmGd8eIzKZ4vSvOF0zxfE7zFVRTm4MzFWBxrr0YWoWQRDIKteEcUTDerfVQ0NbUPZAz6siIg4X-qI1rWWu85nkjWAFOax6ociMh9nG46pekueATkjd6lxdrkcjLUgRMm_CRoIQL8Ad7tYt67Ua8gvIkXcF5pV6Cr7ukjySnOzavP25k6XkAgmNEI_Nl60rL4a0imoBZUXRoWCXmqpPFNH5HtyHj7FxFEEoqPZ_-4NIT-eTMgrbqC-lLixjQuyZIZcZHXiC0CBcw-cdPSxsqqcxagcSiBrzoX9idw\", \"e\": \"AQAB\", \"use\": \"sig\", \"kid\": \"1\"}]}'

# Remaining TEST_* vars must be configured separately
TEST_SALEOR_APP_TOKEN=op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_TOKEN
TEST_SALEOR_APP_ID=op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_ID
TEST_PAYMENT_APP_SECRET_KEY=op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_SECRET_KEY
TEST_PAYMENT_APP_PUBLISHABLE_KEY=op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_PUBLISHABLE_KEY
TEST_PAYMENT_APP_WEBHOOK_SECRET=op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_SECRET
TEST_PAYMENT_APP_WEBHOOK_ID=op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_ID
TEST_SALEOR_APP_TOKEN=op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_TOKEN
TEST_SALEOR_APP_ID=op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_ID
TEST_PAYMENT_APP_SECRET_KEY=op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_SECRET_KEY
TEST_PAYMENT_APP_PUBLISHABLE_KEY=op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_PUBLISHABLE_KEY
TEST_PAYMENT_APP_WEBHOOK_SECRET=op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_SECRET
TEST_PAYMENT_APP_WEBHOOK_ID=op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_ID
# When you add more variables remember to add them in .github/workflows/main.yml and src/__tests__/test-env.mjs
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ jobs:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
TEST_SALEOR_APP_TOKEN: op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_TOKEN
TEST_SALEOR_APP_ID: op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_ID
TEST_PAYMENT_APP_SECRET_KEY: op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_SECRET_KEY
TEST_PAYMENT_APP_PUBLISHABLE_KEY: op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_PUBLISHABLE_KEY
TEST_PAYMENT_APP_WEBHOOK_SECRET: op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_SECRET
TEST_PAYMENT_APP_WEBHOOK_ID: op://Checkout/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_ID
TEST_SALEOR_APP_TOKEN: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_TOKEN
TEST_SALEOR_APP_ID: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_SALEOR_APP_ID
TEST_PAYMENT_APP_SECRET_KEY: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_SECRET_KEY
TEST_PAYMENT_APP_PUBLISHABLE_KEY: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_PUBLISHABLE_KEY
TEST_PAYMENT_APP_WEBHOOK_SECRET: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_SECRET
TEST_PAYMENT_APP_WEBHOOK_ID: op://Shop-ex/saleor-app-payment-stripe_TEST_ENVS/TEST_PAYMENT_APP_WEBHOOK_ID

- name: Test
run: pnpm test:ci
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# saleor-app-payment-stripe

## 0.4.0

### Minor Changes

- c69f6b8: Added "ALLOWED_DOMAIN_PATTERN" env that can be used to allow/disallow specific Saleor instances

## 0.3.0

### Minor Changes
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* @saleor/apps
* @saleor/apps-guild
/.github/ @saleor/SRE
* @saleor/Shopex-JS
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/package.json",
"name": "saleor-app-payment-stripe",
"description": "Saleor App Payment Stripe is a payment integration app that allows merchants using the Saleor e-commerce platform to accept online payments from customers using Stripe as their payment processor.",
"version": "0.3.0",
"version": "0.4.0",
"private": true,
"repository": "github:saleor/saleor-app-payment-stripe",
"homepage": "https://github.com/saleor/saleor-app-payment-stripe",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const env = createEnv({
UPSTASH_TOKEN: z.string().optional(),
REST_APL_ENDPOINT: z.string().optional(),
REST_APL_TOKEN: z.string().optional(),
ALLOWED_DOMAIN_PATTERN: z.string().optional(),
},

/*
Expand Down Expand Up @@ -56,5 +57,6 @@ export const env = createEnv({
UPSTASH_TOKEN: process.env.UPSTASH_TOKEN,
REST_APL_ENDPOINT: process.env.REST_APL_ENDPOINT,
REST_APL_TOKEN: process.env.REST_APL_TOKEN,
ALLOWED_DOMAIN_PATTERN: process.env.ALLOWED_DOMAIN_PATTERN,
},
});
24 changes: 12 additions & 12 deletions src/pages/api/register.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createAppRegisterHandler } from "@saleor/app-sdk/handlers/next";

import { saleorApp } from "../../saleor-app";
import { env } from "@/lib/env.mjs";

const allowedUrlsPattern = env.ALLOWED_DOMAIN_PATTERN;

/**
* Required endpoint, called by Saleor to install app.
Expand All @@ -9,17 +12,14 @@ import { saleorApp } from "../../saleor-app";
export default createAppRegisterHandler({
apl: saleorApp.apl,
allowedSaleorUrls: [
/**
* You may want your app to work only for certain Saleor instances.
*
* Your app can work for every Saleor that installs it, but you can
* limit it here
*
* By default, every url is allowed.
*
* URL should be a full graphQL address, usually starting with https:// and ending with /graphql/
*
* Alternatively pass a function
*/
(url) => {
if (allowedUrlsPattern) {
const regex = new RegExp(allowedUrlsPattern);

return regex.test(url);
}

return true;
},
],
});

0 comments on commit 4720d93

Please sign in to comment.