Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple_oauth
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
simple_oauth
Commits
e8bda9de
Commit
e8bda9de
authored
6 months ago
by
Ide Braakman
Committed by
Bojan Bogdanovic
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve
#3454338
"Support drush 12"
parent
b0dcf6c4
No related branches found
No related tags found
1 merge request
!147
Resolve #3454338 "Support drush 12"
Pipeline
#327949
passed with warnings
6 months ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
composer.json
+1
-8
1 addition, 8 deletions
composer.json
drush.services.yml
+0
-6
0 additions, 6 deletions
drush.services.yml
src/Drush/Commands/SimpleOauthCommands.php
+11
-35
11 additions, 35 deletions
src/Drush/Commands/SimpleOauthCommands.php
with
12 additions
and
49 deletions
composer.json
+
1
−
8
View file @
e8bda9de
...
...
@@ -17,12 +17,5 @@
"name"
:
"Mateu Aguiló Bosch"
,
"email"
:
"mateu.aguilo.bosch@gmail.com"
}
],
"extra"
:
{
"drush"
:
{
"services"
:
{
"drush.services.yml"
:
"^9 || ^10 || ^11"
}
}
}
]
}
This diff is collapsed.
Click to expand it.
drush.services.yml
deleted
100644 → 0
+
0
−
6
View file @
b0dcf6c4
services
:
simple_oauth_commands
:
class
:
Drupal\simple_oauth\Drush\Commands\SimpleOauthCommands
arguments
:
[
'
@simple_oauth.key.generator'
,
'
@file_system'
]
tags
:
-
{
name
:
drush.command
}
This diff is collapsed.
Click to expand it.
src/Drush/Commands/SimpleOauthCommands.php
+
11
−
35
View file @
e8bda9de
...
...
@@ -2,59 +2,35 @@
namespace
Drupal\simple_oauth\Drush\Commands
;
use
Drupal\Component\DependencyInjection\ContainerInterface
;
use
Drupal\simple_oauth
\Service\Exception\ExtensionNotLoadedException
;
use
Drupal\simple_oauth
\Service\Exception\FilesystemValidationException
;
use
Drupal\simple_oauth
\Service\KeyGeneratorService
;
use
Drush\Attributes
as
CLI
;
use
Drush\Commands\AutowireTrait
;
use
Drush\Commands\DrushCommands
;
use
Symfony\Component\DependencyInjection\Attribute\Autowire
;
/**
* Drush commands for Simple OAuth.
*/
class
SimpleOauthCommands
extends
DrushCommands
{
/**
* The key generator.
*
* @var \Drupal\simple_oauth\Service\KeyGeneratorService
*/
private
KeyGeneratorService
$keygen
;
use
AutowireTrait
;
/**
* SimpleOauthCommands constructor.
*
* @param \Drupal\simple_oauth\Service\KeyGeneratorService $keygen
* The key generator service.
*/
public
function
__construct
(
KeyGeneratorService
$keygen
)
{
public
function
__construct
(
#
[
Autowire
(
service
:
'simple_oauth.key.generator'
)]
protected
KeyGeneratorService
$keygen
,
)
{
parent
::
__construct
();
$this
->
keygen
=
$keygen
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
):
self
{
return
new
static
(
$container
->
get
(
'simple_oauth.key.generator'
)
);
}
/**
* Generate Oauth2 Keys.
*
* @param string $keypath
* The full path or a file stream were the key files will be saved.
*
* @usage simple-oauth:generate-keys /var/www/drupal-example.org/keys
* Creates the keys in the /var/www/drupal-example.org/keys directory.
*
* @command simple-oauth:generate-keys
* @aliases so:generate-keys, sogk
*
* @validate-module-enabled simple_oauth
*/
public
function
generateKeys
(
string
$keypath
)
{
#[CLI\Argument(name: 'keypath', description: 'The full path or a file stream where the key files will be saved.')]
#[CLI\Command(name: 'simple-oauth:generate-keys', aliases: ['so:generate-keys', 'sogk'])]
#[CLI\Usage(name: 'simple-oauth:generate-keys /var/www/drupal-example.org/keys', description: 'Creates the keys in the /var/www/drupal-example.org/keys directory.')]
public
function
generateKeys
(
string
$keypath
):
void
{
try
{
$this
->
keygen
->
generateKeys
(
$keypath
);
$this
->
logger
()
->
notice
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment