Skip to content

Commit

Permalink
Merge pull request #36 from ConvertKit/v4-api-oauth
Browse files Browse the repository at this point in the history
v4 API: PKCE OAuth
  • Loading branch information
n7studios authored Apr 18, 2024
2 parents f5ebaab + e2ebb1f commit e61fa5c
Show file tree
Hide file tree
Showing 10 changed files with 3,199 additions and 1,334 deletions.
1 change: 1 addition & 0 deletions .env.dist.testing
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ TEST_TABLE_PREFIX=wp_
TEST_SITE_WP_URL=http://127.0.0.1
TEST_SITE_WP_DOMAIN=127.0.0.1
TEST_SITE_ADMIN_EMAIL=wordpress@convertkit.local
CONVERTKIT_API_BROADCAST_ID="8697158"
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_LEGACY_FORM_ID="470099"
CONVERTKIT_API_LANDING_PAGE_ID="2765196"
Expand Down
14 changes: 9 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ TEST_TABLE_PREFIX=wp_
TEST_SITE_WP_URL=http://convertkit.local
TEST_SITE_WP_DOMAIN=convertkit.local
TEST_SITE_ADMIN_EMAIL=wordpress@convertkit.local
CONVERTKIT_ACCESS_TOKEN=
CONVERTKIT_REFRESH_TOKEN=
CONVERTKIT_ACCESS_TOKEN_NO_DATA=
CONVERTKIT_REFRESH_TOKEN_NO_DATA=
CONVERTKIT_CLIENT_ID=
CONVERTKIT_API_KEY=
CONVERTKIT_API_SECRET=
CONVERTKIT_OAUTH_ACCESS_TOKEN=
CONVERTKIT_OAUTH_REFRESH_TOKEN=
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA=
CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA=
CONVERTKIT_OAUTH_CLIENT_ID=
CONVERTKIT_OAUTH_REDIRECT_URI=
CONVERTKIT_API_BROADCAST_ID="8697158"
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_LEGACY_FORM_ID="470099"
CONVERTKIT_API_LANDING_PAGE_ID="2765196"
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ jobs:
DB_PASS: root
DB_HOST: localhost
INSTALL_PLUGINS: "woocommerce" # Don't include this repository's Plugin here.
CONVERTKIT_API_KEY: ${{ secrets.CONVERTKIT_API_KEY }} # ConvertKit API Key, stored in the repository's Settings > Secrets
CONVERTKIT_API_SECRET: ${{ secrets.CONVERTKIT_API_SECRET }} # ConvertKit API Secret, stored in the repository's Settings > Secrets
CONVERTKIT_API_KEY_NO_DATA: ${{ secrets.CONVERTKIT_API_KEY_NO_DATA }} # ConvertKit API Key for ConvertKit account with no data, stored in the repository's Settings > Secrets
CONVERTKIT_API_SECRET_NO_DATA: ${{ secrets.CONVERTKIT_API_SECRET_NO_DATA }} # ConvertKit API Secret for ConvertKit account with no data, stored in the repository's Settings > Secrets
CONVERTKIT_API_SIGNED_SUBSCRIBER_ID: ${{ secrets.CONVERTKIT_API_SIGNED_SUBSCRIBER_ID }} # ConvertKit API Signed Subscriber ID, stored in the repository's Settings > Secrets
CONVERTKIT_API_SUBSCRIBER_TOKEN: ${{ secrets.CONVERTKIT_API_SUBSCRIBER_TOKEN }} # ConvertKit API Subscriber Token, stored in the repository's Settings > Secrets
CONVERTKIT_API_KEY: ${{ secrets.CONVERTKIT_API_KEY }}
CONVERTKIT_API_SECRET: ${{ secrets.CONVERTKIT_API_SECRET }}
CONVERTKIT_OAUTH_ACCESS_TOKEN: ${{ secrets.CONVERTKIT_OAUTH_ACCESS_TOKEN }}
CONVERTKIT_OAUTH_REFRESH_TOKEN: ${{ secrets.CONVERTKIT_OAUTH_REFRESH_TOKEN }}
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA: ${{ secrets.CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA }}
CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA: ${{ secrets.CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA }}
CONVERTKIT_OAUTH_CLIENT_ID: ${{ secrets.CONVERTKIT_OAUTH_CLIENT_ID }}
CONVERTKIT_OAUTH_REDIRECT_URI: ${{ secrets.CONVERTKIT_OAUTH_REDIRECT_URI }}
CONVERTKIT_API_SIGNED_SUBSCRIBER_ID: ${{ secrets.CONVERTKIT_API_SIGNED_SUBSCRIBER_ID }}
CONVERTKIT_API_SUBSCRIBER_TOKEN: ${{ secrets.CONVERTKIT_API_SUBSCRIBER_TOKEN }}

# Defines the WordPress and PHP Versions matrix to run tests on.
strategy:
Expand Down Expand Up @@ -111,8 +115,12 @@ jobs:
CONVERTKIT_API_KEY=${{ env.CONVERTKIT_API_KEY }}
CONVERTKIT_API_SECRET=${{ env.CONVERTKIT_API_SECRET }}
CONVERTKIT_API_KEY_NO_DATA=${{ env.CONVERTKIT_API_KEY_NO_DATA }}
CONVERTKIT_API_SECRET_NO_DATA=${{ env.CONVERTKIT_API_SECRET_NO_DATA }}
CONVERTKIT_OAUTH_ACCESS_TOKEN=${{ env.CONVERTKIT_OAUTH_ACCESS_TOKEN }}
CONVERTKIT_OAUTH_REFRESH_TOKEN=${{ env.CONVERTKIT_OAUTH_REFRESH_TOKEN }}
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA=${{ env.CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA }}
CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA=${{ env.CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA }}
CONVERTKIT_OAUTH_CLIENT_ID=${{ env.CONVERTKIT_OAUTH_CLIENT_ID }}
CONVERTKIT_OAUTH_REDIRECT_URI=${{ env.CONVERTKIT_OAUTH_REDIRECT_URI }}
CONVERTKIT_API_SIGNED_SUBSCRIBER_ID=${{ env.CONVERTKIT_API_SIGNED_SUBSCRIBER_ID }}
CONVERTKIT_API_SUBSCRIBER_TOKEN=${{ env.CONVERTKIT_API_SUBSCRIBER_TOKEN }}
write-mode: append
Expand Down
11 changes: 6 additions & 5 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ TEST_TABLE_PREFIX=wp_
TEST_SITE_WP_URL=http://convertkit.local
TEST_SITE_WP_DOMAIN=convertkit.local
TEST_SITE_ADMIN_EMAIL=wordpress@convertkit.local
CONVERTKIT_ACCESS_TOKEN=
CONVERTKIT_REFRESH_TOKEN=
CONVERTKIT_ACCESS_TOKEN_NO_DATA=
CONVERTKIT_REFRESH_TOKEN_NO_DATA=
CONVERTKIT_CLIENT_ID=
CONVERTKIT_OAUTH_ACCESS_TOKEN=
CONVERTKIT_OAUTH_REFRESH_TOKEN=
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA=
CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA=
CONVERTKIT_OAUTH_CLIENT_ID=
CONVERTKIT_OAUTH_REDIRECT_URI=
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_SEQUENCE_ID="1030824"
CONVERTKIT_API_TAG_ID="2744672"
Expand Down
3 changes: 3 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>

<!-- Exclude traits from the PHP SDK. -->
<exclude-pattern>class-convertkit-api-traits.php</exclude-pattern>

<!-- Check that code meets WordPress-Extra standards. -->
<rule ref="WordPress-Extra">
<!--
Expand Down
Loading

0 comments on commit e61fa5c

Please sign in to comment.