Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/remove-webhook-trigger-shared-secret-flag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/app': major
---

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.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ export interface appwebhooktrigger {
*/
'--reset'?: ''

/**
* Deprecated. Please use client-secret.
* @environment SHOPIFY_FLAG_SHARED_SECRET
*/
'--shared-secret <value>'?: string

/**
* The requested webhook topic.
* @environment SHOPIFY_FLAG_TOPIC
Expand Down
18 changes: 1 addition & 17 deletions packages/app/src/cli/commands/app/webhook/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {appFlags} from '../../../flags.js'
import AppLinkedCommand, {AppLinkedCommandOutput} from '../../../utilities/app-linked-command.js'
import {linkedAppContext} from '../../../services/app-context.js'
import {Flags} from '@oclif/core'
import {renderWarning} from '@shopify/cli-kit/node/ui'

export default class WebhookTrigger extends AppLinkedCommand {
static summary = 'Trigger delivery of a sample webhook topic payload to a designated address.'
Expand Down Expand Up @@ -56,12 +55,6 @@ export default class WebhookTrigger extends AppLinkedCommand {
env: 'SHOPIFY_FLAG_DELIVERY_METHOD',
description: `Method chosen to deliver the topic payload. If not passed, it's inferred from the address.`,
}),
'shared-secret': Flags.string({
required: false,
hidden: false,
env: 'SHOPIFY_FLAG_SHARED_SECRET',
description: `Deprecated. Please use client-secret.`,
}),
'client-secret': Flags.string({
required: false,
hidden: false,
Expand All @@ -83,15 +76,6 @@ export default class WebhookTrigger extends AppLinkedCommand {
public async run(): Promise<AppLinkedCommandOutput> {
const {flags} = await this.parse(WebhookTrigger)

if (flags['shared-secret']) {
renderWarning({
headline: [
'The flag shared-secret has been deprecated in favor of client-secret and will eventually be deleted.',
],
body: ['Please use --client-secret instead.'],
})
}

const appContextResult = await linkedAppContext({
directory: flags.path,
clientId: flags['client-id'],
Expand All @@ -106,7 +90,7 @@ export default class WebhookTrigger extends AppLinkedCommand {
deliveryMethod: flags['delivery-method'],
address: flags.address,
clientId: flags['client-id'],
clientSecret: flags['client-secret'] || flags['shared-secret'], // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing -- empty flag should try next
clientSecret: flags['client-secret'],
path: flags.path,
config: flags.config,
organizationId: appContextResult.organization.id,
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ Trigger delivery of a sample webhook topic payload to a designated address.
USAGE
$ shopify app webhook trigger [--address <value>] [--api-version <value>] [--client-id <value> | -c <value>]
[--client-secret <value>] [--delivery-method http|google-pub-sub|event-bridge] [--help] [--path <value>] [--reset |
] [--shared-secret <value>] [--topic <value>]
] [--topic <value>]

FLAGS
-c, --config=<value>
Expand Down Expand Up @@ -1016,9 +1016,6 @@ FLAGS
--reset
[env: SHOPIFY_FLAG_RESET] Reset all your settings.

--shared-secret=<value>
[env: SHOPIFY_FLAG_SHARED_SECRET] Deprecated. Please use client-secret.

--topic=<value>
[env: SHOPIFY_FLAG_TOPIC] The requested webhook topic.

Expand Down
20 changes: 0 additions & 20 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3113,16 +3113,6 @@
"name": "reset",
"type": "boolean"
},
"shared-secret": {
"description": "Deprecated. Please use client-secret.",
"env": "SHOPIFY_FLAG_SHARED_SECRET",
"hasDynamicHelp": false,
"hidden": false,
"multiple": false,
"name": "shared-secret",
"required": false,
"type": "option"
},
"topic": {
"description": "The requested webhook topic.",
"env": "SHOPIFY_FLAG_TOPIC",
Expand Down Expand Up @@ -8410,16 +8400,6 @@
"name": "reset",
"type": "boolean"
},
"shared-secret": {
"description": "Deprecated. Please use client-secret.",
"env": "SHOPIFY_FLAG_SHARED_SECRET",
"hasDynamicHelp": false,
"hidden": false,
"multiple": false,
"name": "shared-secret",
"required": false,
"type": "option"
},
"topic": {
"description": "The requested webhook topic.",
"env": "SHOPIFY_FLAG_TOPIC",
Expand Down
Loading