class LoggerConfig(Configuration): """ Configures how to process named logging setup. """ logdir = ConfigDescriptor( String, default=DEFAULT_LOGDIR, doc="Root directory for log files (cerebrum handlers only)") presets = ConfigDescriptor( Iterable, template=String(), default=[ DEFAULT_PRESET_DIR, ], doc="Directories with logger preset configurations") merge = ConfigDescriptor(Boolean, default=False, doc="Merge logger presets before applying" " (ini-style configs not supported)") common_preset = ConfigDescriptor( String, default='', doc="Common logger preset." " This named preset will always be applied, if available." " Set to an empty string to disable.") require_preset = ConfigDescriptor( Boolean, default=False, doc="Fail if the named logger configuration file is missing.")
class LoggingEnvironment(Configuration): """ Configuration of the logging environment. """ logging = ConfigDescriptor(Namespace, config=LoggerConfig) exceptions = ConfigDescriptor(Namespace, config=ExceptionsConfig) warnings = ConfigDescriptor(Namespace, config=WarningsConfig)
class PublisherClass(Configuration): mod = ConfigDescriptor( String, default=AMQP091Publisher.__module__, doc="Publisher module to use for publishing events") cls = ConfigDescriptor( String, default=AMQP091Publisher.__name__, doc="Publisher class to use for publishing events")
class Config(Configuration): """Configuration for dbfg_update.""" databases = ConfigDescriptor(Iterable, template=Namespace(DbConfig), doc=u"Database entries") report = ConfigDescriptor(Iterable, template=String(doc=u"Name of database"), doc=u"Databases for report")
class CIMDataSourceConfig(Configuration): """Configuration for the CIM data source.""" datasource_class = ConfigDescriptor( String, default='Cerebrum.modules.cim.datasource/CIMDataSource', doc='Data source class') spread = ConfigDescriptor( String, default="CIM_person", doc='Person must have this spread to be exported to CIM.') authoritative_systems = ConfigDescriptor( Iterable, default=["SAP"], doc='List of Authoritative systems to fetch contact information from, ' 'in decending order of priority') ou_perspective = ConfigDescriptor( String, default="SAP", doc='Perspective to use when fetching OU structure.') ou_exclude_root_from_structure = ConfigDescriptor( Boolean, default=False, doc='Exclude the root node from the OU tree') phone_country_default = ConfigDescriptor( String, default="NO", doc='Assume this phone region when otherwise unknown.') phone_authoritative_systems = ConfigDescriptor( Iterable, default=["SAP"], doc='List of Authoritative systems to fetch phone numbers from, ' 'in decending order of priority.') phone_mappings = ConfigDescriptor( Namespace, config=CIMPhoneMappingConfig) company_hierarchy = ConfigDescriptor( Iterable, template=String(), default=['company', 'department', 'subdep1', 'subdep2', 'subdep3', 'subdep4', 'subdep5', 'subdep6', 'subdep7', 'subdep8', 'subdep9', 'subdep10', ], doc='Hierarchy of field names expected by the CIM web service.')
class SAPWSConsumerConfig(Configuration): """Configuration of the WebService connectivity.""" auth_user = ConfigDescriptor( String, default=u"webservice", doc=u"Username to use when connecting to the WS.") auth_system = ConfigDescriptor( String, default='sap_ws', doc=u"The system name used for the password file, for example 'test'.")
class ExceptionsConfig(Configuration): """ Configuration for the logexc module. """ enable = ConfigDescriptor( Boolean, default=DEFAULT_CAPTURE_EXC, doc="If the logger should capture unhandled exceptions") level = ConfigDescriptor( Choice, choices=LOGLEVELS, default=DEFAULT_LEVEL_EXC, doc="Which log level to log unhandled exceptions with")
class SMSConfig(Configuration): user = ConfigDescriptor(String, default='cerebrum', doc="Username for the SMS gateway.") system = ConfigDescriptor(String, default='USIT', doc="Name of this system in the SMS gateway.") url = ConfigDescriptor(String, default='https://localhost/sms', doc="Url to the SMS gateway.")
class TypeConfig(Configuration): """Describes the types sent as argument""" name = ConfigDescriptor(String, doc=u'This type name, given as parameter to script') root = ConfigDescriptor(Iterable, template=String(), doc=u'The roots for insertion (stedkode)') recursion = ConfigDescriptor( Choice, choices=set(('recursive', 'flattened', 'nonrecursive')), doc=u'The recursion type for this ougroups') members = ConfigDescriptor( Choice, choices=set(('person', 'primary_account', 'account')), doc=u'The membership type for this ougroups') aff = ConfigDescriptor( String, doc=u'The affiliation for this (e.g. STUDENT/aktiv)') source = ConfigDescriptor( String, doc=u'The source system of affiliations') spreads = ConfigDescriptor( Iterable, template=String(), doc=u'Spreads added to groups') perspective = ConfigDescriptor( String, doc=u'Perspective code for new groups') nametemplate = ConfigDescriptor( String, doc=u'Name for groups. Use {} to insert stedkode') descriptiontemplate = ConfigDescriptor( String, doc=u'Description for groups. Use {} to insert stedkode')
class DbConfig(Configuration): """Settings for one DB.""" name = ConfigDescriptor(String, doc=u"Name of entry") dbname = ConfigDescriptor(String, doc=u"Name of database") dbuser = ConfigDescriptor(String, doc=u"Username for database connection") accessor = ConfigDescriptor(String, doc=u"Name of class to use") sync_accessor = ConfigDescriptor(String, doc=u"Member function to call") report_accessor = ConfigDescriptor(String, default=None, doc=u"Member function to call") report_missing = ConfigDescriptor(Boolean, default=True, doc=u'Report missing?') ceregroup = ConfigDescriptor(String, doc=u"Member function to call") db_charset = ConfigDescriptor(String, default=None, doc=u"Charset")
class EventConfig(Configuration): """Configuration for scim events""" issuer = ConfigDescriptor(String, default=u'Cerebrum', doc=u'Issuer field in scim') urltemplate = ConfigDescriptor(String, default='https://cerebrum.example.com/v1/' '{entity_type}/{entity_id}', doc=u'Format string for URL (use ' '{entity_type} and {entity_id} as ' 'placeholders') keytemplate = ConfigDescriptor( String, default=u'no.uio.cerebrum.scim.{entity_type}.{event}', doc=(u'Format string for routing key (use {entity_type} and {event} ' u'as placeholders'))
class JobRunnerConfig(Configuration): socket = ConfigDescriptor( String, default=pj(sys.prefix, 'var', 'lock', 'job_runner'), doc="Path to the JobRunner daemon control socket.") logdir = ConfigDescriptor(String, default=pj(sys.prefix, 'var', 'log', 'job_runner'), doc="Path to the JobRunner logs.") max_jobs = ConfigDescriptor(Integer, default=3, doc="Max simultaneous jobs in JobRunner") pause_warn = ConfigDescriptor( Numeric, default=3600 * 12, doc="Warn if JobRunner has been paused for more than N seconds.")
class AffiliationBasedValue(Configuration): """ Not used yet """ affiliation = ConfigDescriptor(String, minlen=1, doc=u'The affiliation string') max_password_age = ConfigDescriptor( Integer, default=365, minval=1, doc=u'The maximum age of a password in days for this affiliation') warn_before_expiration_days = ConfigDescriptor( Integer, default=2 * 7, minval=1, doc=(u'How many days before password expiration do we send ' 'notification for this affiliation'))
class WarningsConfig(Configuration): """ Configuration for the logwarn module. """ enable = ConfigDescriptor(Boolean, default=DEFAULT_CAPTURE_WARN, doc="If the logger should capture warnings") level = ConfigDescriptor(Choice, choices=LOGLEVELS, default=DEFAULT_LEVEL_WARN, doc="Which log level to log warnings with") filters = ConfigDescriptor(Iterable, template=WarningFilterItem(), default=[ 'always:', 'once::DeprecationWarning', 'once::PendingDeprecationWarning', 'once::ImportWarning', 'once::BytesWarning', ], doc="Ordered list of warning filters")
class ExchangeSelectionCriteria(Configuration): mailbox_spread = ConfigDescriptor( String, default=u"exchange_account", doc=u"The spread to select target accounts to Exchange by") group_spread = ConfigDescriptor( String, default=u"exchange_group", doc=u"The spread to select target groups for Exchange by") shared_mbox_spread = ConfigDescriptor( String, default=u"exch_shared_mbox", doc=u"The spread to select target shared mailboxes for Exchange by") ad_spread = ConfigDescriptor( String, default=u"AD_account", doc=u"Filter criteria for accounts") group_name_translations = ConfigDescriptor( Iterable, default=[], doc=u"Map of group name translations") randzone_publishment_group = ConfigDescriptor( String, default=None, doc=u"Mempership in this group denotes publishment " "in address book for randzone users")