Skip to content

Commit

Permalink
Revert "refactor: add report:subscription:updates Cloud scope (#6403)"
Browse files Browse the repository at this point in the history
This reverts commit e1922e9.
  • Loading branch information
darcyYe authored Aug 7, 2024
1 parent e1922e9 commit bee196f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 108 deletions.
3 changes: 1 addition & 2 deletions packages/cli/src/commands/database/seed/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ export const seedTables = async (
({ name }) =>
name === CloudScope.SendSms ||
name === CloudScope.SendEmail ||
name === CloudScope.FetchCustomJwt ||
name === CloudScope.ReportSubscriptionUpdates
name === CloudScope.FetchCustomJwt
)
.map(({ id }) => id)
);
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/libraries/cloud-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@ const accessTokenResponseGuard = z.object({
* The scope here can be empty and still work, because the cloud API requests made using this client do not rely on scope verification.
* The `CloudScope.SendEmail` is added for now because it needs to call the cloud email service API.
* The `CloudScope.FetchCustomJwt` is added for now because it needs to call the cloud custom JWT service API.
* The `CloudScope.ReportSubscriptionUpdates` is added since we need to report subscription updates to the cloud.
*/
const scopes: string[] = [
CloudScope.SendEmail,
CloudScope.FetchCustomJwt,
CloudScope.ReportSubscriptionUpdates,
];
const scopes: string[] = [CloudScope.SendEmail, CloudScope.FetchCustomJwt];
const accessTokenExpirationMargin = 60;

/** The library for connecting to Logto Cloud service. */
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions packages/schemas/src/seeds/cloud-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export enum CloudScope {
* scripts and fetch the parsed token payload.
*/
FetchCustomJwt = 'fetch:custom:jwt',
/**
* The entity can report changes on Stripe subscription to Logto Cloud.
*/
ReportSubscriptionUpdates = 'report:subscription:updates',
/** The user can see and manage affiliates, including create, update, and delete. */
ManageAffiliate = 'manage:affiliate',
/** The user can create new affiliates and logs. */
Expand Down Expand Up @@ -74,10 +70,6 @@ export const createCloudApi = (): Readonly<[UpdateAdminData, ...CreateScope[]]>
CloudScope.FetchCustomJwt,
'Allow accessing external resource to execute JWT payload customizer script and fetch the parsed token payload.'
),
buildScope(
CloudScope.ReportSubscriptionUpdates,
'Allow reporting changes on Stripe subscription to Logto Cloud.'
),
buildScope(CloudScope.CreateAffiliate, 'Allow creating new affiliates and logs.'),
buildScope(
CloudScope.ManageAffiliate,
Expand Down

0 comments on commit bee196f

Please sign in to comment.