Skip to content

Commit

Permalink
Merge pull request #754 from fstagni/remove_proxy_persistency
Browse files Browse the repository at this point in the history
feat: removed proxies persistency flag
  • Loading branch information
chrisburr authored Feb 7, 2024
2 parents 0c1146e + 82de574 commit a230fe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
9 changes: 3 additions & 6 deletions src/WebAppDIRAC/WebApp/handler/ProxyManagerHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ def web_getProxyManagerData(
sortField="UserName",
username="[]",
usergroup="[]",
persistent="",
expiredBefore=0,
expiredAfter=0,
):
if self.getUserName().lower() == "anonymous":
return {"success": "false", "error": "You are not authorize to access these data"}
req = self.__prepareParameters(username, usergroup, persistent, expiredBefore, expiredAfter)
req = self.__prepareParameters(username, usergroup, expiredBefore, expiredAfter)
gLogger.info("!!! S O R T : ", sort := [[sortField, sortDirection]])
# pylint: disable=no-member
result = gProxyManager.getDBContents(req, sort, start, limit)
Expand All @@ -89,7 +88,6 @@ def web_getProxyManagerData(
"UserDN": record[1],
"UserGroup": record[2],
"ExpirationTime": str(record[3]),
"PersistentFlag": str(record[4]),
}
)
timestamp = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M [UTC]")
Expand Down Expand Up @@ -147,14 +145,13 @@ def __humanize_time(self, sec=False):
elif day > 0:
return f"{day} days"

def __prepareParameters(self, username, usergroup, persistent, expiredBefore, expiredAfter):
def __prepareParameters(self, username, usergroup, expiredBefore, expiredAfter):
req = {}
if users := list(json.loads(username)):
req["UserName"] = users
if usersgroup := list(json.loads(usergroup)):
req["UserGroup"] = usersgroup
if usersgroup and persistent in ["True", "False"]:
req["PersistentFlag"] = persistent

if expiredBefore > expiredAfter:
expiredBefore, expiredAfter = expiredAfter, expiredBefore
if expiredBefore:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ Ext.define("DIRAC.ProxyManager.classes.ProxyManager", {
type: "date",
dateFormat: "Y-m-d H:i:s",
},
{
name: "PersistentFlag",
},
],

initComponent: function () {
Expand Down Expand Up @@ -197,13 +194,6 @@ Ext.define("DIRAC.ProxyManager.classes.ProxyManager", {
}
},
},
Persistent: {
dataIndex: "PersistentFlag",
properties: {
width: 100,
sortable: true,
},
},
};

me.grid = Ext.create("Ext.dirac.utils.DiracGridPanel", {
Expand Down

0 comments on commit a230fe5

Please sign in to comment.