Пример #1
0
 class SimpleIO:
     input_optional = (List('page'), List('size'), List('sort'),
                       List('filters'), List('operator'))
     output_optional = ('id', Date('date_from'), Date('date_to'),
                        'base_price', 'bed_price', 'published', 'days')
     output_repeated = True
     skip_empty_keys = True
Пример #2
0
 class SimpleIO:
     input_required = ('username', 'password', List('app_list'))
     input_optional = ('email',)
     output_required = ('is_valid',)
     output_optional = (List('sub_status'), 'return_status')
     encrypt_secrets = False
     response_elem = None
Пример #3
0
 class SimpleIO:
     input_required = ('topic_name',)
     input_optional = (AsIs('data'), List('data_list'), AsIs('msg_id'), 'has_gd', Int('priority'), Int('expiration'),
         'mime_type', AsIs('correl_id'), 'in_reply_to', AsIs('ext_client_id'), 'ext_pub_time', 'pub_pattern_matched',
         'security_id', 'ws_channel_id', 'service_id', 'data_parsed', 'meta', AsIs('group_id'),
         Int('position_in_group'), 'endpoint_id', List('reply_to_sk'), List('deliver_to_sk'))
     output_optional = (AsIs('msg_id'), List('msg_id_list'))
Пример #4
0
    class SimpleIO:
        input_required = (AsIs('should_as_is'), 'is_boolean', 'should_boolean',
                          CSV('csv1'), Dict('dict'), Float('float'),
                          Integer('integer'), Integer('integer2'),
                          List('list'), ListOfDicts('list_of_dicts'),
                          Unicode('unicode1'), Unicode('unicode2'), UTC('utc'))

        output_required = (AsIs('should_as_is'),
                           'is_boolean', 'should_boolean', CSV('csv1'),
                           CSV('csv2'), CSV('csv3'), Dict('dict'),
                           Float('float'), Integer('integer'),
                           Integer('integer2'), List('list'),
                           ListOfDicts('list_of_dicts'), Unicode('unicode1'),
                           Unicode('unicode2'), UTC('utc'))
Пример #5
0
 class SimpleIO(object):
     input_required = (Integer('guests'), Date('check_in'),
                       Date('check_out'), Integer('id_room'), 'uuid',
                       'name', 'surname', 'email')
     input_optional = ('status', 'meal_plan', List('extras', default=[]),
                       'gender', 'passport', Date('birthdate'), 'address1',
                       'address2', 'locality', 'postcode', 'province',
                       'country', 'home_phone', 'mobile_phone')
     output_optional = (
         Dict(
             'booking',
             # 'id', 'id_guest', 'id_room', DateTime('reserved'),
             # 'guests', Date('check_in'), Date('check_out'),
             # DateTime('checked_in'), DateTime('checked_out'),
             # DateTime('cancelled'), 'base_price', 'taxes_percentage',
             # 'taxes_value', 'total_price', 'locator', 'pin', 'status',
             # 'meal_plan', Dict('extras'),
             # 'uuid' # JSON serializaction error
             # https://forum.zato.io/t/returning-uuid-types-from-services-using-json/1735
             # 'nights'
         ),
         Dict(
             'guest',
             # 'id',  'name', 'surname', 'gender', 'email', 'passport',
             # Date('birthdate'), 'address1', 'address2', 'locality',
             # 'postcode', 'province', 'country', 'home_phone',
             # 'mobile_phone'
         ),
         Dict(
             'room',
             # 'id', 'floor_no', 'room_no', 'sgl_beds', 'dbl_beds',
             # 'supplement', 'code', 'name', 'accommodates', 'number'
         ),
         Dict('error'))
     skip_empty_keys = True
Пример #6
0
def _get_sio_msg():

    meta = (Int('limit'), 'next', Int('offset'), 'previous',
            Int('total_count'))

    location = Nested('location', 'building',
                      Bool('confidential'), 'flat_number', 'level',
                      Dict('point', 'lat', 'non'), 'postcode', 'state',
                      'street_name', 'street_number', 'street_suffix',
                      'street_type', 'suburb', 'unit')

    phones = ListOfDicts('phones', 'comment', Bool('confidential'), 'kind',
                         'number')

    postal_address = Dict('postal_address', Bool('confidential'), 'line1',
                          'line2', 'postcode', 'state', 'suburb')

    objects = (List('also_known_as'), 'catchment', 'description',
               ListOfDicts('emails'), Int('id'), Bool('is_mobile'),
               'last_updated', location, 'name', Bool('ndis_approved'),
               Dict('organisation', 'id',
                    'name'), 'parking_info', phones, postal_address,
               'provider_type', 'public_transport_info', 'type', 'web')

    return [Nested('meta', meta), Nested('objects', objects)]
Пример #7
0
class BaseSIO:
    """ A set of attributes common to all SSO services.
    """
    encrypt_secrets = False
    response_elem = None
    skip_empty_keys = True
    output_optional = ('cid', 'status', List('sub_status'))
Пример #8
0
 def test_sio_list_data_type_input_xml(self):
     cid = rand_string()
     data_format = DATA_FORMAT.XML
     transport = rand_string()
     
     sio_config = {'int_parameters': [rand_string()]} # Not really used but needed
     
     service_sio = Bunch()
     service_sio.input_required = ('first_name', 'last_name', List('emails'))
     
     expected_first_name = faker.first_name()
     expected_last_name = faker.last_name()
     expected_emails = sorted([faker.email(), faker.email()])
     
     r = Request(getLogger(__name__), sio_config)
     r.payload = etree.fromstring("""<request>
       <first_name>{}</first_name>
       <last_name>{}</last_name>
       <emails>
        <item>{}</item>
        <item>{}</item>
       </emails>
     </request>""".format(
         expected_first_name, expected_last_name, expected_emails[0], expected_emails[1]))
     
     r.init(True, cid, service_sio, data_format, transport, {})
     
     eq_(r.input.first_name, expected_first_name)
     eq_(r.input.last_name, expected_last_name)
     eq_(r.input.emails, expected_emails)
Пример #9
0
 def test_sio_list_data_type_input_json(self):
     cid = rand_string()
     data_format = DATA_FORMAT.JSON
     transport = rand_string()
     
     sio_config = {'int_parameters': [rand_string()]} # Not really used but needed
     
     service_sio = Bunch()
     service_sio.input_required = ('first_name', 'last_name', List('emails'))
     
     expected_first_name = faker.first_name()
     expected_last_name = faker.last_name()
     expected_emails = sorted([faker.email(), faker.email()])
     
     r = Request(getLogger(__name__), sio_config)
     r.payload = {
         'first_name': expected_first_name,
         'last_name': expected_last_name,
         'emails': expected_emails,
         }
     
     r.init(True, cid, service_sio, data_format, transport, {})
     
     eq_(r.input.first_name, expected_first_name)
     eq_(r.input.last_name, expected_last_name)
     eq_(r.input.emails, expected_emails)
Пример #10
0
 class SimpleIO:
     output_required = 'id', 'name', 'is_active', 'is_internal', 'url_path'
     output_optional = 'service_id', 'service_name', 'security_id', 'security_name', 'sec_type', \
         'method', 'soap_action', 'soap_version', 'data_format', 'host', 'ping_method', 'pool_size', 'merge_url_params_req', \
         'url_params_pri', 'params_pri', 'serialization_type', 'timeout', 'sec_tls_ca_cert_id', Boolean('has_rbac'), \
         'content_type', Boolean('sec_use_rbac'), 'cache_id', 'cache_name', Integer('cache_expiry'), 'cache_type', \
         'content_encoding', Boolean('match_slash'), 'http_accept', List('service_whitelist'), 'is_rate_limit_active', \
             'rate_limit_type', 'rate_limit_def', Boolean('rate_limit_check_parent_def')
Пример #11
0
 class SimpleIO(_CtxInputUsing.SimpleIO):
     input_required = ('ust', 'current_app')
     input_optional = (AsIs('user_id'), 'username', 'email', 'display_name', 'first_name', 'middle_name', 'last_name',
         'sign_up_status', 'approval_status', Bool('paginate'), Int('cur_page'), Int('page_size'), 'name_op',
         'is_name_exact')
     output_required = ('status',)
     output_optional = BaseSIO.output_optional + (Int('total'), Int('num_pages'), Int('page_size'), Int('cur_page'),
         'has_next_page', 'has_prev_page', Int('next_page'), Int('prev_page'), List('result'))
     default_value = _invalid
Пример #12
0
 class SimpleIO(object):
     input_required = (Date('check_in'), Date('check_out'),
                       Integer('guests'))
     input_optional = (List('rooms'))
     output_optional = ('id', 'number', 'name', 'sgl_beds', 'dbl_beds',
                        'accommodates', 'code', 'nights', 'price',
                        'taxes_percentage', 'taxes_value', 'total_price')
     skip_empty_keys = True
     output_repeated = True
Пример #13
0
 class SimpleIO:
     input_optional = (List('page'), List('size'), List('sort'),
                       List('filters'), List('fields'), List('operator'),
                       List('search'))
     output_optional = ('id', 'username', 'name', 'surname', 'email',
                        'is_admin', 'count')
     skip_empty_keys = True
     output_repeated = True
Пример #14
0
 class SimpleIO(AdminSIO):
     request_elem = 'zato_security_get_list_request'
     response_elem = 'zato_security_get_list_response'
     input_required = ('cluster_id',)
     input_optional = (List('sec_type'), Boolean('needs_internal', default=True))
     output_required = ('id', 'name', 'is_active', 'sec_type')
     output_optional = ('username', 'realm', 'password_type',
         Boolean('reject_empty_nonce_creat'), Boolean('reject_stale_tokens'), Integer('reject_expiry_limit'),
         Integer('nonce_freshness_time'), 'proto_version', 'sig_method', Integer('max_nonce_log'))
     output_repeated = True
Пример #15
0
 class SimpleIO(AdminSIO):
     request_elem = 'zato_http_soap_edit_request'
     response_elem = 'zato_http_soap_edit_response'
     input_required = 'id', 'cluster_id', 'name', 'is_active', 'connection', 'transport', 'url_path'
     input_optional = 'service', 'security_id', 'method', 'soap_action', 'soap_version', 'data_format', \
         'host', 'ping_method', 'pool_size', Boolean('merge_url_params_req'), 'url_params_pri', 'params_pri', \
         'serialization_type', 'timeout', 'sec_tls_ca_cert_id', Boolean('has_rbac'), 'content_type', \
         'cache_id', Integer('cache_expiry'), 'content_encoding', Boolean('match_slash'), 'http_accept', \
         List('service_whitelist'), 'is_rate_limit_active', 'rate_limit_type', 'rate_limit_def', \
         Boolean('rate_limit_check_parent_def'), Boolean('sec_use_rbac')
     output_required = 'id', 'name'
Пример #16
0
 class SimpleIO:
     output_required = 'id', 'name', 'is_active', 'is_internal', 'url_path'
     output_optional = 'service_id', 'service_name', 'security_id', 'security_name', 'sec_type', \
         'method', 'soap_action', 'soap_version', 'data_format', 'host', 'ping_method', 'pool_size', 'merge_url_params_req', \
         'url_params_pri', 'params_pri', 'serialization_type', 'timeout', AsIs('sec_tls_ca_cert_id'), Boolean('has_rbac'), \
         'content_type', Boolean('sec_use_rbac'), 'cache_id', 'cache_name', Integer('cache_expiry'), 'cache_type', \
         'content_encoding', Boolean('match_slash'), 'http_accept', List('service_whitelist'), 'is_rate_limit_active', \
             'rate_limit_type', 'rate_limit_def', Boolean('rate_limit_check_parent_def'), \
             'hl7_version', 'json_path', 'should_parse_on_input', 'should_validate', 'should_return_errors', \
             'data_encoding', 'is_audit_log_sent_active', 'is_audit_log_received_active', \
             Integer('max_len_messages_sent'), Integer('max_len_messages_received'), \
             Integer('max_bytes_per_message_sent'), Integer('max_bytes_per_message_received')
Пример #17
0
 class SimpleIO:
     input_optional = (List('page'), List('size'), List('sort'),
                       List('filters'), List('fields'), List('operator'))
     # Fields projection makes all output fields optional
     output_optional = (
         'id',
         'id_guest',
         'id_room',
         DateTime('reserved'),
         'guests',
         Date('check_in'),
         Date('check_out'),
         DateTime('checked_in'),
         DateTime('checked_out'),
         DateTime('cancelled'),
         'base_price',
         'taxes_percentage',
         'taxes_value',
         'total_price',
         'locator',
         'pin',
         'status',
         'meal_plan',
         Dict('extras'),
         'uuid',
         # UUID('uuid'),
         # 'uuid' # JSON serializaction error
         # https://forum.zato.io/t/returning-uuid-types-from-services-using-json/1735
         'nights',
         'count')
     skip_empty_keys = True
     output_repeated = True
Пример #18
0
    class SimpleIO:
        input_required = (AsIs('is_a'), Boolean('b'), Bool('c'), CSV('d'),
                          Dict('e'), Float('f'), Int('g'), Integer('h'),
                          List('i'), ListOfDicts('j'), Nested('k'),
                          Opaque('l'), Unicode('m'), UTC('n'))

        input_optional = (AsIs('is_aa'), Boolean('bb'), Bool('cc'), CSV('dd'),
                          Dict('ee'), Float('ff'), Int('gg'), Integer('hh'),
                          List('ii'), ListOfDicts('jj'), Nested('kk'),
                          Opaque('ll'), Unicode('mm'), UTC('nn'))

        output_required = (AsIs('is_aaa'), Boolean('bbb'), Bool('ccc'),
                           CSV('ddd'), Dict('eee'), Float('fff'), Int('ggg'),
                           Integer('hhh'), List('iii'), ListOfDicts('jjj'),
                           Nested('kkk'), Opaque('lll'), Unicode('mmm'),
                           UTC('nnn'))

        output_optional = (AsIs('is_aaaa'), Boolean('bbbb'), Bool('cccc'),
                           CSV('dddd'), Dict('eeee'), Float('ffff'),
                           Int('gggg'), Integer('hhhh'), List('iiii'),
                           ListOfDicts('jjjj'), Nested('kkkk'), Opaque('llll'),
                           Unicode('mmmm'), UTC('nnnn'))
Пример #19
0
 class SimpleIO:
     input_optional = (List('page'), List('size'), List('sort'),
                       List('filters'), List('operator'), List('fields'),
                       List('search'))
     # Fields projection makes all output fields optional
     output_optional = ('id', 'name', 'surname', 'gender', 'email',
                        'passport', Date('birthdate'), 'address1',
                        'address2', 'locality', 'postcode', 'province',
                        'country', 'home_phone', 'mobile_phone',
                        DateTime('deleted'))
     skip_empty_keys = True
     output_repeated = True
Пример #20
0
 class SimpleIO:
     input_optional = ('topic_name', List('topic_name_list'))
     output_optional = ('sub_key', 'current_depth', 'sub_data')
     response_elem = None
     skip_empty_keys = True
Пример #21
0
 class SimpleIO(_CtxInputUsing.SimpleIO):
     input_optional = ('confirm_token', 'email', 'username', 'password',
                       'current_app', List('app_list'))
     output_optional = _CtxInputUsing.SimpleIO.output_optional + (
         'confirm_token', )
Пример #22
0
 class SimpleIO(AdminSIO):
     input_required = ('endpoint_id', 'cluster_id')
     input_optional = ('topic_filter_by', )
     output_optional = (List('topic_sub_list'), )
Пример #23
0
 class SimpleIO(AdminSIO):
     input_required = ('cluster_id', )
     input_optional = ('sub_key', List('sub_key_list'))
Пример #24
0
 class SimpleIO:
     input_required = (List('sub_key_list'), )
     output_optional = (Dict('messages'), )
Пример #25
0
 class SimpleIO(AdminSIO):
     input_required = (
         'sub_key',
         List('msg_id_list'),
     )
Пример #26
0
 class SimpleIO(AdminSIO):
     input_optional = ('sub_key', List('sub_key_list'))
     output_optional = (Dict('queue_depth'), )
Пример #27
0
 class SimpleIO(AdminSIO):
     input_required = ('sql_ws_client_id', 'channel_name',
                       AsIs('pub_client_id'), Opaque('web_socket'))
     input_optional = (List('sub_key_list'), )
     output_optional = (ListOfDicts('queue_depth'), )
Пример #28
0
 class SimpleIO(AdminSIO):
     request_elem = 'zato_http_soap_set_replace_patterns_request'
     response_elem = 'zato_http_soap_set_replace_patterns_response'
     input_required = ('id', 'audit_repl_patt_type')
     input_optional = (List('pattern_list'), )
Пример #29
0
 class SimpleIO(AdminSIO):
     request_elem = 'zato_http_soap_get_audit_replace_patterns_request'
     response_elem = 'zato_http_soap_get_audit_replace_patterns_response'
     input_required = ('id', )
     output_required = (List('patterns_json_pointer'),
                        List('patterns_xpath'))
Пример #30
0
 class SimpleIO(AdminSIO):
     input_required = List('sub_key_list')
     input_optional = 'needs_wsx_close'