Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acquia_dam-3499668
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
acquia_dam-3499668
Commits
62ddaf7b
Unverified
Commit
62ddaf7b
authored
1 year ago
by
Matt Glaman
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
DIT-1366
SQLSanitize hook to remove authentication data (
#213
)
parent
8b005ec9
No related branches found
Branches containing commit
Tags
1.0.10
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drush.services.yml
+6
-0
6 additions, 0 deletions
drush.services.yml
src/Commands/SqlSanitizeCommands.php
+57
-0
57 additions, 0 deletions
src/Commands/SqlSanitizeCommands.php
with
63 additions
and
0 deletions
drush.services.yml
0 → 100644
+
6
−
0
View file @
62ddaf7b
services
:
acquia_dam.sql_sanitize
:
class
:
Drupal\acquia_dam\Commands\SqlSanitizeCommands
arguments
:
[
'
@acquia_dam.authentication_service'
]
tags
:
-
{
name
:
drush.command
}
This diff is collapsed.
Click to expand it.
src/Commands/SqlSanitizeCommands.php
0 → 100644
+
57
−
0
View file @
62ddaf7b
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\acquia_dam\Commands
;
use
Consolidation\AnnotatedCommand\CommandData
;
use
Drupal\acquia_dam
\AcquiadamAuthService
;
use
Drush\Commands\DrushCommands
;
use
Drush\Drupal\Commands\sql\SanitizePluginInterface
;
use
Symfony\Component\Console\Input\InputInterface
;
/**
* Acquia DAM integration to SQL sanitize for Drush.
*/
final
class
SqlSanitizeCommands
extends
DrushCommands
implements
SanitizePluginInterface
{
/**
* The auth service.
*
* @var \Drupal\acquia_dam\AcquiadamAuthService
*/
private
AcquiadamAuthService
$authService
;
/**
* Constructs a new SqlSanitizeCommands object.
*
* @param \Drupal\acquia_dam\AcquiadamAuthService $auth_service
* The auth service.
*/
public
function
__construct
(
AcquiadamAuthService
$auth_service
)
{
parent
::
__construct
();
$this
->
authService
=
$auth_service
;
}
/**
* Removes Acquia DAM authentication information from the database.
*
* {@inheritdoc}
*
* @hook post-command sql-sanitize
*/
public
function
sanitize
(
$result
,
CommandData
$commandData
):
void
{
$this
->
authService
->
disconnectSiteAndUsers
();
$this
->
logger
()
->
success
(
dt
(
'Acquia DAM authentication information remove.'
));
}
/**
* {@inheritdoc}
*
* @hook on-event sql-sanitize-confirms
*/
public
function
messages
(
&
$messages
,
InputInterface
$input
)
:
void
{
$messages
[]
=
dt
(
'Remove Acquia DAM authentication information.'
);
}
}
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