dream-userdb

This is the user database of the Dream Platform.

dreamuserdb.authbackend

class dreamuserdb.authbackend.LegacyPasswordBackend
authenticate(**credentials)

dreamuserdb.decorators

dreamuserdb.decorators.template_from_domain(template_var_name='template_name', template_name=None)

dreamuserdb.middleware

class dreamuserdb.middleware.InsertDreamUser

Inserts Dream User to variable normally containing framework user, if possible

process_request(request)
class dreamuserdb.middleware.OrganisationSelectMiddleware
get_organisation_from_session(request)
process_request(request)

dreamuserdb.models

class dreamuserdb.models.Service(*args, **kwargs)

Service represents the SP in SAML lingo

Variables:
  • name (str) – The person sending the message
  • title (str) – The recipient of the message
  • public (bool) – The body of the message
  • user (dreamuserdb.User) – account which represent the service when the service is accessing the API or otherwise doing something in the system.
  • entity_id (str) – The name of the SP in SAML and it usually is the URL of the SP metadata endpoint
QuerySet.for_user(user)

Filters all Service objects which are for user.

QuerySet.for_user_public(user)

Filters all Service objects which are for user and are public.

user_can_access(user)

Return True if user has access to this service

class dreamuserdb.models.ServicePermission(*args, **kwargs)

ServicePermission(id, created, modified, name, entity, action, service_id)

class dreamuserdb.models.Organisation(*args, **kwargs)

Organisation(id, created, modified, name, title, registration_allowed, default_service_id, source, override_username_cleanup)

class dreamuserdb.models.User(*args, **kwargs)

User(id, username, first_name, last_name, email, password, is_staff, is_active, is_superuser, last_login, date_joined, user_ptr_id, created, modified, phone_number, theme_color, picture_url, profile_picture, password_md5, locale, override_username_cleanup, default_service_id, active_organisation_id, source)

class dreamuserdb.models.Role(*args, **kwargs)

Role(id, created, modified, name, title, organisation_id, source, official)

class dreamuserdb.models.Group(*args, **kwargs)

Group(id, created, modified, name, title, organisation_id, source, official)

class dreamuserdb.models.AuthProvider(*args, **kwargs)

AuthProvider(id, organisation_id)

class dreamuserdb.models.GoogleUser(*args, **kwargs)

#7810: User should have separate username for Google

dreamuserdb.permissions

Utility to map between django.contrib.auth.models.Permission and ServicePermission

dreamuserdb.permissions.permission_to_servicepermission(permission, service)
dreamuserdb.permissions.servicepermission_to_permission(servicepermission)

dreamuserdb.settings

dreamuserdb.utils

dreamuserdb.utils.domain_based_template_name(base_domain, template_name)
dreamuserdb.utils.get_domain_from_request(request, kwargs={})

dreamuserdb.validators

dreamuserdb.validators.is_username_google_compatible(username)
dreamuserdb.validators.is_username_long_enough(username)
dreamuserdb.validators.is_username_proper(username)

dreamuserdb.view_utils

class dreamuserdb.view_utils.DomainTemplateMixin
dispatch(request, *args, **kwargs)
get_template_names()

dreamuserdb.views

dreamuserdb.views.set_organisation_in_session(request, *args, **kwargs)

dreamuserdb.api1

dreamuserdb.api1.handlers

dreamuserdb.api1.urls

dreamuserdb.api2

dreamuserdb.api2.resources

dreamuserdb.management.commands

dreamuserdb.management.commands.csv_import_users

class dreamuserdb.management.commands.csv_import_users.Command
create_user(data)
create_username(data)
dryrun_user(data)
handle(*args, **options)
option_list = (<Option at 0x7f9fafba86c8: -v/--verbosity>, <Option at 0x7f9fafba8710: --settings>, <Option at 0x7f9fafba8758: --pythonpath>, <Option at 0x7f9fafba87a0: --traceback>, <Option at 0x7f9fafba8b00: --run>, <Option at 0x7f9fafba8dd0: --override>, <Option at 0x7f9fafba8ab8: --verbose>, <Option at 0x7f9fafbb2098: --only-update>)

dreamuserdb.management.commands.ensure_dream_user

class dreamuserdb.management.commands.ensure_dream_user.Command
handle(*args, **options)

dreamuserdb.management.commands.generate_test_data

dreamuserdb.management.commands.import_old_database

class dreamuserdb.management.commands.import_old_database.Client
checksum(**kwargs)
get_organisations()
get_users(**filter)
class dreamuserdb.management.commands.import_old_database.Command
handle_noargs(*args, **kwargs)
dreamuserdb.management.commands.import_old_database.no_empty(value)

dreamuserdb.management.commands.populate_service_permissions

class dreamuserdb.management.commands.populate_service_permissions.Command
handle(*args, **options)
help = 'Iterate through existing Permissions and create respective ServicePermission'