Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oauth2_client
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
oauth2_client
Commits
06d47ec9
Commit
06d47ec9
authored
1 year ago
by
David Basham
Committed by
Shawn Duncan
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3347425
by zerbash, FatherShawn: Config is not storing key module dependencies correctly
parent
8f12686f
No related branches found
No related tags found
1 merge request
!13
Issue #3347425: Config is not storing key module dependencies correctly
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Entity/Oauth2Client.php
+5
-2
5 additions, 2 deletions
src/Entity/Oauth2Client.php
src/Service/CredentialProvider.php
+17
-1
17 additions, 1 deletion
src/Service/CredentialProvider.php
with
22 additions
and
3 deletions
src/Entity/Oauth2Client.php
+
5
−
2
View file @
06d47ec9
...
...
@@ -176,8 +176,11 @@ class Oauth2Client extends ConfigEntityBase implements Oauth2ClientInterface {
*/
public
function
calculateDependencies
()
{
parent
::
calculateDependencies
();
if
(
!
empty
(
$this
->
credential_provider
)
&&
!
empty
(
$this
->
credential_storage_key
)
&&
$this
->
credential_provider
===
'key'
)
{
$this
->
addDependency
(
'config'
,
$this
->
credential_storage_key
);
/** @var \Drupal\oauth2_client\Service\CredentialProvider $credentials */
$credentials
=
\Drupal
::
service
(
'oauth2_client.service.credentials'
);
$dependencyName
=
$credentials
->
getCredentialDependencyName
(
$this
->
oauth2_client_plugin_id
);
if
(
!
empty
(
$dependencyName
))
{
$this
->
addDependency
(
'config'
,
$dependencyName
);
}
return
$this
;
}
...
...
This diff is collapsed.
Click to expand it.
src/Service/CredentialProvider.php
+
17
−
1
View file @
06d47ec9
...
...
@@ -52,7 +52,23 @@ class CredentialProvider {
* True if the KeyRepository is present.
*/
public
function
additionalProviders
():
bool
{
return
isset
(
$this
->
keyRepository
)
&&
$this
->
keyRepository
instanceof
KeyRepositoryInterface
;
return
isset
(
$this
->
keyRepository
);
}
public
function
getCredentialDependencyName
(
string
$pluginId
):
?string
{
$dependency
=
NULL
;
if
(
$this
->
additionalProviders
())
{
$config
=
$this
->
entityTypeManager
->
getStorage
(
'oauth2_client'
)
->
load
(
$pluginId
);
$credentialProvider
=
$config
->
getCredentialProvider
();
$storageKey
=
$config
->
getCredentialStorageKey
();
if
(
$credentialProvider
===
'key'
)
{
$keyEntity
=
$this
->
keyRepository
->
getKey
(
$storageKey
);
if
(
$keyEntity
instanceof
Key
)
{
$dependency
=
$keyEntity
->
getConfigDependencyName
();
}
}
}
return
$dependency
;
}
/**
...
...
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