Skip to content

Commit

Permalink
feat: Follow upstream DiracX API changes for legacy-exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Oct 9, 2023
1 parent 87af7fd commit 9bc6b2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def export_exchangeProxyForToken(self):

try:
r = requests.get(
f"{diracxUrl}/auth/legacy-exchange",
f"{diracxUrl}/api/auth/legacy-exchange",
params={
"preferred_username": credDict["username"],
"scope": " ".join(scopes),
Expand Down
4 changes: 3 additions & 1 deletion src/DIRAC/FrameworkSystem/Utilities/diracx.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _get_token(credDict, diracxUrl, /) -> Path:
scopes = [f"vo:{vo}", f"group:{group}"] + [f"property:{prop}" for prop in dirac_properties]

r = requests.get(
f"{diracxUrl}/auth/legacy-exchange",
f"{diracxUrl}/api/auth/legacy-exchange",
params={
"preferred_username": credDict["username"],
"scope": " ".join(scopes),
Expand Down Expand Up @@ -71,6 +71,8 @@ def TheImpersonator(credDict: dict[str, Any]) -> DiracClient:
"""

diracxUrl = gConfig.getValue("/DiracX/URL")
if not diracxUrl:
raise ValueError("Missing mandatory /DiracX/URL configuration")
token_location = _get_token(credDict, diracxUrl)
pref = DiracxPreferences(url=diracxUrl, credentials_path=token_location)

Expand Down

0 comments on commit 9bc6b2f

Please sign in to comment.