Skip to content

Commit

Permalink
feat: removed proxies persistency flag
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Jan 22, 2024
1 parent 6a17d22 commit 82de574
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 82de574

Please sign in to comment.