Ejemplo n.º 1
0
 def __init__(self, req, *args, **kwargs):
     super(CreateForm, self).__init__(*args, **kwargs)
     add_select(self, 'on_no_subs_pub', [
         PUBSUB.ON_NO_SUBS_PUB.ACCEPT,
         PUBSUB.ON_NO_SUBS_PUB.DROP,
     ], False)
     add_pubsub_services(self, req, by_id=True)
Ejemplo n.º 2
0
    def __init__(self, security_list=[], sec_tls_ca_cert_list={}, cache_list=[], soap_versions=SOAP_VERSIONS,
            prefix=None, post_data=None, req=None):
        super(CreateForm, self).__init__(post_data, prefix=prefix)

        self.fields['url_params_pri'].choices = []
        for value, label in url_params_priority:
            self.fields['url_params_pri'].choices.append([value, label])

        self.fields['params_pri'].choices = []
        for value, label in params_priority:
            self.fields['params_pri'].choices.append([value, label])

        self.fields['serialization_type'].choices = []
        for item in HTTP_SOAP_SERIALIZATION_TYPE():
            self.fields['serialization_type'].choices.append([item.id, item.name])

        self.fields['soap_version'].choices = []
        for name in sorted(soap_versions):
            self.fields['soap_version'].choices.append([name, name])

        self.fields['sec_tls_ca_cert_id'].choices = []
        self.fields['sec_tls_ca_cert_id'].choices.append(INITIAL_CHOICES)
        self.fields['sec_tls_ca_cert_id'].choices.append([ZATO_NONE, 'Skip validation'])

        for value, label in sec_tls_ca_cert_list.items():
            self.fields['sec_tls_ca_cert_id'].choices.append([value, label])

        self.fields['ping_method'].initial = DEFAULT_HTTP_PING_METHOD
        self.fields['pool_size'].initial = DEFAULT_HTTP_POOL_SIZE

        add_security_select(self, security_list)
        add_services(self, req)
        add_select(self, 'cache_id', cache_list)
        add_select(self, 'rate_limit_type', RATE_LIMIT.TYPE(), needs_initial_select=False)
Ejemplo n.º 3
0
 def __init__(self, prefix=None, req=None):
     super(CreateForm, self).__init__(prefix=prefix)
     add_select(self,
                'log_level',
                SFTP.LOG_LEVEL(),
                needs_initial_select=False)
     add_select(self, 'force_ip_type', SFTP.IP_TYPE())
Ejemplo n.º 4
0
    def __init__(self, req, data_list, *args, **kwargs):
        super(CreateForm, self).__init__(*args, **kwargs)

        add_select(self,
                   'endpoint_type',
                   PUBSUB.ENDPOINT_TYPE,
                   needs_initial_select=False,
                   skip=skip_endpoint_types)
        add_select(self, 'service_id', data_list.service_list)

        add_select(self, 'active_status', PUBSUB.QUEUE_ACTIVE_STATUS)
        add_select(self, 'delivery_method', PUBSUB.DELIVERY_METHOD)
        add_select(self, 'delivery_data_format', PUBSUB.DATA_FORMAT)

        add_http_soap_select(self, 'out_rest_http_soap_id', req,
                             CONNECTION.OUTGOING, URL_TYPE.PLAIN_HTTP)
        add_http_soap_select(self, 'out_soap_http_soap_id', req,
                             CONNECTION.OUTGOING, URL_TYPE.SOAP)

        add_select_from_service(self, req, 'zato.server.get-list', 'server_id')

        self.initial['endpoint_type'] = PUBSUB.ENDPOINT_TYPE.REST.id
        self.initial[
            'delivery_batch_size'] = PUBSUB.DEFAULT.DELIVERY_BATCH_SIZE
        self.initial['delivery_max_retry'] = PUBSUB.DEFAULT.DELIVERY_MAX_RETRY
        self.initial['wait_sock_err'] = PUBSUB.DEFAULT.WAIT_TIME_SOCKET_ERROR
        self.initial[
            'wait_non_sock_err'] = PUBSUB.DEFAULT.WAIT_TIME_NON_SOCKET_ERROR
        self.initial['out_http_method'] = 'POST'
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(CreateForm, self).__init__(*args, **kwargs)
     add_select(self,
                'auth_mechanism',
                MONGODB.AUTH_MECHANISM(),
                needs_initial_select=False)
     add_select(self,
                'read_pref_type',
                MONGODB.READ_PREF(),
                needs_initial_select=False)
Ejemplo n.º 6
0
 def __init__(self, prefix=None, post_data=None, req=None):
     super(CreateForm, self).__init__(post_data, prefix=prefix)
     add_select(self, 'source_type', _source_type)
     add_services(self, req)
     add_topics(self, req, by_id=False)
     add_http_soap_select(self, 'outconn_rest_list', req, CONNECTION.OUTGOING, URL_TYPE.PLAIN_HTTP)
     add_select_from_service(self, req, 'zato.outgoing.ftp.get-list', 'ftp_source_id')
     add_select_from_service(self, req, 'zato.generic.connection.get-list', 'sftp_source_id', service_extra={'type_':_sftp})
     add_select_from_service(self, req, 'zato.scheduler.job.get-list', 'scheduler_job_id', service_extra={
         'service_name': FILE_TRANSFER.SCHEDULER_SERVICE
     })
Ejemplo n.º 7
0
Archivo: mllp.py Proyecto: danlg/zato
 def __init__(self, prefix=None, post_data=None, req=None):
     super(WithAuditLog, self).__init__(post_data, prefix=prefix)
     add_select(self,
                'hl7_version',
                HL7.Const.Version(),
                needs_initial_select=False)
     add_select(self,
                'logging_level',
                HL7.Const.LoggingLevel(),
                needs_initial_select=False)
     add_services(self, req)
Ejemplo n.º 8
0
Archivo: rest.py Proyecto: danlg/zato
    def __init__(self,
                 security_list=[],
                 prefix=None,
                 post_data=None,
                 req=None):
        super(WithAuditLog, self).__init__(post_data, prefix=prefix)

        add_security_select(self,
                            security_list,
                            field_name='security_id',
                            needs_rbac=False)
        add_select(self,
                   'hl7_version',
                   HL7.Const.Version(),
                   needs_initial_select=False)
        add_services(self, req)
Ejemplo n.º 9
0
    def __init__(self, req, data_list, prefix=None, post_data=None):
        super(CreateForm, self).__init__(post_data, prefix=prefix)

        self.fields['role'].choices = []
        self.fields['ws_channel_id'].choices = []

        add_security_select(self, data_list.security_list, field_name='security_id', needs_no_security=False, needs_rbac=False)
        add_select(self, 'service_id', data_list.service_list)
        add_select(self, 'ws_channel_id', data_list.ws_channel_list)
        add_select(self, 'role', PUBSUB.ROLE)
        add_select(self, 'endpoint_type', PUBSUB.ENDPOINT_TYPE, needs_initial_select=False, skip=skip_endpoint_types)

        # Let's assume the default type of pub/sub endpoint will be REST clients
        self.initial['endpoint_type'] = PUBSUB.ENDPOINT_TYPE.WEB_SOCKETS.id
Ejemplo n.º 10
0
    def __init__(self, req, select_changer_data, initial_topic_name, topic_list, initial_hook_service_name, publisher_list,
            *args, **kwargs):
        super(MsgPublishForm, self).__init__(*args, **kwargs)
        add_select(self, 'topic_name', topic_list)
        add_select(self, 'publisher_id', publisher_list)
        add_select(self, 'gd', PUBSUB.GD_CHOICE(), False)

        self.initial['topic_name'] = initial_topic_name
        self.initial['select_changer_source'] = select_changer_data
Ejemplo n.º 11
0
Archivo: sftp.py Proyecto: danlg/zato
 def __init__(self):
     super(CommandShellForm, self).__init__()
     add_select(self, 'log_level', SFTP.LOG_LEVEL(), needs_initial_select=False)
Ejemplo n.º 12
0
 def __init__(self, prefix=None, post_data=None, req=None):
     super(CreateForm, self).__init__(post_data, prefix=prefix)
     add_select(self, 'sync_method', CACHE.SYNC_METHOD())
     add_select(self, 'persistent_storage', CACHE.PERSISTENT_STORAGE())
Ejemplo n.º 13
0
    def __init__(self, *args, **kwargs):
        super(CreateForm, self).__init__(*args, **kwargs)

        add_select(self,
                   'get_info',
                   LDAP.GET_INFO(),
                   needs_initial_select=False)
        add_select(self, 'ip_mode', LDAP.IP_MODE(), needs_initial_select=False)
        add_select(self,
                   'auto_bind',
                   LDAP.AUTO_BIND(),
                   needs_initial_select=False)
        add_select(self,
                   'pool_ha_strategy',
                   LDAP.POOL_HA_STRATEGY(),
                   needs_initial_select=False)
        add_select(self,
                   'auth_type',
                   LDAP.AUTH_TYPE(),
                   needs_initial_select=False)
        add_select(self,
                   'sasl_mechanism',
                   LDAP.SASL_MECHANISM(),
                   needs_initial_select=True)
Ejemplo n.º 14
0
 def __init__(self, post_data=None, req=None):
     super(CreateForm, self).__init__(post_data)
     add_select(self, 'key_data_type', CACHE.BUILTIN_KV_DATA_TYPE())
     add_select(self, 'value_data_type', CACHE.BUILTIN_KV_DATA_TYPE())
Ejemplo n.º 15
0
    def __init__(self, prefix=None, post_data=None):
        super(CreateForm, self).__init__(post_data, prefix=prefix)

        add_select(self,
                   'get_info',
                   LDAP.GET_INFO(),
                   needs_initial_select=False)
        add_select(self, 'ip_mode', LDAP.IP_MODE(), needs_initial_select=False)
        add_select(self,
                   'auto_bind',
                   LDAP.AUTO_BIND(),
                   needs_initial_select=False)
        add_select(self,
                   'pool_ha_strategy',
                   LDAP.POOL_HA_STRATEGY(),
                   needs_initial_select=False)
        add_select(self,
                   'auth_type',
                   LDAP.AUTH_TYPE(),
                   needs_initial_select=False)
        add_select(self,
                   'sasl_mechanism',
                   LDAP.SASL_MECHANISM(),
                   needs_initial_select=True)
        add_select(self,
                   'tls_version',
                   TLS.VERSION(),
                   needs_initial_select=False)
        add_select(self,
                   'tls_validate',
                   TLS.CERT_VALIDATE(),
                   needs_initial_select=False)