Revert "1) Added support for Kerberos authentication, using SPNEGO to forward the Kerberos tickets through a browser. Fixes #5457"

This reverts commit 6ead597b43.
This commit is contained in:
Akshay Joshi
2021-01-14 14:46:59 +05:30
parent 6ead597b43
commit f0debdd513
22 changed files with 40 additions and 474 deletions

View File

@@ -13,7 +13,7 @@ import simplejson as json
import re
from flask import render_template, request, \
url_for, Response, abort, current_app, session
url_for, Response, abort, current_app
from flask_babelex import gettext as _
from flask_security import login_required, roles_required, current_user
from flask_security.utils import encrypt_password
@@ -24,8 +24,7 @@ from pgadmin.utils import PgAdminModule
from pgadmin.utils.ajax import make_response as ajax_response, \
make_json_response, bad_request, internal_server_error, forbidden
from pgadmin.utils.csrf import pgCSRFProtect
from pgadmin.utils.constants import MIMETYPE_APP_JS, INTERNAL,\
SUPPORTED_AUTH_SOURCES, KERBEROS
from pgadmin.utils.constants import MIMETYPE_APP_JS
from pgadmin.utils.validation_utils import validate_email
from pgadmin.model import db, Role, User, UserPreference, Server, \
ServerGroup, Process, Setting
@@ -168,13 +167,11 @@ def current_user_info():
config.SERVER_MODE is True
else 'postgres'
),
allow_save_password='true' if
config.ALLOW_SAVE_PASSWORD and session['allow_save_password']
allow_save_password='true' if config.ALLOW_SAVE_PASSWORD
else 'false',
allow_save_tunnel_password='true' if
config.ALLOW_SAVE_TUNNEL_PASSWORD and session[
'allow_save_password'] else 'false',
auth_sources=config.AUTHENTICATION_SOURCES
allow_save_tunnel_password='true'
if config.ALLOW_SAVE_TUNNEL_PASSWORD else 'false',
auth_sources=config.AUTHENTICATION_SOURCES,
),
status=200,
mimetype=MIMETYPE_APP_JS
@@ -257,10 +254,10 @@ def _create_new_user(new_data):
:return: Return new created user.
"""
auth_source = new_data['auth_source'] if 'auth_source' in new_data \
else INTERNAL
else current_app.PGADMIN_DEFAULT_AUTH_SOURCE
username = new_data['username'] if \
'username' in new_data and auth_source != \
INTERNAL else new_data['email']
current_app.PGADMIN_DEFAULT_AUTH_SOURCE else new_data['email']
email = new_data['email'] if 'email' in new_data else None
password = new_data['password'] if 'password' in new_data else None
@@ -282,7 +279,7 @@ def _create_new_user(new_data):
def create_user(data):
if 'auth_source' in data and data['auth_source'] != \
INTERNAL:
current_app.PGADMIN_DEFAULT_AUTH_SOURCE:
req_params = ('username', 'role', 'active', 'auth_source')
else:
req_params = ('email', 'role', 'active', 'newPassword',
@@ -383,7 +380,7 @@ def update(uid):
)
# Username and email can not be changed for internal users
if usr.auth_source == INTERNAL:
if usr.auth_source == current_app.PGADMIN_DEFAULT_AUTH_SOURCE:
non_editable_params = ('username', 'email')
for f in non_editable_params:
@@ -466,7 +463,7 @@ def role(rid):
)
def auth_sources():
sources = []
for source in SUPPORTED_AUTH_SOURCES:
for source in current_app.PGADMIN_SUPPORTED_AUTH_SOURCE:
sources.append({'label': source, 'value': source})
return ajax_response(