├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── documentation.md │ ├── feature_request.md │ ├── other.md │ └── performance_issue.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── install.yaml │ ├── integration.yaml │ ├── release-please.yml │ └── unit.yaml ├── .gitignore ├── .release-please-manifest.json ├── .versionrc.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Configuration ├── ConfigurationCleaner.php ├── CorsConfigurationInterface.php ├── GraphQl │ └── CorsConfiguration.php └── Rest │ └── CorsConfiguration.php ├── Controller └── NoopController.php ├── LICENSE ├── Plugin └── FastLauncher.php ├── README.md ├── Request └── RestRequest.php ├── Response ├── HeaderManager.php ├── HeaderProvider │ ├── CorsAllowCredentialsHeaderProvider.php │ ├── CorsAllowHeadersHeaderProvider.php │ ├── CorsAllowMethodsHeaderProvider.php │ ├── CorsAllowOriginHeaderProvider.php │ ├── CorsExposeHeadersProvider.php │ ├── CorsMaxAgeHeaderProvider.php │ └── CorsVaryHeaderProvider.php └── Preflight │ ├── GraphQl │ └── PreflightRequestHandler.php │ └── Rest │ └── PreflightRequestHandler.php ├── Test ├── Integration │ ├── CorsConfigurationDiTest.php │ ├── CorsValidatorDiTest.php │ ├── HeaderManagerConfigurationTest.php │ ├── Preflight │ │ ├── GraphQlResponseTest.php │ │ └── WebApiResponseTest.php │ ├── RegistrationTest.php │ └── Response │ │ ├── GraphQlResponseTest.php │ │ └── WebApiResponseTest.php └── Unit │ ├── Configuration │ ├── ConfigurationCleanerTest.php │ ├── GraphQlCorsConfigurationTest.php │ └── RestCorsConfigurationTest.php │ ├── HeaderProvider │ ├── CorsAllowCredentialsHeaderProviderTest.php │ ├── CorsAllowHeadersHeaderProviderTest.php │ ├── CorsAllowMethodsHeaderProviderTest.php │ ├── CorsAllowOriginHeaderProviderTest.php │ ├── CorsMaxAgeHeaderProviderTest.php │ └── CorsVaryHeaderProviderTest.php │ └── Validator │ └── CorsValidatorTest.php ├── Validator ├── CorsValidator.php └── CorsValidatorInterface.php ├── composer.json ├── docs ├── DEVELOPER.md ├── build │ └── README.md ├── faq │ └── faqs.md ├── stories │ ├── configuring-the-headers.md │ ├── examples │ │ ├── cors_allowed_methods-in-cloud.jpg │ │ └── pwa-configuration.php │ ├── no-wild-card.md │ ├── security.md │ └── varnish.md └── upgrading │ └── guide.md ├── etc ├── config.xml ├── di.xml ├── graphql │ └── di.xml ├── module.xml └── webapi_rest │ └── di.xml ├── package-lock.json ├── package.json ├── registration.php └── release-please-config.json /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 2 | # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 3 | # $$ Magento 2 Cors Code Owners $$ 4 | # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 5 | # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 6 | # 7 | # The configuration for Code Owners for graycoreio/magento2-cors. 8 | # 9 | # For more info see: https://help.github.com/articles/about-codeowners/ 10 | # 11 | 12 | 13 | # ================================================ 14 | # Concepts 15 | # ================================================ 16 | # 17 | # 1. A CodeOwner should only review what they are comfortable reviewing. If you're not comfortable, say something. 18 | # 2. It is a CodeOwners responsibility to only accept the changes that they understand and deem necessary. 19 | # 3. The CodeOwners have final say on whether or not code is accepted. 20 | # 4. If multiple CodeOwners are listed, ALL code owners must approve the PR prior to merge. 21 | # 5. CodeOwners work in conjunction with Github's "Number of Required Approvals (1)" requirement. 22 | 23 | 24 | # ================================================ 25 | # GitHub username registry 26 | # ================================================ 27 | 28 | # damienwebdev - Damien Retzinger 29 | # Nolan-Arnold - Nolan Arnold 30 | 31 | 32 | 33 | ###################################################################################################### 34 | # 35 | # Team structure and memberships 36 | # ------------------------------ 37 | # 38 | # 39 | # Any changes to team structure or memberships must first be made in this file and only then 40 | # implemented in the GitHub UI. 41 | ####################################################################################################### 42 | 43 | 44 | ###################################################################################################### 45 | # 46 | # CODEOWNERS rules 47 | # ----------------- 48 | # 49 | # All the following rules are applied in the order specified in this file. 50 | # The last rule that matches wins! 51 | # 52 | # See https://git-scm.com/docs/gitignore#_pattern_format for pattern syntax docs. 53 | # 54 | ###################################################################################################### 55 | 56 | 57 | # ================================================ 58 | # Default Owners 59 | # ================================================ 60 | 61 | * @damienwebdev 62 | 63 | # ================================================ 64 | # CODEOWNERS Owners owners ... 65 | # ================================================ 66 | 67 | /.github/CODEOWNERS @damienwebdev 68 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: graycoreio -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report or Regression 3 | about: Create a report to help us fix an issue or regression 4 | title: '[BUG]' 5 | labels: 'bug' 6 | assignees: 'damienwebdev' 7 | --- 8 | 9 | 14 | 15 | # :bug: Bug report 16 | 17 | ## Current Behavior 18 | 19 | 20 | 21 | ## Expected Behavior 22 | 23 | 24 | 25 | ## Minimal reproduction of the problem with instructions 26 | 27 | 28 | 29 | ## What is the motivation / use case for changing the behavior? 30 | 31 | 32 | 33 | ## Environment 34 | 35 |
36 | magento2-cors version: X.Y.Z
37 | Magento version: X.Y.Z
38 | PHP Version version: X.Y.Z
39 |
40 |
41 | Others:
42 |
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation Request
3 | about: Request additional documentation or clarification on a feature.
4 | title: '[DOCS]'
5 | labels: 'docs'
6 | assignees: 'damienwebdev'
7 | ---
8 |
9 |
14 |
15 | # :page_facing_up: Documentation Request
16 |
17 | ## What were you doing?
18 |
19 |
20 |
21 | ## Expected behavior
22 |
23 |
24 |
25 | ## Existing Documentation
26 |
27 |
28 | ## Environment
29 |
30 |
31 | magento2-cors version: X.Y.Z
32 | Magento version: X.Y.Z
33 | PHP Version version: X.Y.Z
34 |
35 |
36 | Others:
37 |
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Ask for a new feature, or something that you'd like to see changed.
4 | title: '[FEAT]'
5 | labels: 'feat'
6 | assignees: 'damienwebdev'
7 | ---
8 |
9 |
14 |
15 | # :bulb: Feature request
16 |
17 | ## Feature Name
18 |
19 |
20 |
21 | ## The Desired Behavior
22 |
23 |
24 |
25 | ## Your Use Case
26 |
27 |
28 |
29 | ## Prior Work
30 |
31 |
32 |
33 | ## Environment
34 |
35 |
36 | magento2-cors version: X.Y.Z
37 | Magento version: X.Y.Z
38 | PHP Version version: X.Y.Z
39 |
40 |
41 | Others:
42 |
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Other
3 | about: Report a general issue that isn't covered by other issue templates.
4 | title: '[OTHER]'
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 |
14 |
15 | # :question: Other
16 |
17 |
18 |
19 | ## Environment
20 |
21 |
22 | magento2-cors version: X.Y.Z
23 | Magento version: X.Y.Z
24 | PHP Version version: X.Y.Z
25 |
26 |
27 | Others:
28 |
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/performance_issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Performance Issue
3 | about: Create a report about a performance problem.
4 | title: '[PERF]'
5 | labels: 'perf'
6 | assignees: 'damienwebdev'
7 | ---
8 |
9 |
14 |
15 | # :turtle: Performance Issue
16 |
17 | ## Current behavior
18 |
19 |
20 |
21 | ## Expected behavior
22 |
23 |
24 |
25 | ## Minimal reproduction of the problem with instructions
26 |
27 |
28 |
29 | ## What is the motivation / use case for changing the behavior?
30 |
31 |
32 |
33 | ## Environment
34 |
35 |
36 | magento2-cors version: X.Y.Z
37 | Magento version: X.Y.Z
38 | PHP Version version: X.Y.Z
39 |
40 |
41 | Others:
42 |
43 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## PR Checklist
2 | Please check if your PR fulfills the following requirements:
3 |
4 | - [ ] The commit message follows our guidelines: https://github.com/graycoreio/magento2-cors/blob/master/CONTRIBUTING.md#commit
5 | - [ ] Tests for the changes have been added (for bug fixes / features)
6 | - [ ] Docs have been added / updated (for bug fixes / features)
7 |
8 |
9 | ## PR Type
10 | What kind of change does this PR introduce?
11 |
12 |
13 | ```
14 | [ ] Bugfix
15 | [ ] Feature
16 | [ ] Code style update (formatting, local variables)
17 | [ ] Refactoring (no functional changes, no api changes)
18 | [ ] Build related changes
19 | [ ] CI related changes
20 | [ ] Documentation content changes
21 | [ ] Other... Please describe:
22 | ```
23 |
24 | ## What is the current behavior?
25 |
26 |
27 | Fixes: N/A
28 |
29 |
30 | ## What is the new behavior?
31 |
32 |
33 | ## Does this PR introduce a breaking change?
34 | ```
35 | [ ] Yes
36 | [ ] No
37 | ```
38 |
39 |
40 |
41 |
42 | ## Other information
--------------------------------------------------------------------------------
/.github/workflows/install.yaml:
--------------------------------------------------------------------------------
1 | name: Installation Test
2 |
3 | on:
4 | workflow_dispatch: {}
5 | schedule:
6 | - cron: 0 12 10 * *
7 | push:
8 | branches:
9 | - master
10 | paths-ignore:
11 | - "docs/**"
12 | - package.json
13 | - package-lock.json
14 | - "*.md"
15 | pull_request:
16 | branches:
17 | - master
18 | paths-ignore:
19 | - "docs/**"
20 | - package.json
21 | - package-lock.json
22 |
23 | jobs:
24 | compute_matrix:
25 | runs-on: ubuntu-latest
26 | outputs:
27 | matrix: ${{ steps.supported-version.outputs.matrix }}
28 | steps:
29 | - uses: graycoreio/github-actions-magento2/supported-version@main
30 | id: supported-version
31 |
32 | install-test:
33 | needs: compute_matrix
34 | strategy:
35 | matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
36 | runs-on: ubuntu-latest
37 | steps:
38 | - uses: actions/checkout@v4
39 | - uses: graycoreio/github-actions-magento2/installation-test@main
40 | with:
41 | composer_version: ${{ matrix.composer }}
42 | php_version: ${{ matrix.php }}
43 | magento_version: ${{ matrix.magento }}
44 | composer_auth: ${{ secrets.COMPOSER_AUTH }}
45 | package_name: graycore/magento2-cors
46 | source_folder: $GITHUB_WORKSPACE
--------------------------------------------------------------------------------
/.github/workflows/integration.yaml:
--------------------------------------------------------------------------------
1 | name: Integration Test
2 |
3 | on:
4 | workflow_dispatch: {}
5 | schedule:
6 | - cron: 0 12 10 * *
7 | push:
8 | branches:
9 | - master
10 | paths-ignore:
11 | - "docs/**"
12 | - package.json
13 | - package-lock.json
14 | - "*.md"
15 | pull_request:
16 | branches:
17 | - master
18 | paths-ignore:
19 | - "docs/**"
20 | - package.json
21 | - package-lock.json
22 | - "*.md"
23 |
24 | jobs:
25 | compute_matrix:
26 | runs-on: ubuntu-latest
27 | outputs:
28 | matrix: ${{ steps.supported-version.outputs.matrix }}
29 | steps:
30 | - uses: graycoreio/github-actions-magento2/supported-version@main
31 | id: supported-version
32 | integration-workflow:
33 | needs: compute_matrix
34 | uses: graycoreio/github-actions-magento2/.github/workflows/integration.yaml@main
35 | with:
36 | package_name: graycore/magento2-cors
37 | matrix: ${{ needs.compute_matrix.outputs.matrix }}
38 | test_command: ../../../vendor/bin/phpunit ../../../vendor/graycore/magento2-cors/Test/Integration
39 | fail-fast: false
40 | secrets:
41 | composer_auth: ${{ secrets.COMPOSER_AUTH }}
42 |
--------------------------------------------------------------------------------
/.github/workflows/release-please.yml:
--------------------------------------------------------------------------------
1 | name: Create Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | release-please:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: google-github-actions/release-please-action@v3
13 | with:
14 | token: ${{ secrets.GRAYCORE_GITHUB_TOKEN }}
15 | command: manifest
16 | default-branch: master
17 |
--------------------------------------------------------------------------------
/.github/workflows/unit.yaml:
--------------------------------------------------------------------------------
1 | name: Unit Test
2 |
3 | on:
4 | workflow_dispatch: {}
5 | schedule:
6 | - cron: 0 12 10 * *
7 | push:
8 | branches:
9 | - master
10 | paths-ignore:
11 | - "docs/**"
12 | - package.json
13 | - package-lock.json
14 | - "*.md"
15 | pull_request:
16 | branches:
17 | - master
18 | paths-ignore:
19 | - "docs/**"
20 | - package.json
21 | - package-lock.json
22 | - "*.md"
23 |
24 | jobs:
25 | unit-test:
26 | strategy:
27 | matrix:
28 | php_version:
29 | - 8.1
30 | - 8.2
31 | - 8.3
32 | - 8.4
33 | runs-on: ubuntu-latest
34 | steps:
35 | - uses: actions/checkout@v4
36 | - uses: graycoreio/github-actions-magento2/unit-test@main
37 | with:
38 | php_version: ${{ matrix.php_version }}
39 | composer_auth: ${{ secrets.COMPOSER_AUTH }}
40 | test_command: composer run unit-test
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor/
2 | node_modules/
3 | composer.lock
--------------------------------------------------------------------------------
/.release-please-manifest.json:
--------------------------------------------------------------------------------
1 | {".":"2.1.1"}
2 |
--------------------------------------------------------------------------------
/.versionrc.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4 |
5 | ## [2.1.1](https://github.com/graycoreio/magento2-cors/compare/v2.1.0...v2.1.1) (2025-04-15)
6 |
7 |
8 | ### Bug Fixes
9 |
10 | * prevent 500 errors on frontend/admin routes for options requests ([627a211](https://github.com/graycoreio/magento2-cors/commit/627a21190d3636ae32303da738e87182c1536bf6))
11 |
12 | ## [2.1.0](https://github.com/graycoreio/magento2-cors/compare/v2.0.1...v2.1.0) (2024-10-10)
13 |
14 |
15 | ### Features
16 |
17 | * **docs:** augment docs for configuring Commerce Cloud ([#87](https://github.com/graycoreio/magento2-cors/issues/87)) ([d9f7f69](https://github.com/graycoreio/magento2-cors/commit/d9f7f69b301ba9bcbfb03bca8d27254a6eb98601))
18 |
19 | ## [2.0.1](https://github.com/graycoreio/magento2-cors/compare/v2.0.0...v2.0.1) (2024-02-07)
20 |
21 |
22 | ### Bug Fixes
23 |
24 | * `Access-Control-Expose-Headers` only set on preflight ([#84](https://github.com/graycoreio/magento2-cors/issues/84)) ([f2515c8](https://github.com/graycoreio/magento2-cors/commit/f2515c831641eeb9cc3dbefc082a14706158581b))
25 | * wrong di.xml configuration - missing noNamespaceSchemaLocation and xmlns:xsi ([#82](https://github.com/graycoreio/magento2-cors/issues/82)) ([104fd5d](https://github.com/graycoreio/magento2-cors/commit/104fd5dcb3a1c00e83a06973719d4aa4683cdcc6))
26 |
27 | ## [2.0.0](https://github.com/graycoreio/magento2-cors/compare/v2.0.0-rc.0...v2.0.0) (2022-10-14)
28 |
29 |
30 | ### Bug Fixes
31 |
32 | * add compatability between Laminas\Http and Zend\Http ([#75](https://github.com/graycoreio/magento2-cors/issues/75)) ([b1d4af1](https://github.com/graycoreio/magento2-cors/commit/b1d4af124b1a1a0f3ad19009a0eba5d9d973309f))
33 |
34 | ## [2.0.0-rc.0](https://github.com/graycoreio/magento2-cors/compare/v1.6.0...v2.0.0-rc.0) (2022-06-11)
35 |
36 |
37 | ### ⚠ BREAKING CHANGES
38 |
39 | * If you were expecting to use the native GraphQl/REST controller when computing CORS headers (and everything else that entails - like having a Magento session, for example) that guarantee is no-longer provided.
40 |
41 | ### Features
42 |
43 | * **graphql,rest:** add faster CORS headers ([#66](https://github.com/graycoreio/magento2-cors/issues/66)) ([cefd663](https://github.com/graycoreio/magento2-cors/commit/cefd6631d4f2aaf5347875a02d773317480783d5))
44 |
45 |
46 | * denote breaking changes ([b98b9bc](https://github.com/graycoreio/magento2-cors/commit/b98b9bcfcefa533f84e85921a9becb5be2a9ff71))
47 |
48 | ## [1.6.0](https://github.com/graycoreio/magento2-cors/compare/v1.4.1...v1.6.0) (2022-06-11)
49 |
50 |
51 | ### Features
52 |
53 | * add Magento v2.4.4 and PHP8.1 support ([#70](https://github.com/graycoreio/magento2-cors/issues/70)) ([6e8bfe1](https://github.com/graycoreio/magento2-cors/commit/6e8bfe184e47e602b26c001d986bb296d42c3665))
54 | * **rest:** extend REST request to allow OPTIONS without error ([#55](https://github.com/graycoreio/magento2-cors/issues/55)) ([eb1df2d](https://github.com/graycoreio/magento2-cors/commit/eb1df2d0c25897897998e8e3f88fcec500a8a3f8))
55 |
56 | ### [1.4.1](https://github.com/graycoreio/magento2-cors/compare/v1.4.0...v1.4.1) (2021-03-04)
57 |
58 |
59 | ### Bug Fixes
60 |
61 | * **graphql, rest:** allow caching of options requests ([#53](https://github.com/graycoreio/magento2-cors/issues/53)) ([f6b9b3f](https://github.com/graycoreio/magento2-cors/commit/f6b9b3fbf042d7c551b3993cca8e24a169309748))
62 |
63 | ## [1.4.0](https://github.com/graycoreio/magento2-cors/compare/v1.3.2...v1.4.0) (2021-03-02)
64 |
65 |
66 | ### Features
67 |
68 | * **graphql, rest:** add support for access-control-expose-headers ([#49](https://github.com/graycoreio/magento2-cors/issues/49)) ([53aac87](https://github.com/graycoreio/magento2-cors/commit/53aac87f4397352426dc5b8eef720ca22a5594f6))
69 | * **graphql, rest:** apply certain headers only to preflight requests ([#51](https://github.com/graycoreio/magento2-cors/issues/51)) ([30bcff0](https://github.com/graycoreio/magento2-cors/commit/30bcff0931134e56d0f4d4217bfe84dde1588b00))
70 | * **graphql,rest:** add support for Vary header with Origin ([#47](https://github.com/graycoreio/magento2-cors/issues/47)) ([e656909](https://github.com/graycoreio/magento2-cors/commit/e65690922063d7e52e0cd6bbed8643dda4a3d061))
71 | * **validator:** add a new method to determine whether or not a reque… ([#50](https://github.com/graycoreio/magento2-cors/issues/50)) ([8c3ef8b](https://github.com/graycoreio/magento2-cors/commit/8c3ef8b085c79dfd6aad8a6a3a725ade98e9490b))
72 |
73 | ### [1.3.2](https://github.com/graycoreio/magento2-cors/compare/v1.3.1...v1.3.2) (2020-08-10)
74 |
75 | ### [1.3.1](https://github.com/graycoreio/magento2-cors/compare/v1.3.0...v1.3.1) (2020-08-10)
76 |
77 | ## [1.3.0](https://github.com/graycoreio/magento2-cors/compare/v1.2.0...v1.3.0) (2020-05-18)
78 |
79 |
80 | ### Bug Fixes
81 |
82 | * **graphql:** prevent fatal error when using Chrome extensions for graphql querying ([#24](https://github.com/graycoreio/magento2-cors/issues/24)) ([486fe10](https://github.com/graycoreio/magento2-cors/commit/486fe10))
83 |
84 |
85 | ### Build System
86 |
87 | * **all:** added unit tests to CI ([#18](https://github.com/graycoreio/magento2-cors/issues/18)) ([aade441](https://github.com/graycoreio/magento2-cors/commit/aade441))
88 | * **all:** adding linting with phpcs ([#16](https://github.com/graycoreio/magento2-cors/issues/16)) ([8753bd2](https://github.com/graycoreio/magento2-cors/commit/8753bd2))
89 | * **all:** set up CI with Azure Pipelines ([#15](https://github.com/graycoreio/magento2-cors/issues/15)) ([f30b51f](https://github.com/graycoreio/magento2-cors/commit/f30b51f))
90 | * **ci:** run integration tests in ci ([#21](https://github.com/graycoreio/magento2-cors/issues/21)) ([a79d7f7](https://github.com/graycoreio/magento2-cors/commit/a79d7f7))
91 |
92 |
93 | ### Features
94 |
95 | * **cors:** add header provider for Allow-Credentials ([#27](https://github.com/graycoreio/magento2-cors/issues/27)) ([38bf597](https://github.com/graycoreio/magento2-cors/commit/38bf597))
96 |
97 |
98 | ### Tests
99 |
100 | * **configuration:** added/updated unit tests for config files ([#19](https://github.com/graycoreio/magento2-cors/issues/19)) ([826b68e](https://github.com/graycoreio/magento2-cors/commit/826b68e))
101 | * **integration:** updated integration tests to pass ([#23](https://github.com/graycoreio/magento2-cors/issues/23)) ([89736d7](https://github.com/graycoreio/magento2-cors/commit/89736d7))
102 |
103 |
104 |
105 | ## [1.2.0](https://github.com/graycoreio/magento2-cors/compare/v1.1.0...v1.2.0) (2020-01-20)
106 |
107 |
108 | ### Features
109 |
110 | * **rest:** fixup rest api to handle options requests ([#13](https://github.com/graycoreio/magento2-cors/issues/13)) ([3520b9d](https://github.com/graycoreio/magento2-cors/commit/3520b9d))
111 |
112 |
113 |
114 | ## [1.1.0](https://github.com/graycoreio/magento2-cors/compare/v1.0.0...v1.1.0) (2020-01-17)
115 |
116 |
117 | ### Bug Fixes
118 |
119 | * **graphql:** swap config key name ([#10](https://github.com/graycoreio/magento2-cors/issues/10)) ([2aed35c](https://github.com/graycoreio/magento2-cors/commit/2aed35c))
120 |
121 |
122 | ### Features
123 |
124 | * **rest:** add CORS support for Magento 2 REST APIs ([#11](https://github.com/graycoreio/magento2-cors/issues/11)) ([2342976](https://github.com/graycoreio/magento2-cors/commit/2342976))
125 | * **rest:** allow rest api and graphql apis to be configurable separately ([#12](https://github.com/graycoreio/magento2-cors/issues/12)) ([ff5813e](https://github.com/graycoreio/magento2-cors/commit/ff5813e))
126 |
127 |
128 |
129 | ## 1.0.0 (2019-07-23)
130 |
131 |
132 | ### Bug Fixes
133 |
134 | * **configuration:** remove backtick in di.xml ([3a6549c](https://github.com/graycoreio/magento2-cors/commit/3a6549c))
135 |
136 |
137 | ### Features
138 |
139 | * **cors:** initial package with configuration and validation for CORS headers on the GraphQL api ([493c6ad](https://github.com/graycoreio/magento2-cors/commit/493c6ad))
140 | * **release:** add basic release process ([b09b62b](https://github.com/graycoreio/magento2-cors/commit/b09b62b))
141 | * **security:** enforce security by default, no headers out of the box ([cb3291c](https://github.com/graycoreio/magento2-cors/commit/cb3291c))
142 |
143 |
144 |
145 | ## 1.0.0 (2019-07-23)
146 |
147 |
148 | ### Bug Fixes
149 |
150 | * **configuration:** remove backtick in di.xml ([3a6549c](https://github.com/graycoreio/magento2-cors/commit/3a6549c))
151 |
152 |
153 | ### Features
154 |
155 | * **cors:** initial package with configuration and validation for CORS headers on the GraphQL api ([493c6ad](https://github.com/graycoreio/magento2-cors/commit/493c6ad))
156 | * **release:** add basic release process ([b09b62b](https://github.com/graycoreio/magento2-cors/commit/b09b62b))
157 | * **security:** enforce security by default, no headers out of the box ([cb3291c](https://github.com/graycoreio/magento2-cors/commit/cb3291c))
158 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment
10 | include:
11 |
12 | * Using welcoming and inclusive language
13 | * Being respectful of differing viewpoints and experiences
14 | * Gracefully accepting constructive criticism
15 | * Focusing on what is best for the community
16 | * Showing empathy towards other community members
17 |
18 | Examples of unacceptable behavior by participants include:
19 |
20 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
21 | * Trolling, insulting/derogatory comments, and personal or political attacks
22 | * Public or private harassment
23 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
24 | * Other conduct which could reasonably be considered inappropriate in a professional setting
25 |
26 | ## Our Responsibilities
27 |
28 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
29 |
30 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
31 |
32 | ## Scope
33 |
34 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
35 |
36 | ## Enforcement
37 |
38 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project lead at [damien@graycore.io](mailto:damien@graycore.io). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
39 |
40 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
41 |
42 | ## Attribution
43 |
44 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
45 |
46 | [homepage]: https://www.contributor-covenant.org
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Magento 2 CORS
2 |
3 | We would love for you to contribute to "Magento 2 CORS" and help make it even better than it is
4 | today! As a contributor, here are the guidelines we would like you to follow:
5 |
6 | - [Code of Conduct](#coc)
7 | - [Question or Problem?](#question)
8 | - [Issues and Bugs](#issue)
9 | - [Feature Requests](#feature)
10 | - [Submission Guidelines](#submit)
11 | - [Coding Rules](#rules)
12 | - [Commit Message Guidelines](#commit)
13 |
14 | ## Code of Conduct
15 | Help us keep "Magento 2 CORS" open and inclusive. Please read and follow our [Code of Conduct][coc].
16 |
17 | ## Got a Question or Problem?
18 |
19 | Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [Stack Overflow](https://stackoverflow.com/questions/tagged/magento2-cors) where the questions should be tagged with tag `magento2-cors`.
20 |
21 | Stack Overflow is a much better place to ask questions since:
22 |
23 | - there are thousands of people willing to help on Stack Overflow
24 | - questions and answers stay available for public viewing so your question / answer might help someone else
25 | - Stack Overflow's voting system assures that the best answers are prominently visible.
26 |
27 | To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
28 |
29 | If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter].
30 |
31 | ## Found a Bug?
32 | If you find a bug in the source code, you can help us by
33 | [submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can
34 | [submit a Pull Request](#submit-pr) with a fix.
35 |
36 | ## Missing a Feature?
37 | You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
38 | Repository. If you would like to *implement* a new feature, please submit an issue with
39 | a proposal for your work first, to be sure that we can use it.
40 | Please consider what kind of change it is:
41 |
42 | * For a **Major Feature**, first open an issue and outline your proposal so that it can be
43 | discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
44 | and help you to craft the change so that it is successfully accepted into the project.
45 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
46 |
47 | ## Submission Guidelines
48 |
49 | ### Submitting an Issue
50 |
51 | Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
52 |
53 | We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs, we will systematically ask you to provide a minimal reproduction scenario using http://plnkr.co. Having a live, reproducible scenario gives us a wealth of important information without going back & forth to you with additional questions like:
54 |
55 | - version of "Magento 2 CORS" used
56 | - 3rd-party libraries and their versions
57 | - and most importantly - a use-case that fails
58 |
59 | A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem.
60 |
61 | We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
62 |
63 | Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that doesn't have enough info to be reproduced.
64 |
65 | You can file new issues by filling out our [new issue form](https://github.com/graycoreio/magento2-cors/issues/new).
66 |
67 |
68 | ### Submitting a Pull Request (PR)
69 | Before you submit your Pull Request (PR) consider the following guidelines:
70 |
71 | 1. Search [GitHub](https://github.com/graycoreio/magento2-cors/pulls) for an open or closed PR
72 | that relates to your submission. You don't want to duplicate effort.
73 | 1. Fork the [graycoreio/magento2-cors](https://github.com/graycoreio/magento2-cors) repo.
74 | 1. Make your changes in a new git branch:
75 |
76 | ```shell
77 | git checkout -b my-fix-branch master
78 | ```
79 |
80 | 1. Create your patch, **including appropriate test cases**.
81 | 1. Follow our [Coding Rules](#rules).
82 | 1. Run the full test suite, as described in the [developer documentation][dev-doc],
83 | and ensure that all tests pass.
84 | 1. Commit your changes using a descriptive commit message that follows our
85 | [commit message conventions](#commit). Adherence to these conventions
86 | is necessary because release notes are automatically generated from these messages.
87 |
88 | ```shell
89 | git commit -a
90 | ```
91 | Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
92 |
93 | 1. Push your branch to GitHub:
94 |
95 | ```shell
96 | git push origin my-fix-branch
97 | ```
98 |
99 | 1. In GitHub, send a pull request to `magento2-cors:master`.
100 | * If we suggest changes then:
101 | * Make the required updates.
102 | * Re-run the "Magento 2 Cors" test suites to ensure tests are still passing.
103 | * Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
104 |
105 | ```shell
106 | git rebase master -i
107 | git push -f
108 | ```
109 | * Note: don't squash your branch until after the reviewers comment "lgtm", so they don't need to re-review your entire branch every commit.
110 |
111 | That's it! Thank you for your contribution!
112 |
113 | #### After your pull request is merged
114 |
115 | After your pull request is merged, you can safely delete your branch and pull the changes
116 | from the main (upstream) repository:
117 |
118 | * Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
119 |
120 | ```shell
121 | git push origin --delete my-fix-branch
122 | ```
123 |
124 | * Check out the master branch:
125 |
126 | ```shell
127 | git checkout master -f
128 | ```
129 |
130 | * Delete the local branch:
131 |
132 | ```shell
133 | git branch -D my-fix-branch
134 | ```
135 |
136 | * Update your master with the latest upstream version:
137 |
138 | ```shell
139 | git pull --ff upstream master
140 | ```
141 |
142 | ## Coding Rules
143 | To ensure consistency throughout the source code, keep these rules in mind as you are working:
144 |
145 | * All features or bug fixes **must be tested** by one or more specs (unit-tests).
146 | * All public API methods **must be documented**. (Details TBC).
147 | * We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
148 | **100 characters**. An automated formatter is available, see
149 | [DEVELOPER.md](docs/DEVELOPER.md#clang-format).
150 |
151 | ## Commit Message Guidelines
152 |
153 | We have very precise rules over how our git commit messages can be formatted. This leads to **more
154 | readable messages** that are easy to follow when looking through the **project history**.
155 |
156 | ### Commit Message Format
157 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
158 | format that includes a **type**, a **scope** and a **subject**:
159 |
160 | ```
161 |