Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automated] Release 0.4.0 #208

Merged
merged 28 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
46a0f43
Fix some utils (#27)
typeofweb Jun 19, 2023
be0c126
Merge remote-tracking branch 'origin/main' into canary
github-actions[bot] Jul 14, 2023
4d8b58b
Add more logs (#105)
typeofweb Jul 17, 2023
a1df783
Add webhook ID to the summary view (#115)
typeofweb Aug 4, 2023
84c9eda
Release Stripe App (#106)
github-actions[bot] Aug 4, 2023
4296485
Merge remote-tracking branch 'origin/main' into canary
github-actions[bot] Aug 4, 2023
2aa7121
Fix test output in CI (#26)
witoszekdev Aug 18, 2023
e004b53
Update template
typeofweb Aug 23, 2023
2fb230b
Merge remote-tracking branch 'template/canary' into canary
typeofweb Aug 23, 2023
2e1b4a5
Update CODEOWNERS
lkostrowski Sep 29, 2023
be1419f
Update Sentry (#158)
witoszekdev Nov 9, 2023
2d70846
Update CODEOWNERS
lkostrowski Nov 13, 2023
9c3f34b
Update dependabot.yml
lkostrowski Nov 16, 2023
b246a50
Release Stripe App (#159)
github-actions[bot] Nov 21, 2023
86394dd
Merge remote-tracking branch 'origin/main' into canary
github-actions[bot] Nov 21, 2023
e5317a6
Update package.json
lkostrowski Nov 21, 2023
a2b959b
Update .dependency-cruiser.js
lkostrowski Nov 21, 2023
e47cd4e
[skip ci]: Bump zod from 3.22.2 to 3.22.3 (#169)
dependabot[bot] Nov 21, 2023
9d42dfa
Fix invalid configurationId value (#130) (#131)
MaisonMisechy Nov 24, 2023
6817fbe
Update all deps and fix bug (#180)
typeofweb Dec 20, 2023
d699cb4
Fix blank screen error (#184)
typeofweb Dec 20, 2023
1849fe1
Fix changesets
typeofweb Dec 21, 2023
321789f
Release Stripe App (#172)
github-actions[bot] Dec 21, 2023
2054477
Merge remote-tracking branch 'origin/main' into canary
github-actions[bot] Dec 21, 2023
c33241a
Update CODEOWNERS
lkostrowski Jan 24, 2024
7f4e5eb
Change 1password vault to Shop-ex (#201)
krzysztofzuraw Jan 25, 2024
c69f6b8
Add ALLOWED_DOMAIN_PATTERN env (#200)
lkostrowski Feb 12, 2024
b418963
Release Stripe App (#207)
github-actions[bot] Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
},
],
});
Loading