예제 #1
0
if ENV.bool('PLUGIN_MOKEY', default=False):
    #------------------------------------------------------------------------------
    # Enable Mokey/Hydra OpenID Connect Authentication Backend
    #------------------------------------------------------------------------------
    INSTALLED_APPS += [
        'coldfront.plugins.mokey_oidc',
    ]

    AUTHENTICATION_BACKENDS += [
        'coldfront.plugins.mokey_oidc.auth.OIDCMokeyAuthenticationBackend',
    ]
else:
    AUTHENTICATION_BACKENDS += [
        'mozilla_django_oidc.auth.OIDCAuthenticationBackend',
    ]

MIDDLEWARE += [
    'mozilla_django_oidc.middleware.SessionRefresh',
]

OIDC_OP_JWKS_ENDPOINT = ENV.str('OIDC_OP_JWKS_ENDPOINT')
OIDC_RP_SIGN_ALGO = ENV.str('OIDC_RP_SIGN_ALGO')
OIDC_RP_CLIENT_ID = ENV.str('OIDC_RP_CLIENT_ID')
OIDC_RP_CLIENT_SECRET = ENV.str('OIDC_RP_CLIENT_SECRET')
OIDC_OP_AUTHORIZATION_ENDPOINT = ENV.str('OIDC_OP_AUTHORIZATION_ENDPOINT')
OIDC_OP_TOKEN_ENDPOINT = ENV.str('OIDC_OP_TOKEN_ENDPOINT')
OIDC_OP_USER_ENDPOINT = ENV.str('OIDC_OP_USER_ENDPOINT')
OIDC_VERIFY_SSL = ENV.bool('OIDC_VERIFY_SSL', default=True)
OIDC_RENEW_ID_TOKEN_EXPIRY_SECONDS = ENV.int(
    'OIDC_RENEW_ID_TOKEN_EXPIRY_SECONDS', default=3600)
예제 #2
0
파일: email.py 프로젝트: ubccr/coldfront
from coldfront.config.env import ENV

#------------------------------------------------------------------------------
# Email/Notification settings
#------------------------------------------------------------------------------
EMAIL_ENABLED = ENV.bool('EMAIL_ENABLED', default=False)
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = ENV.str('EMAIL_HOST', default='localhost')
EMAIL_PORT = ENV.int('EMAIL_PORT', default=25)
EMAIL_HOST_USER = ENV.str('EMAIL_HOST_USER', default='')
EMAIL_HOST_PASSWORD = ENV.str('EMAIL_HOST_PASSWORD', default='')
EMAIL_USE_TLS = ENV.bool('EMAIL_USE_TLS', default=False)
EMAIL_TIMEOUT = ENV.int('EMAIL_TIMEOUT', default=3)
EMAIL_SUBJECT_PREFIX = ENV.str('EMAIL_SUBJECT_PREFIX', default='[ColdFront]')
EMAIL_ADMIN_LIST = ENV.list('EMAIL_ADMIN_LIST')
EMAIL_SENDER = ENV.str('EMAIL_SENDER')
EMAIL_TICKET_SYSTEM_ADDRESS = ENV.str('EMAIL_TICKET_SYSTEM_ADDRESS')
EMAIL_DIRECTOR_EMAIL_ADDRESS = ENV.str('EMAIL_DIRECTOR_EMAIL_ADDRESS')
EMAIL_PROJECT_REVIEW_CONTACT = ENV.str('EMAIL_PROJECT_REVIEW_CONTACT')
EMAIL_DEVELOPMENT_EMAIL_LIST = ENV.list('EMAIL_DEVELOPMENT_EMAIL_LIST')
EMAIL_OPT_OUT_INSTRUCTION_URL = ENV.str('EMAIL_OPT_OUT_INSTRUCTION_URL',
                                        default='')
EMAIL_ALLOCATION_EXPIRING_NOTIFICATION_DAYS = ENV.list(
    'EMAIL_ALLOCATION_EXPIRING_NOTIFICATION_DAYS',
    cast=int,
    default=[7, 14, 30])
EMAIL_SIGNATURE = ENV.str('EMAIL_SIGNATURE', default='', multiline=True)
예제 #3
0
파일: core.py 프로젝트: ubccr/coldfront
#------------------------------------------------------------------------------
# Allocation related
#------------------------------------------------------------------------------
ALLOCATION_ENABLE_CHANGE_REQUESTS_BY_DEFAULT = ENV.bool(
    'ALLOCATION_ENABLE_CHANGE_REQUESTS', default=True)
ALLOCATION_CHANGE_REQUEST_EXTENSION_DAYS = ENV.list(
    'ALLOCATION_CHANGE_REQUEST_EXTENSION_DAYS', cast=int, default=[30, 60, 90])
ALLOCATION_ENABLE_ALLOCATION_RENEWAL = ENV.bool(
    'ALLOCATION_ENABLE_ALLOCATION_RENEWAL', default=True)
ALLOCATION_FUNCS_ON_EXPIRE = [
    'coldfront.core.allocation.utils.test_allocation_function',
]

# This is in days
ALLOCATION_DEFAULT_ALLOCATION_LENGTH = ENV.int(
    'ALLOCATION_DEFAULT_ALLOCATION_LENGTH', default=365)

#------------------------------------------------------------------------------
# Allow user to select account name for allocation
#------------------------------------------------------------------------------
ALLOCATION_ACCOUNT_ENABLED = ENV.bool('ALLOCATION_ACCOUNT_ENABLED',
                                      default=False)
ALLOCATION_ACCOUNT_MAPPING = ENV.dict('ALLOCATION_ACCOUNT_MAPPING', default={})

SETTINGS_EXPORT += ['ALLOCATION_ACCOUNT_ENABLED']

ADMIN_COMMENTS_SHOW_EMPTY = ENV.bool('ADMIN_COMMENTS_SHOW_EMPTY', default=True)

#------------------------------------------------------------------------------
# List of Allocation Attributes to display on view page
#------------------------------------------------------------------------------
예제 #4
0
파일: base.py 프로젝트: ubccr/coldfront
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'simple_history.middleware.HistoryRequestMiddleware',
]

#------------------------------------------------------------------------------
# Django authentication backend. See auth.py
#------------------------------------------------------------------------------
AUTHENTICATION_BACKENDS = []

#------------------------------------------------------------------------------
# Django Q
#------------------------------------------------------------------------------
Q_CLUSTER = {
    'timeout': ENV.int('Q_CLUSTER_TIMEOUT', default=120),
    'retry': ENV.int('Q_CLUSTER_RETRY', default=120),
}


#------------------------------------------------------------------------------
# Django template and site settings
#------------------------------------------------------------------------------
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            PROJECT_ROOT('site/templates'),
            '/usr/share/coldfront/site/templates',
            PROJECT_ROOT('coldfront/templates'),
        ],