|
|
@ -1,9 +1,10 @@
|
|
|
|
import datetime
|
|
|
|
# Init Section
|
|
|
|
|
|
|
|
gUserNameStr = "SUPERTOKEN" # User name
|
|
|
|
|
|
|
|
gDomainNameStr = "" # DOMAIN or EMPTY str
|
|
|
|
|
|
|
|
gDomainIsDefaultBool = False # If domain is exist and is default (default = you can type login without domain name)
|
|
|
|
|
|
|
|
gAuthTokenPermanentStr = "1992-04-03-0643-ru-b4ff-openrpa52zzz" # Set the permanent Auth token if it is needed, or empty
|
|
|
|
def SettingsUpdate(inDict):
|
|
|
|
def SettingsUpdate(inDict):
|
|
|
|
##################################################
|
|
|
|
lRuleDomainUserDict = {
|
|
|
|
#""/"SuperToken" MethodMatchURLList
|
|
|
|
|
|
|
|
l__SuperToken_RuleMethodMatchURLBeforeList={
|
|
|
|
|
|
|
|
("","SUPERTOKEN"): { #!!!!!only in upper case!!!!
|
|
|
|
|
|
|
|
"MethodMatchURLBeforeList": [
|
|
|
|
"MethodMatchURLBeforeList": [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"Method":"GET",
|
|
|
|
"Method":"GET",
|
|
|
@ -19,17 +20,20 @@ def SettingsUpdate(inDict):
|
|
|
|
#"FlagAccessDefRequestGlobalAuthenticate": TestDef
|
|
|
|
#"FlagAccessDefRequestGlobalAuthenticate": TestDef
|
|
|
|
"FlagAccess": True
|
|
|
|
"FlagAccess": True
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
],
|
|
|
|
|
|
|
|
"ControlPanelKeyAllowedList": ["TestControlPanel", "RobotRDPActive","RobotScreenActive", "ControlPanel_Template"] # If empty - all is allowed
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# Case add domain + user
|
|
|
|
#Append to global list
|
|
|
|
inDict["Server"]["AccessUsers"]["RuleDomainUserDict"].update({(gDomainNameStr.upper(),gUserNameStr.upper()):lRuleDomainUserDict})
|
|
|
|
inDict["Server"]["AccessUsers"]["RuleDomainUserDict"].update(l__SuperToken_RuleMethodMatchURLBeforeList)
|
|
|
|
if gDomainIsDefaultBool:
|
|
|
|
|
|
|
|
# Case add default domain + user
|
|
|
|
|
|
|
|
inDict["Server"]["AccessUsers"]["RuleDomainUserDict"].update({("",gUserNameStr.upper()):lRuleDomainUserDict})
|
|
|
|
#"<AuthToken>":{"User":"", "Domain":"", "TokenDatetime":<Datetime>}
|
|
|
|
#"<AuthToken>":{"User":"", "Domain":"", "TokenDatetime":<Datetime>}
|
|
|
|
#!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
#!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
#Attention: default supertoken is 1992-04-03-0643-ru-b4ff-openrpa52zzz - please change it when you will customize OpenRPA in your company
|
|
|
|
#Attention: default supertoken is 1992-04-03-0643-ru-b4ff-openrpa52zzz - please change it when you will customize OpenRPA in your company
|
|
|
|
#!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
#!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
inDict["Server"]["AccessUsers"]["AuthTokensDict"].update(
|
|
|
|
inDict["Server"]["AccessUsers"]["AuthTokensDict"].update(
|
|
|
|
{"1992-04-03-0643-ru-b4ff-openrpa52zzz":{"User":"SuperToken", "Domain":"", "TokenDatetime": datetime.datetime.now(), "FlagDoNotExpire":True}}
|
|
|
|
{gAuthTokenPermanentStr:{"User":gUserNameStr, "Domain":gDomainNameStr, "TokenDatetime": datetime.datetime.now(), "FlagDoNotExpire":True}}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#Return current dict
|
|
|
|
#Return current dict
|
|
|
|
return inDict
|
|
|
|
return inDict
|