Skip to content

Commit

Permalink
Connection: Add "source" as a query param to the Jetpack connect URL …
Browse files Browse the repository at this point in the history
…(#33984)

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/6823817748
  • Loading branch information
jeherve authored and matticbot committed Nov 10, 2023
1 parent a0db22c commit 3c9c6d0
Show file tree
Hide file tree
Showing 22 changed files with 176 additions and 144 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"automattic/jetpack-autoloader": "^2.12.0",
"automattic/jetpack-composer-plugin": "^1.1.14",
"automattic/jetpack-config": "^1.15.4",
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-identity-crisis": "^0.11.2",
"automattic/jetpack-my-jetpack": "^3.12.0",
"automattic/jetpack-search": "^0.39.5",
"automattic/jetpack-stats": "^0.6.6",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-status": "^1.19.0-alpha",
"automattic/jetpack-sync": "^1.60.1",
"automattic/jetpack-plugins-installer": "^0.2.5"
},
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.60.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Added
- Added source as query param to the Jetpack connect url

## [1.59.0] - 2023-11-08
### Added
- Added a method to check if Jetpack is ready for uninstall cleanup. [#33920]
Expand Down Expand Up @@ -904,6 +911,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[1.60.0-alpha]: https://github.com/Automattic/jetpack-connection/compare/v1.59.0...v1.60.0-alpha
[1.59.0]: https://github.com/Automattic/jetpack-connection/compare/v1.58.3...v1.59.0
[1.58.3]: https://github.com/Automattic/jetpack-connection/compare/v1.58.2...v1.58.3
[1.58.2]: https://github.com/Automattic/jetpack-connection/compare/v1.58.1...v1.58.2
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-connection/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"automattic/jetpack-admin-ui": "^0.2.24",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-roles": "^1.4.25",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-status": "^1.19.0-alpha",
"automattic/jetpack-redirect": "^1.7.27"
},
"require-dev": {
Expand Down Expand Up @@ -56,7 +56,7 @@
"link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "1.59.x-dev"
"dev-trunk": "1.60.x-dev"
}
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,7 @@ public function get_authorization_url( $user = null, $redirect = null ) {
'site_created' => $this->get_assumed_site_creation_date(),
'allow_site_connection' => ! $this->has_connected_owner(),
'calypso_env' => ( new Host() )->get_calypso_env(),
'source' => ( new Host() )->get_source_query(),
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '1.59.0';
const PACKAGE_VERSION = '1.60.0-alpha';

const PACKAGE_SLUG = 'connection';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-status": "^1.19.0-alpha",
"automattic/jetpack-logo": "^1.6.3",
"automattic/jetpack-assets": "^1.18.14"
},
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-jitm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"require": {
"automattic/jetpack-a8c-mc-stats": "^1.4.22",
"automattic/jetpack-assets": "^1.18.14",
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-device-detection": "^1.5.0-alpha",
"automattic/jetpack-logo": "^1.6.3",
"automattic/jetpack-partner": "^1.7.25",
"automattic/jetpack-redirect": "^1.7.27",
"automattic/jetpack-status": "^1.18.5"
"automattic/jetpack-status": "^1.19.0-alpha"
},
"require-dev": {
"brain/monkey": "2.6.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-licensing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.59.0"
"automattic/jetpack-connection": "^1.60.0-alpha"
},
"require-dev": {
"automattic/wordbless": "@dev",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"automattic/jetpack-admin-ui": "^0.2.24",
"automattic/jetpack-assets": "^1.18.14",
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-jitm": "^2.5.2",
"automattic/jetpack-licensing": "^1.8.4",
"automattic/jetpack-plugins-installer": "^0.2.5",
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-partner/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-status": "^1.18.5"
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-status": "^1.19.0-alpha"
},
"require-dev": {
"brain/monkey": "2.6.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-redirect/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-status": "^1.18.5"
"automattic/jetpack-status": "^1.19.0-alpha"
},
"require-dev": {
"brain/monkey": "2.6.1",
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-search/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-assets": "^1.18.14",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-status": "^1.19.0-alpha",
"automattic/jetpack-config": "^1.15.4",
"automattic/jetpack-my-jetpack": "^3.12.0"
},
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-stats/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-assets": "^1.18.14",
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-status": "^1.18.5"
"automattic/jetpack-status": "^1.19.0-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-status/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.19.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Added
- Added a new method that returns "source" query param from the URL

## [1.18.5] - 2023-09-25
### Changed
- Add 127.0.0.1 into the list of known local domains. [#32898]
Expand Down Expand Up @@ -285,6 +292,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Packages: Introduce a status package

[1.19.0-alpha]: https://github.com/Automattic/jetpack-status/compare/v1.18.5...v1.19.0-alpha
[1.18.5]: https://github.com/Automattic/jetpack-status/compare/v1.18.4...v1.18.5
[1.18.4]: https://github.com/Automattic/jetpack-status/compare/v1.18.3...v1.18.4
[1.18.3]: https://github.com/Automattic/jetpack-status/compare/v1.18.2...v1.18.3
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-status/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"link-template": "https://github.com/Automattic/jetpack-status/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "1.18.x-dev"
"dev-trunk": "1.19.x-dev"
}
}
}
15 changes: 15 additions & 0 deletions jetpack_vendor/automattic/jetpack-status/src/class-host.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,19 @@ public function get_calypso_env() {

return '';
}

/**
* Return source query param value from the URL if exists in the allowed sources list.
*
* @return string "source" query param value
*/
public function get_source_query() {
// phpcs:disable WordPress.Security.NonceVerification.Recommended
$allowed_sources = array( 'jetpack-manage' );
if ( isset( $_GET['source'] ) && in_array( $_GET['source'], $allowed_sources, true ) ) {
return sanitize_key( $_GET['source'] );
}

return '';
}
}
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-sync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.59.0",
"automattic/jetpack-connection": "^1.60.0-alpha",
"automattic/jetpack-constants": "^1.6.23",
"automattic/jetpack-identity-crisis": "^0.11.2",
"automattic/jetpack-password-checker": "^0.2.14",
"automattic/jetpack-ip": "^0.1.6",
"automattic/jetpack-roles": "^1.4.25",
"automattic/jetpack-status": "^1.18.5"
"automattic/jetpack-status": "^1.19.0-alpha"
},
"require-dev": {
"automattic/jetpack-changelogger": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '1.59.0',
'ver' => '1.60.0-alpha1699613065',
),
'jetpack-idc' => array(
'path' => 'jetpack_vendor/automattic/jetpack-identity-crisis',
Expand Down
4 changes: 2 additions & 2 deletions vendor/automattic/jetpack-plans/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"type": "library",
"license": "GPL-2.0-or-later",
"require": {
"automattic/jetpack-connection": "^1.59.0"
"automattic/jetpack-connection": "^1.60.0-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "^3.3.11",
"automattic/jetpack-status": "^1.18.5",
"automattic/jetpack-status": "^1.19.0-alpha",
"automattic/wordbless": "@dev"
},
"suggest": {
Expand Down
Loading

0 comments on commit 3c9c6d0

Please sign in to comment.