mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-22 22:03:54 +03:00
Fixes
This commit is contained in:
commit
46b6bb2305
@ -232,13 +232,17 @@ class Authenticators(ModelHandler):
|
|||||||
self, fields: typing.Dict[str, typing.Any]
|
self, fields: typing.Dict[str, typing.Any]
|
||||||
) -> None: # pylint: disable=too-many-branches,too-many-statements
|
) -> None: # pylint: disable=too-many-branches,too-many-statements
|
||||||
logger.debug(self._params)
|
logger.debug(self._params)
|
||||||
try:
|
if fields['mfa_id']:
|
||||||
mfa = MFA.objects.get(
|
try:
|
||||||
uuid=processUuid(fields['mfa_id'])
|
mfa = MFA.objects.get(
|
||||||
)
|
uuid=processUuid(fields['mfa_id'])
|
||||||
fields['mfa_id'] = mfa.id
|
)
|
||||||
except Exception: # not found
|
fields['mfa_id'] = mfa.id
|
||||||
del fields['mfa_id']
|
return
|
||||||
|
except MFA.DoesNotExist:
|
||||||
|
pass # will set field to null
|
||||||
|
|
||||||
|
fields['mfa_id'] = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,6 +93,26 @@ class InternalDBAuth(auths.Authenticator):
|
|||||||
tab=gui.ADVANCED_TAB,
|
tab=gui.ADVANCED_TAB,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def getIp(self) -> str:
|
||||||
|
ip = (
|
||||||
|
getRequest().ip_proxy if self.acceptProxy.isTrue() else getRequest().ip
|
||||||
|
) # pylint: disable=maybe-no-member
|
||||||
|
if self.reverseDns.isTrue():
|
||||||
|
try:
|
||||||
|
return str(
|
||||||
|
dns.resolver.query(dns.reversename.from_address(ip).to_text(), 'PTR')[0]
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return ip
|
||||||
|
|
||||||
|
def mfaIdentifier(self, username: str) -> str:
|
||||||
|
try:
|
||||||
|
self.dbAuthenticator().users.get(name=username, state=State.ACTIVE).mfaData
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return ''
|
||||||
|
|
||||||
def transformUsername(self, username: str, request: 'ExtendedHttpRequest') -> str:
|
def transformUsername(self, username: str, request: 'ExtendedHttpRequest') -> str:
|
||||||
if self.differentForEachHost.isTrue():
|
if self.differentForEachHost.isTrue():
|
||||||
newUsername = (
|
newUsername = (
|
||||||
|
@ -141,7 +141,7 @@ class SMSMFA(mfas.MFA):
|
|||||||
label=_('SMS response OK regex'),
|
label=_('SMS response OK regex'),
|
||||||
order=30,
|
order=30,
|
||||||
tooltip=_(
|
tooltip=_(
|
||||||
'Regex for SMS response OK. If emty, the response is considered OK if status code is 200.'
|
'Regex for SMS response OK. If empty, the response is considered OK if status code is 200.'
|
||||||
),
|
),
|
||||||
required=False,
|
required=False,
|
||||||
tab=_('HTTP Response'),
|
tab=_('HTTP Response'),
|
||||||
@ -183,7 +183,7 @@ class SMSMFA(mfas.MFA):
|
|||||||
rows=5,
|
rows=5,
|
||||||
order=32,
|
order=32,
|
||||||
tooltip=_('Networks for SMS authentication'),
|
tooltip=_('Networks for SMS authentication'),
|
||||||
required=True,
|
required=False,
|
||||||
tab=_('Config'),
|
tab=_('Config'),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -222,6 +222,10 @@ class SMSMFA(mfas.MFA):
|
|||||||
)
|
)
|
||||||
# Any other value means no authentication
|
# Any other value means no authentication
|
||||||
|
|
||||||
|
# If set ignoreCertificateErrors, do it
|
||||||
|
if self.ignoreCertificateErrors.isTrue():
|
||||||
|
session.verify = False
|
||||||
|
|
||||||
# Add headers. Headers are in the form of "Header: Value". (without the quotes)
|
# Add headers. Headers are in the form of "Header: Value". (without the quotes)
|
||||||
if self.headersParameters.value.strip():
|
if self.headersParameters.value.strip():
|
||||||
for header in self.headersParameters.value.split('\n'):
|
for header in self.headersParameters.value.split('\n'):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012-2019 Virtual Cable S.L.
|
# Copyright (c) 2012-2022 Virtual Cable S.L.U.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without modification,
|
# Redistribution and use in source and binary forms, with or without modification,
|
||||||
@ -72,6 +72,16 @@ downloadsManager().registerDownloadable(
|
|||||||
'application/x-debian-package',
|
'application/x-debian-package',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
downloadsManager().registerDownloadable(
|
||||||
|
'udsactor-unmanaged-{version}-1.noarch.rpm'.format(version=VERSION),
|
||||||
|
_(
|
||||||
|
'UDS Actor for Centos, Fedora, RH, Suse, ... Linux machines. Used ONLY for static machines. <b>(Requires python >= 3.6)</b>'
|
||||||
|
),
|
||||||
|
os.path.dirname(typing.cast(str, sys.modules[__package__].__file__))
|
||||||
|
+ '/files/udsactor-unmanaged-{version}-1.noarch.rpm'.format(version=VERSION),
|
||||||
|
'application/x-redhat-package-manager',
|
||||||
|
)
|
||||||
|
|
||||||
downloadsManager().registerDownloadable(
|
downloadsManager().registerDownloadable(
|
||||||
'udsactor_2.2.0_legacy.deb',
|
'udsactor_2.2.0_legacy.deb',
|
||||||
_(
|
_(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user