Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drd_agent
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
drd_agent
Commits
53b5c485
Commit
53b5c485
authored
1 year ago
by
Jürgen Haas
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3398042
by danielspeicher, jurgenhaas: Coding standards for PHP Stan Level 6 and CS
parent
c7a0f104
No related branches found
Branches containing commit
Tags
8.x-1.0
No related merge requests found
Pipeline
#42289
passed
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Agent/Action/Base.php
+16
-9
16 additions, 9 deletions
src/Agent/Action/Base.php
with
16 additions
and
9 deletions
src/Agent/Action/Base.php
+
16
−
9
View file @
53b5c485
...
...
@@ -28,6 +28,13 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*/
class
Base
implements
BaseInterface
,
ContainerInjectionInterface
{
// The following 3 constants are required by DRD to build and verify the auth
// method in the client handshake.
// @see \Drupal\drd_pi\DrdPiAccountInterface::getAuthorizationMethod
public
const
SEC_AUTH_ACQUIA
=
'Acquia'
;
public
const
SEC_AUTH_PANTHEON
=
'Pantheon'
;
public
const
SEC_AUTH_PLATFORMSH
=
'PlatformSH'
;
/**
* The debug mode.
*
...
...
@@ -45,9 +52,9 @@ class Base implements BaseInterface, ContainerInjectionInterface {
/**
* Crypt object for this DRD request.
*
* @var \Drupal\drd_agent\Crypt\BaseMethodInterface
* @var \Drupal\drd_agent\Crypt\BaseMethodInterface
|bool
*/
protected
BaseMethodInterface
$crypt
;
protected
BaseMethodInterface
|
bool
$crypt
;
/**
* The account switcher.
...
...
@@ -241,7 +248,7 @@ class Base implements BaseInterface, ContainerInjectionInterface {
throw
new
\RuntimeException
(
'Can not read input'
);
}
$input
=
json_decode
(
base64_decode
(
$raw_input
),
TRUE
);
$input
=
json_decode
(
base64_decode
(
$raw_input
),
TRUE
,
512
,
JSON_THROW_ON_ERROR
);
if
(
!
is_array
(
$input
)
||
empty
(
$input
))
{
throw
new
\RuntimeException
(
'Input is empty'
);
}
...
...
@@ -324,7 +331,7 @@ class Base implements BaseInterface, ContainerInjectionInterface {
$actionObject
=
$classname
::
create
(
$this
->
container
);
$actionObject
->
init
(
$this
->
crypt
,
$this
->
arguments
,
$this
->
debugMode
);
}
catch
(
\Exception
$ex
)
{
catch
(
\Exception
)
{
$this
->
watchdog
(
'Not yet implemented: '
.
$action
,
[],
3
);
header
(
'HTTP/1.1 403 Not found'
);
print
'Not yet implemented'
;
...
...
@@ -484,18 +491,18 @@ class Base implements BaseInterface, ContainerInjectionInterface {
* {@inheritdoc}
*/
public
function
ott
(
string
$ott
,
string
$remoteSetupToken
):
bool
{
$
o
tt
=
$this
->
state
->
get
(
'drd_agent.ott'
,
FALSE
);
if
(
!
$
o
tt
)
{
$
storedO
tt
=
$this
->
state
->
get
(
'drd_agent.ott'
,
FALSE
);
if
(
!
$
storedO
tt
)
{
$this
->
watchdog
(
'No OTT available'
,
[],
RfcLogLevel
::
ERROR
);
return
FALSE
;
}
$this
->
state
->
delete
(
'drd_agent.ott'
);
if
(
empty
(
$
o
tt
[
'expires'
])
||
$
o
tt
[
'expires'
]
<
$this
->
time
->
getRequestTime
())
{
if
(
empty
(
$
storedO
tt
[
'expires'
])
||
$
storedO
tt
[
'expires'
]
<
$this
->
time
->
getRequestTime
())
{
$this
->
watchdog
(
'OTT expired'
,
[],
RfcLogLevel
::
ERROR
);
return
FALSE
;
}
if
(
empty
(
$
o
tt
[
'token'
])
||
$
o
tt
[
'token'
]
!==
$ott
)
{
$this
->
watchdog
(
'Token missmatch: :local / :remote'
,
[
':local'
=>
$
o
tt
[
'token'
],
':remote'
=>
$ott
],
RfcLogLevel
::
ERROR
);
if
(
empty
(
$
storedO
tt
[
'token'
])
||
$
storedO
tt
[
'token'
]
!==
$ott
)
{
$this
->
watchdog
(
'Token missmatch: :local / :remote'
,
[
':local'
=>
$
storedO
tt
[
'token'
],
':remote'
=>
$ott
],
RfcLogLevel
::
ERROR
);
return
FALSE
;
}
...
...
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