Feature Description
The new Reader Revenue Manager Express Setup flow performs write operations (creating a publication and a CTA), which need an additional OAuth scope beyond the current read-only one. Add the subscribewithgoogle.publications.entitlements.manage scope to the Reader Revenue Manager module, require it for express setup, and request it when the user enters the express setup flow.
For reference, see the Infrastructure section in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The Reader Revenue Manager module declares the new write scope
https://www.googleapis.com/auth/subscribewithgoogle.publications.entitlements.manage.
- The scope is required only for express setup, gated on the
rrmExpressSetup flag, so the standard RRM setup is unaffected.
- When the user enters the express setup flow, Site Kit requests the write scope via OAuth if it has not already been granted.
- With the flag off, the module's required scopes are unchanged.
Implementation Brief
Test Coverage
- Update tests for
create-info-store selector tests.
- Update
core/modules activation tests:
- Update tests for setup CTA and entry point banners as per the changes.
- Add tests for
SetupMainExpressReady related to the changes.
QA Brief
Changelog entry
Feature Description
The new Reader Revenue Manager Express Setup flow performs write operations (creating a publication and a CTA), which need an additional OAuth scope beyond the current read-only one. Add the
subscribewithgoogle.publications.entitlements.managescope to the Reader Revenue Manager module, require it for express setup, and request it when the user enters the express setup flow.For reference, see the Infrastructure section in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
https://www.googleapis.com/auth/subscribewithgoogle.publications.entitlements.manage.rrmExpressSetupflag, so the standard RRM setup is unaffected.Implementation Brief
assets/js/modules/reader-revenue-manager/datastore/constants.jsREADONLY_SCOPEandMANAGE_SCOPEconstants for the two RRM OAuth scope strings.assets/js/hooks/useActivateModuleCallback.jsoptionssecond parameter and forward it into theactivateModuledispatch call.assets/js/googlesitekit/modules/index.jsoptionsthrough in theactivateModulewrapper so the extended signature reaches the data store action.assets/js/googlesitekit/modules/datastore/modules.jsactivateModule( slug, options )action to destructureredirectQueryArgsandadditionalScopesfromoptionsand include them in theSELECT_MODULE_REAUTH_URLcontrol payload.SELECT_MODULE_REAUTH_URLcontrol to forward both options into the module'sgetAdminReauthURLselector call.assets/js/googlesitekit/modules/create-info-store.jsgetAdminReauthURLto acceptredirectQueryArgsandadditionalScopesalongside the existingreAuthoption.redirectQueryArgsinto the admin redirect URL construction.unsatisfiedAdditionalScopesby filteringadditionalScopesthroughCORE_USER.hasScope.needsReauthenticationistrueorunsatisfiedAdditionalScopes.length > 0, passingunsatisfiedAdditionalScopesintoCORE_USER.getConnectURL.In
SetupMainExpressReady.tsx(introduced by Scaffold the RRM express setup flow #12950):expressSetup=trueis confirmed, checkCORE_USER.hasScope( READER_REVENUE_MANAGER_MANAGE_SCOPE ).setPermissionScopeErrorwithskipModal: true,scopes: [ READER_REVENUE_MANAGER_MANAGE_SCOPE ], andredirectURL: location.href— following the same immediate-OAuth-redirect pattern used inuseEnableAudienceGroup.js.AuthenticatedPermissionsModalredirects to OAuth without presenting a confirmation dialog.assets/js/modules/reader-revenue-manager/— express setup entry point banner (Implement the RRM express setup dashboard entry point #12947) and RRM setup CTA banner (Update RRM setup CTA banner for express setup #12946)useActivateModuleCallbackwith:redirectQueryArgs: { expressSetup: true, cta: 'newsletter-signup' }additionalScopes: [ MANAGE_SCOPE ]Test Coverage
create-info-storeselector tests.core/modulesactivation tests:SetupMainExpressReadyrelated to the changes.QA Brief
Changelog entry