Skip to content

Commit 2529e74

Browse files
Remove deprecated --shared-secret flag from shopify app webhook trigger
The --shared-secret flag and SHOPIFY_FLAG_SHARED_SECRET env var on `shopify app webhook trigger` were deprecated in favor of --client-secret (SHOPIFY_FLAG_CLIENT_SECRET). This change removes them along with the deprecation warning and the fallback that copied --shared-secret into the service's clientSecret field.
1 parent 3ba2c87 commit 2529e74

5 files changed

Lines changed: 7 additions & 47 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/app': major
3+
---
4+
5+
Remove the deprecated `--shared-secret` flag and `SHOPIFY_FLAG_SHARED_SECRET` environment variable from `shopify app webhook trigger`. Use `--client-secret` (`SHOPIFY_FLAG_CLIENT_SECRET`) instead.

docs-shopify.dev/commands/interfaces/app-webhook-trigger.interface.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@ export interface appwebhooktrigger {
6363
*/
6464
'--reset'?: ''
6565

66-
/**
67-
* Deprecated. Please use client-secret.
68-
* @environment SHOPIFY_FLAG_SHARED_SECRET
69-
*/
70-
'--shared-secret <value>'?: string
71-
7266
/**
7367
* The requested webhook topic.
7468
* @environment SHOPIFY_FLAG_TOPIC

packages/app/src/cli/commands/app/webhook/trigger.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {appFlags} from '../../../flags.js'
55
import AppLinkedCommand, {AppLinkedCommandOutput} from '../../../utilities/app-linked-command.js'
66
import {linkedAppContext} from '../../../services/app-context.js'
77
import {Flags} from '@oclif/core'
8-
import {renderWarning} from '@shopify/cli-kit/node/ui'
98

109
export default class WebhookTrigger extends AppLinkedCommand {
1110
static summary = 'Trigger delivery of a sample webhook topic payload to a designated address.'
@@ -56,12 +55,6 @@ export default class WebhookTrigger extends AppLinkedCommand {
5655
env: 'SHOPIFY_FLAG_DELIVERY_METHOD',
5756
description: `Method chosen to deliver the topic payload. If not passed, it's inferred from the address.`,
5857
}),
59-
'shared-secret': Flags.string({
60-
required: false,
61-
hidden: false,
62-
env: 'SHOPIFY_FLAG_SHARED_SECRET',
63-
description: `Deprecated. Please use client-secret.`,
64-
}),
6558
'client-secret': Flags.string({
6659
required: false,
6760
hidden: false,
@@ -83,15 +76,6 @@ export default class WebhookTrigger extends AppLinkedCommand {
8376
public async run(): Promise<AppLinkedCommandOutput> {
8477
const {flags} = await this.parse(WebhookTrigger)
8578

86-
if (flags['shared-secret']) {
87-
renderWarning({
88-
headline: [
89-
'The flag shared-secret has been deprecated in favor of client-secret and will eventually be deleted.',
90-
],
91-
body: ['Please use --client-secret instead.'],
92-
})
93-
}
94-
9579
const appContextResult = await linkedAppContext({
9680
directory: flags.path,
9781
clientId: flags['client-id'],
@@ -106,7 +90,7 @@ export default class WebhookTrigger extends AppLinkedCommand {
10690
deliveryMethod: flags['delivery-method'],
10791
address: flags.address,
10892
clientId: flags['client-id'],
109-
clientSecret: flags['client-secret'] || flags['shared-secret'], // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- empty flag should try next
93+
clientSecret: flags['client-secret'],
11094
path: flags.path,
11195
config: flags.config,
11296
organizationId: appContextResult.organization.id,

packages/cli/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ Trigger delivery of a sample webhook topic payload to a designated address.
977977
USAGE
978978
$ shopify app webhook trigger [--address <value>] [--api-version <value>] [--client-id <value> | -c <value>]
979979
[--client-secret <value>] [--delivery-method http|google-pub-sub|event-bridge] [--help] [--path <value>] [--reset |
980-
] [--shared-secret <value>] [--topic <value>]
980+
] [--topic <value>]
981981
982982
FLAGS
983983
-c, --config=<value>
@@ -1016,9 +1016,6 @@ FLAGS
10161016
--reset
10171017
[env: SHOPIFY_FLAG_RESET] Reset all your settings.
10181018
1019-
--shared-secret=<value>
1020-
[env: SHOPIFY_FLAG_SHARED_SECRET] Deprecated. Please use client-secret.
1021-
10221019
--topic=<value>
10231020
[env: SHOPIFY_FLAG_TOPIC] The requested webhook topic.
10241021

packages/cli/oclif.manifest.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3113,16 +3113,6 @@
31133113
"name": "reset",
31143114
"type": "boolean"
31153115
},
3116-
"shared-secret": {
3117-
"description": "Deprecated. Please use client-secret.",
3118-
"env": "SHOPIFY_FLAG_SHARED_SECRET",
3119-
"hasDynamicHelp": false,
3120-
"hidden": false,
3121-
"multiple": false,
3122-
"name": "shared-secret",
3123-
"required": false,
3124-
"type": "option"
3125-
},
31263116
"topic": {
31273117
"description": "The requested webhook topic.",
31283118
"env": "SHOPIFY_FLAG_TOPIC",
@@ -8410,16 +8400,6 @@
84108400
"name": "reset",
84118401
"type": "boolean"
84128402
},
8413-
"shared-secret": {
8414-
"description": "Deprecated. Please use client-secret.",
8415-
"env": "SHOPIFY_FLAG_SHARED_SECRET",
8416-
"hasDynamicHelp": false,
8417-
"hidden": false,
8418-
"multiple": false,
8419-
"name": "shared-secret",
8420-
"required": false,
8421-
"type": "option"
8422-
},
84238403
"topic": {
84248404
"description": "The requested webhook topic.",
84258405
"env": "SHOPIFY_FLAG_TOPIC",

0 commit comments

Comments
 (0)