Skip to content

Commit

Permalink
Merge "createOAuthConsumer script: add support for owner-only consume…
Browse files Browse the repository at this point in the history
…r creation"
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Nov 9, 2024
2 parents b3a3628 + ed12943 commit 0f90ae7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion maintenance/createOAuthConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public function __construct() {
$this->addOption( 'grants', 'Grants', true, true, false, true );
$this->addOption( 'jsonOnSuccess', 'Output successful results as JSON' );
$this->addOption( 'approve', 'Accept the consumer' );
$this->addOption(
'ownerOnly',
'Make the consumer only usable by the given user; see ' .
'https://www.mediawiki.org/wiki/OAuth/Owner-only_consumers.'
);
$this->requireExtension( "OAuth" );
}

Expand All @@ -78,7 +83,7 @@ public function execute() {
'callbackIsPrefix' => $this->hasOption( 'callbackIsPrefix' ),
'grants' => '["' . implode( '","', $this->getOption( 'grants' ) ) . '"]',
'granttype' => 'normal',
'ownerOnly' => false,
'ownerOnly' => $this->hasOption( 'ownerOnly' ),
// Only support OAuth 1 for now, but that requires valid values for OAuth 2 fields
'oauth2IsConfidential' => true,
'oauth2GrantTypes' => [ 'authorization_code', 'refresh_token' ],
Expand Down

0 comments on commit 0f90ae7

Please sign in to comment.