Google and LinkedIn oauth support
[astakos] / snf-astakos-app / astakos / im / settings.py
index b698c11..197fd75 100644 (file)
@@ -4,9 +4,20 @@ from django.conf import settings
 # to be this many hours after their creation time.
 AUTH_TOKEN_DURATION = getattr(settings, 'ASTAKOS_AUTH_TOKEN_DURATION', 30 * 24)
 
-# Authenticate via Twitter.
-TWITTER_KEY = getattr(settings, 'ASTAKOS_TWITTER_KEY', '')
+# OAuth2 Twitter credentials.
+TWITTER_TOKEN = getattr(settings, 'ASTAKOS_TWITTER_TOKEN', '')
 TWITTER_SECRET = getattr(settings, 'ASTAKOS_TWITTER_SECRET', '')
+TWITTER_AUTH_FORCE_LOGIN = getattr(settings, 'ASTAKOS_TWITTER_AUTH_FORCE_LOGIN',
+                                  False)
+
+
+# OAuth2 Google credentials.
+GOOGLE_CLIENT_ID = getattr(settings, 'ASTAKOS_GOOGLE_CLIENT_ID', '')
+GOOGLE_SECRET = getattr(settings, 'ASTAKOS_GOOGLE_SECRET', '')
+
+# OAuth2 LinkedIn credentials.
+LINKEDIN_TOKEN = getattr(settings, 'ASTAKOS_LINKEDIN_TOKEN', '')
+LINKEDIN_SECRET = getattr(settings, 'ASTAKOS_LINKEDIN_SECRET', '')
 
 DEFAULT_USER_LEVEL = getattr(settings, 'ASTAKOS_DEFAULT_USER_LEVEL', 4)
 
@@ -23,13 +34,14 @@ DEFAULT_CONTACT_EMAIL = getattr(
     settings, 'ASTAKOS_DEFAULT_CONTACT_EMAIL', 'support@cloud.grnet.gr')
 
 # Identity Management enabled modules
-IM_MODULES = getattr(settings, 'ASTAKOS_IM_MODULES', ['local', 'shibboleth'])
+# Supported modules are: 'local', 'twitter' and 'shibboleth'
+IM_MODULES = getattr(settings, 'ASTAKOS_IM_MODULES', ['local'])
 
 # Force user profile verification
 FORCE_PROFILE_UPDATE = getattr(settings, 'ASTAKOS_FORCE_PROFILE_UPDATE', True)
 
 #Enable invitations
-INVITATIONS_ENABLED = getattr(settings, 'ASTAKOS_INVITATIONS_ENABLED', True)
+INVITATIONS_ENABLED = getattr(settings, 'ASTAKOS_INVITATIONS_ENABLED', False)
 
 COOKIE_NAME = getattr(settings, 'ASTAKOS_COOKIE_NAME', '_pithos2_a')
 COOKIE_DOMAIN = getattr(settings, 'ASTAKOS_COOKIE_DOMAIN', None)
@@ -52,7 +64,7 @@ RECAPTCHA_PRIVATE_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PRIVATE_KEY', '')
 RECAPTCHA_OPTIONS = getattr(settings, 'ASTAKOS_RECAPTCHA_OPTIONS',
                             {'theme': 'custom', 'custom_theme_widget': 'okeanos_recaptcha'})
 RECAPTCHA_USE_SSL = getattr(settings, 'ASTAKOS_RECAPTCHA_USE_SSL', True)
-RECAPTCHA_ENABLED = getattr(settings, 'ASTAKOS_RECAPTCHA_ENABLED', True)
+RECAPTCHA_ENABLED = getattr(settings, 'ASTAKOS_RECAPTCHA_ENABLED', False)
 
 # set AstakosUser fields to propagate in the billing system
 BILLING_FIELDS = getattr(settings, 'ASTAKOS_BILLING_FIELDS', ['is_active'])
@@ -129,7 +141,8 @@ PASSWORD_RESET_EMAIL_SUBJECT = getattr(
     'Password reset on %s alpha2 testing' % SITENAME)
 
 # Set the quota holder component URI
-QUOTA_HOLDER_URL = getattr(settings, 'ASTAKOS_QUOTA_HOLDER_URL', '')
+QUOTAHOLDER_URL = getattr(settings, 'ASTAKOS_QUOTAHOLDER_URL', '')
+QUOTAHOLDER_TOKEN = getattr(settings, 'ASTAKOS_QUOTAHOLDER_TOKEN', '')
 
 # Set the cloud service properties
 SERVICES = getattr(settings, 'ASTAKOS_SERVICES', {
@@ -183,6 +196,9 @@ AQUARIUM_URL = getattr(settings, 'ASTAKOS_AQUARIUM_URL', '')
 # Set how many objects should be displayed per page
 PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8)
 
+# Set how many objects should be displayed per page in show all groups page
+PAGINATE_BY_ALL = getattr(settings, 'ASTAKOS_PAGINATE_BY_ALL', 15)
+
 # Enforce token renewal on password change/reset
 NEWPASSWD_INVALIDATE_TOKEN = getattr(
     settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
@@ -192,62 +208,82 @@ RESOURCES_PRESENTATION_DATA = getattr(
     settings, 'ASTAKOS_RESOURCES_PRESENTATION_DATA', {
         'groups': {
              'compute': {
-                'help_text':'group compute help text',
+                'help_text':'Compute resources (amount of VMs, CPUs, RAM, System disk) ',
                 'is_abbreviation':False,
                 'report_desc':'',
-                 'verbose_name':'compute', 
+                 'verbose_name':'compute',
             },
             'storage': {
-                'help_text':'group storage help text',
+                'help_text':'Storage resources (amount of space to store files on Pithos) ',
                 'is_abbreviation':False,
                 'report_desc':'',
-                 'verbose_name':'storage', 
+                 'verbose_name':'storage',
+            },
+            'network': {
+                'help_text':' Network resources (amount of Private Networks)  ',
+                'is_abbreviation':False,
+                'report_desc':'',
+                'verbose_name':'network',
             },
         },
         'resources': {
             'pithos+.diskspace': {
-                'help_text':'resource pithos+.diskspace help text',
+                'help_text':'This is the space on Pithos for storing files and VM Images. ',
+                'help_text_input_each':'This is the total amount of space on Pithos that will be granted to each user of this Project ',
                 'is_abbreviation':False,
-                'report_desc':'Pithos+ Diskspace',
+                'report_desc':'Storage Space',
                 'placeholder':'eg. 10GB',
-                'verbose_name':'diskspace', 
+                'verbose_name':'Storage Space',
             },
             'cyclades.vm': {
-                'help_text':'resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text',
+                'help_text':'These are the VMs one can create on the Cyclades UI ',
+                'help_text_input_each':'This is the total number of VMs that will be granted to each user of this Project ',
                 'is_abbreviation':True,
                 'report_desc':'Virtual Machines',
                 'placeholder':'eg. 2',
-                'verbose_name':'vm', 
+                'verbose_name':'vm',
             },
             'cyclades.disk': {
-                'help_text':'resource cyclades.disk help text',
+                'help_text':'This is the System Disk that the VMs have that run the OS ',
+                'help_text_input_each':"This is the total amount of System Disk that will be granted to each user of this Project (this refers to the total System Disk of all VMs, not each VM's System Disk)  ",
                 'is_abbreviation':False,
-                'report_desc':'Disk',
+                'report_desc':'System Disk',
                 'placeholder':'eg. 5GB, 2GB etc',
-                'verbose_name':'disk'
+                'verbose_name':'System Disk'
             },
             'cyclades.ram': {
-                'help_text':'resource cyclades.ram help text',
+                'help_text':'RAM used by VMs ',
+                'help_text_input_each':'This is the total amount of RAM that will be granted to each user of this Project (on all VMs)  ',
                 'is_abbreviation':True,
                 'report_desc':'RAM',
                 'placeholder':'eg. 4GB',
                 'verbose_name':'ram'
             },
             'cyclades.cpu': {
-                'help_text':'resource cyclades.cpu help text',
+                'help_text':'CPUs used by VMs ',
+                'help_text_input_each':'This is the total number of CPUs that will be granted to each user of this Project (on all VMs)  ',
                 'is_abbreviation':True,
                 'report_desc':'CPUs',
                 'placeholder':'eg. 1',
                 'verbose_name':'cpu'
             },
             'cyclades.network.private': {
-                'help_text':'resource cyclades.network.private help text',
+                'help_text':'These are the Private Networks one can create on the Cyclades UI. ',
+                'help_text_input_each':'This is the total number of Private Networks that will be granted to each user of this Project ',
                 'is_abbreviation':False,
-                'report_desc':'Network',
+                'report_desc':'Private Networks',
                 'placeholder':'eg. 1',
                 'verbose_name':'private network'
             }
-        
+
         }
-        
+
     })
+
+# Permit local account migration
+ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True)
+
+# Strict shibboleth usage
+SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings,
+                                       'ASTAKOS_SHIBBOLETH_REQUIRE_NAME_INFO',
+                                       False)