Skip to content

Commit cece7cc

Browse files
committed
fix: add x509Chain to credDict
1 parent 0012df0 commit cece7cc

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/DIRAC/Core/Tornado/Server/private/BaseRequestHandler.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ def _gatherPeerCredentials(self, grants: list = None) -> dict:
737737
raise Exception("; ".join(err))
738738

739739
def _authzSSL(self):
740-
"""Load client certchain in DIRAC and extract informations.
740+
"""Load client certchain in DIRAC and extract information.
741741
742742
:return: S_OK(dict)/S_ERROR()
743743
"""
@@ -768,6 +768,22 @@ def _authzSSL(self):
768768

769769
credDict = res["Value"]
770770

771+
credDict["x509Chain"] = peerChain
772+
res = peerChain.isProxy()
773+
if not res["OK"]:
774+
return res
775+
credDict["isProxy"] = res["Value"]
776+
777+
if credDict["isProxy"]:
778+
credDict["DN"] = credDict["identity"]
779+
else:
780+
credDict["DN"] = credDict["subject"]
781+
782+
res = peerChain.isLimitedProxy()
783+
if not res["OK"]:
784+
return res
785+
credDict["isLimitedProxy"] = res["Value"]
786+
771787
# We check if client sends extra credentials...
772788
if "extraCredentials" in self.request.arguments:
773789
extraCred = self.get_argument("extraCredentials")
@@ -776,7 +792,7 @@ def _authzSSL(self):
776792
return S_OK(credDict)
777793

778794
def _authzJWT(self, accessToken=None):
779-
"""Load token claims in DIRAC and extract informations.
795+
"""Load token claims in DIRAC and extract information.
780796
781797
:param str accessToken: access_token
782798

src/DIRAC/FrameworkSystem/Agent/ProxyRenewalAgent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
""" ProxyRenewalAgent keeps the proxy repository clean.
22
33
.. literalinclude:: ../ConfigTemplate.cfg
4-
:start-after: ##BEGIN MyProxyRenewalAgent
4+
:start-after: ##BEGIN ProxyRenewalAgent
55
:end-before: ##END
66
:dedent: 2
7-
:caption: MyProxyRenewalAgent options
7+
:caption: ProxyRenewalAgent options
88
"""
99
import concurrent.futures
1010

0 commit comments

Comments
 (0)