mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-06 13:17: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]
|
||||
) -> None: # pylint: disable=too-many-branches,too-many-statements
|
||||
logger.debug(self._params)
|
||||
try:
|
||||
mfa = MFA.objects.get(
|
||||
uuid=processUuid(fields['mfa_id'])
|
||||
)
|
||||
fields['mfa_id'] = mfa.id
|
||||
except Exception: # not found
|
||||
del fields['mfa_id']
|
||||
if fields['mfa_id']:
|
||||
try:
|
||||
mfa = MFA.objects.get(
|
||||
uuid=processUuid(fields['mfa_id'])
|
||||
)
|
||||
fields['mfa_id'] = 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,
|
||||
)
|
||||
|
||||
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:
|
||||
if self.differentForEachHost.isTrue():
|
||||
newUsername = (
|
||||
|
@ -141,7 +141,7 @@ class SMSMFA(mfas.MFA):
|
||||
label=_('SMS response OK regex'),
|
||||
order=30,
|
||||
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,
|
||||
tab=_('HTTP Response'),
|
||||
@ -183,7 +183,7 @@ class SMSMFA(mfas.MFA):
|
||||
rows=5,
|
||||
order=32,
|
||||
tooltip=_('Networks for SMS authentication'),
|
||||
required=True,
|
||||
required=False,
|
||||
tab=_('Config'),
|
||||
)
|
||||
|
||||
@ -222,6 +222,10 @@ class SMSMFA(mfas.MFA):
|
||||
)
|
||||
# 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)
|
||||
if self.headersParameters.value.strip():
|
||||
for header in self.headersParameters.value.split('\n'):
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#
|
||||
# Copyright (c) 2012-2019 Virtual Cable S.L.
|
||||
# Copyright (c) 2012-2022 Virtual Cable S.L.U.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
@ -72,6 +72,16 @@ downloadsManager().registerDownloadable(
|
||||
'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(
|
||||
'udsactor_2.2.0_legacy.deb',
|
||||
_(
|
||||
|
Loading…
Reference in New Issue
Block a user