Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove support for OpenID and MongoDB #2246

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ Includes:

- Database
- SQLAlchemy, multiple database support: sqlite, MySQL, ORACLE, MSSQL, DB2 etc.
- Partial support for MongoDB using MongoEngine.
- Multiple database connections support (Vertical partitioning).
- Easy mixin audit to models (created/changed by user, and timestamps).
- Security
- Automatic permissions lookup, based on exposed methods. It will grant all permissions to the Admin Role.
- Inserts on the Database all the detailed permissions possible on your application.
- Public (no authentication needed) and Private permissions.
- Role based permissions.
- Authentication support for OAuth, OpenID, Database, LDAP and REMOTE_USER environ var.
- Authentication support for OAuth, Database, LDAP and REMOTE_USER environ var.
- Support for self user registration.
- Views and Widgets
- Automatic menu generation.
Expand Down
22 changes: 0 additions & 22 deletions docs/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ configuration imports the constants for the authentication methods::
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
AUTH_OID,
AUTH_REMOTE_USER
)

Expand Down Expand Up @@ -64,25 +63,6 @@ username and hashed password field kept on your database.
Administrators can create users with passwords, and users can change their passwords. This is all done using the UI.
(You can override and extend the default UI as we'll see on *Your Custom Security*)

Authentication: OpenID
----------------------

This authentication method uses `Flask-OpenID <https://github.com/mitsuhiko/flask-openid>`_. All configuration is done
on **config.py** using OPENID_PROVIDERS key, just add or remove from the list the providers you want to enable::

AUTH_TYPE = AUTH_OID
OPENID_PROVIDERS = [
{ 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },
{ 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },
{ 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
{ 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }
]

Each list entry is a dict with a readable OpenID name and it's url, if the url needs an username just add it using <username>.
The login template for this method will provide a text box for the user to fillout his/her username.

F.A.B. will ask for the 'email' from OpenID, and if this email belongs to some user on your application he/she will login successfully.

Authentication: LDAP
--------------------

Expand Down Expand Up @@ -894,7 +874,6 @@ If you're using:
:AUTH_DB: Extend UserDBModelView
:AUTH_LDAP: Extend UserLDAPModelView
:AUTH_REMOTE_USER: Extend UserRemoteUserModelView
:AUTH_OID: Extend UserOIDModelView
:AUTH_OAUTH: Extend UserOAuthModelView

So using AUTH_DB::
Expand Down Expand Up @@ -970,7 +949,6 @@ Note that this is for AUTH_DB, so if you're using:
:AUTH_DB: Override userdbmodelview
:AUTH_LDAP: Override userldapmodelview
:AUTH_REMOTE_USER: Override userremoteusermodelview
:AUTH_OID: Override useroidmodelview

Finally (as shown on the previous example) tell F.A.B. to use your SecurityManager class, so when initializing
**AppBuilder** (on __init__.py)::
Expand Down
1 change: 0 additions & 1 deletion examples/oauth/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# AUTHENTICATION CONFIG
# ----------------------------------------------------
# The authentication type
# AUTH_OID : Is for OpenID
# AUTH_DB : Is for database (username/password()
# AUTH_LDAP : Is for LDAP
# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server
Expand Down
8 changes: 1 addition & 7 deletions examples/quickactions/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
)
from flask_appbuilder.security.manager import AUTH_DB

basedir = os.path.abspath(os.path.dirname(__file__))

Expand Down
8 changes: 1 addition & 7 deletions examples/quickhowto2/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
)
from flask_appbuilder.security.manager import AUTH_DB

basedir = os.path.abspath(os.path.dirname(__file__))

Expand Down
9 changes: 1 addition & 8 deletions examples/simpleform/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
)
from flask_appbuilder.security.manager import AUTH_DB

basedir = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -33,7 +27,6 @@
# AUTHENTICATION CONFIG
# ----------------------------------------------------
# The authentication type
# AUTH_OID : Is for OpenID
# AUTH_DB : Is for database (username/password()
# AUTH_LDAP : Is for LDAP
# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server
Expand Down
3 changes: 1 addition & 2 deletions flask_appbuilder/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from flask.cli import with_appcontext
import jinja2

from .const import AUTH_DB, AUTH_LDAP, AUTH_OAUTH, AUTH_OID, AUTH_REMOTE_USER
from .const import AUTH_DB, AUTH_LDAP, AUTH_OAUTH, AUTH_REMOTE_USER


SQLA_REPO_URL = (
Expand Down Expand Up @@ -71,7 +71,6 @@ def create_admin(username, firstname, lastname, email, password):
"""
auth_type = {
AUTH_DB: "Database Authentications",
AUTH_OID: "OpenID Authentication",
AUTH_LDAP: "LDAP Authentication",
AUTH_REMOTE_USER: "WebServer REMOTE_USER Authentication",
AUTH_OAUTH: "OAuth Authentication",
Expand Down
1 change: 0 additions & 1 deletion flask_appbuilder/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
PERMISSION_PREFIX = "can_"
""" Prefix to be concatenated to permission names, and inserted in the backend """

AUTH_OID = 0
AUTH_DB = 1
AUTH_LDAP = 2
AUTH_REMOTE_USER = 3
Expand Down
39 changes: 20 additions & 19 deletions flask_appbuilder/forms.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
import logging

from flask_wtf import FlaskForm
from wtforms import (
BooleanField,
DateField,
DateTimeField,
DecimalField,
FloatField,
IntegerField,
StringField,
TextAreaField,
from flask_appbuilder.fields import (
EnumField,
QuerySelectField,
QuerySelectMultipleField,
)
from wtforms import validators

from .fields import EnumField, QuerySelectField, QuerySelectMultipleField
from .fieldwidgets import (
from flask_appbuilder.fieldwidgets import (
BS3TextAreaFieldWidget,
BS3TextFieldWidget,
DatePickerWidget,
DateTimePickerWidget,
Select2ManyWidget,
Select2Widget,
)
from .models.mongoengine.fields import MongoFileField, MongoImageField
from .upload import (
from flask_appbuilder.upload import (
BS3FileUploadFieldWidget,
BS3ImageUploadFieldWidget,
FileUploadField,
ImageUploadField,
)
from .validators import Unique
from flask_appbuilder.validators import Unique
from flask_wtf import FlaskForm
from wtforms import (
BooleanField,
DateField,
DateTimeField,
DecimalField,
FloatField,
IntegerField,
StringField,
TextAreaField,
)
from wtforms import validators


try:
from wtforms.fields.core import _unset_value as unset_value
Expand All @@ -50,8 +53,6 @@ class FieldConverter(object):
conversion_table = (
("is_image", ImageUploadField, BS3ImageUploadFieldWidget),
("is_file", FileUploadField, BS3FileUploadFieldWidget),
("is_gridfs_file", MongoFileField, BS3FileUploadFieldWidget),
("is_gridfs_image", MongoImageField, BS3ImageUploadFieldWidget),
("is_text", TextAreaField, BS3TextAreaFieldWidget),
("is_binary", TextAreaField, BS3TextAreaFieldWidget),
("is_string", StringField, BS3TextFieldWidget),
Expand Down
Empty file.
65 changes: 0 additions & 65 deletions flask_appbuilder/models/mongoengine/fields.py

This file was deleted.

Loading
Loading