synapse 2.190.0__py311-none-any.whl → 2.191.0__py311-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of synapse might be problematic. Click here for more details.

Files changed (38) hide show
  1. synapse/common.py +9 -0
  2. synapse/cortex.py +1 -0
  3. synapse/datamodel.py +8 -1
  4. synapse/lib/cell.py +7 -7
  5. synapse/lib/msgpack.py +10 -3
  6. synapse/lib/stormlib/model.py +37 -0
  7. synapse/lib/version.py +2 -2
  8. synapse/models/auth.py +2 -1
  9. synapse/models/base.py +20 -0
  10. synapse/models/crypto.py +5 -2
  11. synapse/models/economic.py +45 -11
  12. synapse/models/inet.py +78 -21
  13. synapse/models/person.py +11 -4
  14. synapse/models/risk.py +6 -0
  15. synapse/models/syn.py +22 -12
  16. synapse/models/telco.py +3 -1
  17. synapse/tests/test_cortex.py +8 -17
  18. synapse/tests/test_lib_agenda.py +1 -6
  19. synapse/tests/test_lib_cell.py +28 -4
  20. synapse/tests/test_lib_httpapi.py +2 -4
  21. synapse/tests/test_lib_lmdbslab.py +1 -4
  22. synapse/tests/test_lib_stormlib_cortex.py +1 -3
  23. synapse/tests/test_lib_stormlib_log.py +1 -6
  24. synapse/tests/test_lib_stormlib_model.py +28 -0
  25. synapse/tests/test_lib_stormtypes.py +1 -2
  26. synapse/tests/test_lib_trigger.py +2 -3
  27. synapse/tests/test_model_base.py +12 -2
  28. synapse/tests/test_model_inet.py +23 -0
  29. synapse/tests/test_model_person.py +2 -0
  30. synapse/tests/test_model_risk.py +5 -0
  31. synapse/tests/test_model_syn.py +198 -0
  32. synapse/tests/test_utils.py +23 -4
  33. synapse/tests/utils.py +39 -5
  34. {synapse-2.190.0.dist-info → synapse-2.191.0.dist-info}/METADATA +4 -4
  35. {synapse-2.190.0.dist-info → synapse-2.191.0.dist-info}/RECORD +38 -38
  36. {synapse-2.190.0.dist-info → synapse-2.191.0.dist-info}/LICENSE +0 -0
  37. {synapse-2.190.0.dist-info → synapse-2.191.0.dist-info}/WHEEL +0 -0
  38. {synapse-2.190.0.dist-info → synapse-2.191.0.dist-info}/top_level.txt +0 -0
synapse/common.py CHANGED
@@ -1368,3 +1368,12 @@ def _timeout(delay):
1368
1368
  """
1369
1369
  loop = asyncio.get_running_loop()
1370
1370
  return _Timeout(loop.time() + delay if delay is not None else None)
1371
+
1372
+ def format(text, **kwargs):
1373
+ '''
1374
+ Similar to python str.format() but treats tokens as opaque.
1375
+ '''
1376
+ for name, valu in kwargs.items():
1377
+ tokn = '{' + name + '}'
1378
+ text = text.replace(tokn, valu)
1379
+ return text
synapse/cortex.py CHANGED
@@ -4651,6 +4651,7 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
4651
4651
  # allow an admin to directly open the cortex hive
4652
4652
  # (perhaps this should be a Cell() level pattern)
4653
4653
  if path[0] == 'hive' and user.isAdmin():
4654
+ s_common.deprecated('Cortex /hive telepath path', curv='2.167.0')
4654
4655
  return await self.hiveapi.anit(self.hive, user)
4655
4656
 
4656
4657
  if path[0] == 'layer':
synapse/datamodel.py CHANGED
@@ -1114,7 +1114,14 @@ class Model:
1114
1114
  if item == '$self':
1115
1115
  return form.name
1116
1116
 
1117
- return item.format(**template)
1117
+ item = s_common.format(item, **template)
1118
+
1119
+ # warn but do not blow up. there may be extended model elements
1120
+ # with {}s which are not used for templates...
1121
+ if item.find('{') != -1: # pragma: no cover
1122
+ logger.warning(f'Missing template specifier in: {item}')
1123
+
1124
+ return item
1118
1125
 
1119
1126
  if isinstance(item, dict):
1120
1127
  return {convert(k): convert(v) for (k, v) in item.items()}
synapse/lib/cell.py CHANGED
@@ -96,16 +96,16 @@ def adminapi(log=False):
96
96
  def decrfunc(func):
97
97
 
98
98
  @functools.wraps(func)
99
- def wrapped(*args, **kwargs):
99
+ def wrapped(self, *args, **kwargs):
100
100
 
101
- if args[0].user is not None and not args[0].user.isAdmin():
102
- raise s_exc.AuthDeny(mesg='User is not an admin.',
103
- user=args[0].user.name)
101
+ if self.user is not None and not self.user.isAdmin():
102
+ raise s_exc.AuthDeny(mesg=f'User is not an admin [{self.user.name}]',
103
+ user=self.user.iden, username=self.user.name)
104
104
  if log:
105
- logger.info('Executing [%s] as [%s] with args [%s][%s]',
106
- func.__qualname__, args[0].user.name, args[1:], kwargs)
105
+ logger.info(f'Executing [{func.__qualname__}] as [{self.user.name}] with args [{args}[{kwargs}]',
106
+ extra={'synapse': {'wrapped_func': func.__qualname__}})
107
107
 
108
- return func(*args, **kwargs)
108
+ return func(self, *args, **kwargs)
109
109
 
110
110
  wrapped.__syn_wrapped__ = 'adminapi'
111
111
 
synapse/lib/msgpack.py CHANGED
@@ -26,8 +26,16 @@ def _ext_en(item):
26
26
  return msgpack.ExtType(1, item.to_bytes(size, 'big', signed=True))
27
27
  return item
28
28
 
29
+ _packer_kwargs = {
30
+ 'use_bin_type': True,
31
+ 'unicode_errors': 'surrogatepass',
32
+ 'default': _ext_en,
33
+ }
34
+ if msgpack.version >= (1, 1, 0):
35
+ _packer_kwargs['buf_size'] = 1024 * 1024
36
+
29
37
  # Single Packer object which is reused for performance
30
- pakr = msgpack.Packer(use_bin_type=True, unicode_errors='surrogatepass', default=_ext_en)
38
+ pakr = msgpack.Packer(**_packer_kwargs)
31
39
  if isinstance(pakr, m_fallback.Packer): # pragma: no cover
32
40
  logger.warning('******************************************************************************************************')
33
41
  logger.warning('* msgpack is using the pure python fallback implementation. This will impact performance negatively. *')
@@ -87,8 +95,7 @@ def _fallback_en(item):
87
95
  bytes: The serialized bytes in msgpack format.
88
96
  '''
89
97
  try:
90
- return msgpack.packb(item, use_bin_type=True,
91
- unicode_errors='surrogatepass', default=_ext_en)
98
+ return msgpack.packb(item, **_packer_kwargs)
92
99
  except TypeError as e:
93
100
  mesg = f'{e.args[0]}: {repr(item)[:20]}'
94
101
  raise s_exc.NotMsgpackSafe(mesg=mesg) from e
@@ -916,6 +916,21 @@ class LibModelMigrations(s_stormtypes.Lib, MigrationEditorMixin):
916
916
  'desc': 'Do not copy nodedata to the inet:tls:servercert node.'},
917
917
  ),
918
918
  'returns': {'type': 'node', 'desc': 'The newly created inet:tls:servercert node.'}}},
919
+ {'name': 'inetServiceMessageClientAddress', 'desc': '''
920
+ Migrate the :client:address property to :client on inet:service:message nodes.
921
+
922
+ Edits will be made to the inet:service:message node in the current write layer.
923
+
924
+ If the :client:address property is set and the :client property is not set,
925
+ the :client property will be set with the :client:address value. If both
926
+ properties are set, the value will be moved into nodedata under the key
927
+ 'migration:inet:service:message:address'.
928
+ ''',
929
+ 'type': {'type': 'function', '_funcname': '_storm_query',
930
+ 'args': (
931
+ {'name': 'n', 'type': 'node', 'desc': 'The inet:sevice:message node to migrate.'},
932
+ ),
933
+ 'returns': {'type': 'null'}}},
919
934
 
920
935
  )
921
936
  _storm_lib_path = ('model', 'migration', 's')
@@ -956,6 +971,28 @@ class LibModelMigrations(s_stormtypes.Lib, MigrationEditorMixin):
956
971
 
957
972
  return($node)
958
973
  }
974
+
975
+ function inetServiceMessageClientAddress(n) {
976
+ $form = $n.form()
977
+ if ($form != 'inet:service:message') {
978
+ $mesg = `$lib.model.migration.s.inetServiceMessageClientAddress() only accepts inet:service:message nodes, not {$form}`
979
+ $lib.raise(BadArg, $mesg)
980
+ }
981
+
982
+ if (not $n.props.'client:address') { return() }
983
+
984
+ yield $n
985
+
986
+ if :client {
987
+ $node.data.set(migration:inet:service:message:client:address, :client:address)
988
+ } else {
989
+ [ :client = :client:address ]
990
+ }
991
+
992
+ [ -:client:address ]
993
+
994
+ return()
995
+ }
959
996
  '''
960
997
 
961
998
  def getObjLocals(self):
synapse/lib/version.py CHANGED
@@ -223,6 +223,6 @@ def reqVersion(valu, reqver,
223
223
  ##############################################################################
224
224
  # The following are touched during the release process by bumpversion.
225
225
  # Do not modify these directly.
226
- version = (2, 190, 0)
226
+ version = (2, 191, 0)
227
227
  verstring = '.'.join([str(x) for x in version])
228
- commit = 'ea92cb42c33f8793e9d72834aa8d12b6456eee8b'
228
+ commit = 'f6b07ada7cb68701e769e155735c9c004a404454'
synapse/models/auth.py CHANGED
@@ -43,7 +43,8 @@ class AuthModule(s_module.CoreModule):
43
43
  'doc': 'The WiFi SSID that the credentials allow access to.',
44
44
  }),
45
45
  ('web:acct', ('inet:web:acct', {}), {
46
- 'doc': 'The web account that the credentials allow access to.',
46
+ 'deprecated': True,
47
+ 'doc': 'Deprecated. Use :service:account.',
47
48
  }),
48
49
  ('service:account', ('inet:service:account', {}), {
49
50
  'doc': 'The service account that the credentials allow access to.'}),
synapse/models/base.py CHANGED
@@ -56,6 +56,10 @@ class BaseModule(s_module.CoreModule):
56
56
  'interfaces': ('meta:taxonomy',),
57
57
  'doc': 'A taxonomy of event types for meta:event nodes.'}),
58
58
 
59
+ ('meta:ruleset:type:taxonomy', ('taxonomy', {}), {
60
+ 'interfaces': ('meta:taxonomy',),
61
+ 'doc': 'A taxonomy for meta:ruleset types.'}),
62
+
59
63
  ('meta:ruleset', ('guid', {}), {
60
64
  'doc': 'A set of rules linked with -(has)> edges.'}),
61
65
 
@@ -99,6 +103,9 @@ class BaseModule(s_module.CoreModule):
99
103
  'deprecated': True,
100
104
  'doc': 'A generic digraph time edge to show relationships outside the model.'}),
101
105
 
106
+ ('meta:activity', ('int', {'enums': prioenums, 'enums:strict': False}), {
107
+ 'doc': 'A generic activity level enumeration.'}),
108
+
102
109
  ('meta:priority', ('int', {'enums': prioenums, 'enums:strict': False}), {
103
110
  'doc': 'A generic priority enumeration.'}),
104
111
 
@@ -120,6 +127,9 @@ class BaseModule(s_module.CoreModule):
120
127
  ),
121
128
  },
122
129
  'doc': 'A node which represents an aggregate count of a specific type.'}),
130
+
131
+ ('markdown', ('str', {}), {
132
+ 'doc': 'A markdown string.'}),
123
133
  ),
124
134
  'interfaces': (
125
135
  ('meta:taxonomy', {
@@ -182,6 +192,12 @@ class BaseModule(s_module.CoreModule):
182
192
 
183
193
  ('url', ('inet:url', {}), {
184
194
  'doc': 'A URL which documents the meta source.'}),
195
+
196
+ ('ingest:latest', ('time', {}), {
197
+ 'doc': 'Used by ingest logic to capture the last time a feed ingest ran.'}),
198
+
199
+ ('ingest:offset', ('int', {}), {
200
+ 'doc': 'Used by ingest logic to capture the current ingest offset within a feed.'}),
185
201
  )),
186
202
 
187
203
  ('meta:seen', {}, (
@@ -263,6 +279,10 @@ class BaseModule(s_module.CoreModule):
263
279
  ('meta:ruleset', {}, (
264
280
  ('name', ('str', {'lower': True, 'onespace': True}), {
265
281
  'doc': 'A name for the ruleset.'}),
282
+
283
+ ('type', ('meta:ruleset:type:taxonomy', {}), {
284
+ 'doc': 'The ruleset type.'}),
285
+
266
286
  ('desc', ('str', {}), {
267
287
  'disp': {'hint': 'text'},
268
288
  'doc': 'A description of the ruleset.'}),
synapse/models/crypto.py CHANGED
@@ -82,6 +82,11 @@ class CryptoModule(s_module.CoreModule):
82
82
  'ex': 'btc',
83
83
  }),
84
84
  ('crypto:currency:address', ('comp', {'fields': (('coin', 'crypto:currency:coin'), ('iden', 'str')), 'sepr': '/'}), {
85
+
86
+ 'interfaces': ('econ:pay:instrument',),
87
+ 'template': {
88
+ 'instrument': 'crypto currency address'},
89
+
85
90
  'doc': 'An individual crypto currency address.',
86
91
  'ex': 'btc/1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2',
87
92
  }),
@@ -364,8 +369,6 @@ class CryptoModule(s_module.CoreModule):
364
369
  'doc': 'The coin specific address identifier.', 'ro': True, }),
365
370
  ('desc', ('str', {}), {
366
371
  'doc': 'A free-form description of the address.'}),
367
- ('contact', ('ps:contact', {}), {
368
- 'doc': 'Contact information associated with the address.'}),
369
372
  )),
370
373
 
371
374
  ('crypto:algorithm', {}, ()),
@@ -23,6 +23,11 @@ class EconModule(s_module.CoreModule):
23
23
  'doc': 'An Issuer Id Number (IIN).'}),
24
24
 
25
25
  ('econ:pay:card', ('guid', {}), {
26
+
27
+ 'interfaces': ('econ:pay:instrument',),
28
+ 'template': {
29
+ 'instrument': 'payment card'},
30
+
26
31
  'doc': 'A single payment card.'}),
27
32
 
28
33
  ('econ:purchase', ('guid', {}), {
@@ -71,6 +76,11 @@ class EconModule(s_module.CoreModule):
71
76
  'doc': 'A bank account type taxonomy.'}),
72
77
 
73
78
  ('econ:bank:account', ('guid', {}), {
79
+
80
+ 'interfaces': ('econ:pay:instrument',),
81
+ 'template': {
82
+ 'instrument': 'bank account'},
83
+
74
84
  'doc': 'A bank account.'}),
75
85
 
76
86
  ('econ:bank:balance', ('guid', {}), {
@@ -87,6 +97,25 @@ class EconModule(s_module.CoreModule):
87
97
 
88
98
  ('econ:bank:swift:bic', ('str', {'regex': '[A-Z]{6}[A-Z0-9]{5}'}), {
89
99
  'doc': 'A Society for Worldwide Interbank Financial Telecommunication (SWIFT) Business Identifier Code (BIC).'}),
100
+
101
+ ('econ:pay:instrument', ('ndef', {'interface': 'econ:pay:instrument'}), {
102
+ 'doc': 'A node which may act as a payment instrument.'}),
103
+ ),
104
+
105
+ 'interfaces': (
106
+ ('econ:pay:instrument', {
107
+
108
+ 'doc': 'An interface for forms which may act as a payment instrument.',
109
+ 'template': {
110
+ 'instrument': 'instrument',
111
+ },
112
+
113
+ 'props': (
114
+
115
+ ('contact', ('ps:contact', {}), {
116
+ 'doc': 'The primary contact for the {instrument}.'}),
117
+ ),
118
+ }),
90
119
  ),
91
120
 
92
121
  'edges': (
@@ -134,9 +163,6 @@ class EconModule(s_module.CoreModule):
134
163
 
135
164
  ('account', ('econ:bank:account', {}), {
136
165
  'doc': 'A bank account associated with the payment card.'}),
137
-
138
- ('contact', ('ps:contact', {}), {
139
- 'doc': 'The contact information associated with the payment card.'}),
140
166
  )),
141
167
 
142
168
  ('econ:purchase', {}, (
@@ -209,17 +235,26 @@ class EconModule(s_module.CoreModule):
209
235
  ('from:cash', ('bool', {}), {
210
236
  'doc': 'Set to true if the payment input was in cash.'}),
211
237
 
238
+ ('to:instrument', ('econ:pay:instrument', {}), {
239
+ 'doc': 'The payment instrument which received funds from the payment.'}),
240
+
241
+ ('from:instrument', ('econ:pay:instrument', {}), {
242
+ 'doc': 'The payment instrument used to make the payment.'}),
243
+
212
244
  ('from:account', ('econ:bank:account', {}), {
213
- 'doc': 'The bank account which made the payment.'}),
245
+ 'deprecated': True,
246
+ 'doc': 'Deprecated. Please use :from:instrument.'}),
214
247
 
215
248
  ('from:pay:card', ('econ:pay:card', {}), {
216
- 'doc': 'The payment card making the payment.'}),
249
+ 'deprecated': True,
250
+ 'doc': 'Deprecated. Please use :from:instrument.'}),
217
251
 
218
252
  ('from:contract', ('ou:contract', {}), {
219
253
  'doc': 'A contract used as an aggregate payment source.'}),
220
254
 
221
255
  ('from:coinaddr', ('crypto:currency:address', {}), {
222
- 'doc': 'The crypto currency address making the payment.'}),
256
+ 'deprecated': True,
257
+ 'doc': 'Deprecated. Please use :from:instrument.'}),
223
258
 
224
259
  ('from:contact', ('ps:contact', {}), {
225
260
  'doc': 'Contact information for the entity making the payment.'}),
@@ -228,10 +263,12 @@ class EconModule(s_module.CoreModule):
228
263
  'doc': 'Set to true if the payment output was in cash.'}),
229
264
 
230
265
  ('to:account', ('econ:bank:account', {}), {
231
- 'doc': 'The bank account which received the payment.'}),
266
+ 'deprecated': True,
267
+ 'doc': 'Deprecated. Please use :to:instrument.'}),
232
268
 
233
269
  ('to:coinaddr', ('crypto:currency:address', {}), {
234
- 'doc': 'The crypto currency address receiving the payment.'}),
270
+ 'deprecated': True,
271
+ 'doc': 'Deprecated. Please use :to:instrument.'}),
235
272
 
236
273
  ('to:contact', ('ps:contact', {}), {
237
274
  'doc': 'Contact information for the person/org being paid.'}),
@@ -448,9 +485,6 @@ class EconModule(s_module.CoreModule):
448
485
  ('iban', ('econ:bank:iban', {}), {
449
486
  'doc': 'The IBAN for the account.'}),
450
487
 
451
- ('contact', ('ps:contact', {}), {
452
- 'doc': 'The contact information associated with the bank account.'}),
453
-
454
488
  ('issuer', ('ou:org', {}), {
455
489
  'doc': 'The bank which issued the account.'}),
456
490
 
synapse/models/inet.py CHANGED
@@ -1530,7 +1530,8 @@ class InetModule(s_module.CoreModule):
1530
1530
  'doc': 'An object status enumeration.'}),
1531
1531
 
1532
1532
  ('inet:service:account', ('guid', {}), {
1533
- 'interfaces': ('inet:service:object',),
1533
+ 'interfaces': ('inet:service:subscriber',),
1534
+ 'template': {'service:base': 'account'},
1534
1535
  'doc': 'An account within a service platform. Accounts may be instance specific.'}),
1535
1536
 
1536
1537
  ('inet:service:relationship:type:taxonomy', ('taxonomy', {}), {
@@ -1539,6 +1540,7 @@ class InetModule(s_module.CoreModule):
1539
1540
 
1540
1541
  ('inet:service:relationship', ('guid', {}), {
1541
1542
  'interfaces': ('inet:service:object',),
1543
+ 'template': {'service:base': 'relationship'},
1542
1544
  'doc': 'A relationship between two service objects.'}),
1543
1545
 
1544
1546
  ('inet:service:permission:type:taxonomy', ('taxonomy', {}), {
@@ -1547,10 +1549,12 @@ class InetModule(s_module.CoreModule):
1547
1549
 
1548
1550
  ('inet:service:permission', ('guid', {}), {
1549
1551
  'interfaces': ('inet:service:object',),
1552
+ 'template': {'service:base': 'permission'},
1550
1553
  'doc': 'A permission which may be granted to a service account or role.'}),
1551
1554
 
1552
1555
  ('inet:service:rule', ('guid', {}), {
1553
1556
  'interfaces': ('inet:service:object',),
1557
+ 'template': {'service:base': 'rule'},
1554
1558
  'doc': 'A rule which grants or denies a permission to a service account or role.'}),
1555
1559
 
1556
1560
  ('inet:service:login', ('guid', {}), {
@@ -1563,26 +1567,32 @@ class InetModule(s_module.CoreModule):
1563
1567
 
1564
1568
  ('inet:service:session', ('guid', {}), {
1565
1569
  'interfaces': ('inet:service:object',),
1570
+ 'template': {'service:base': 'session'},
1566
1571
  'doc': 'An authenticated session.'}),
1567
1572
 
1568
1573
  ('inet:service:group', ('guid', {}), {
1569
1574
  'interfaces': ('inet:service:object',),
1575
+ 'template': {'service:base': 'group'},
1570
1576
  'doc': 'A group or role which contains member accounts.'}),
1571
1577
 
1572
1578
  ('inet:service:group:member', ('guid', {}), {
1573
1579
  'interfaces': ('inet:service:object',),
1580
+ 'template': {'service:base': 'group membership'},
1574
1581
  'doc': 'Represents a service account being a member of a group.'}),
1575
1582
 
1576
1583
  ('inet:service:channel', ('guid', {}), {
1577
1584
  'interfaces': ('inet:service:object',),
1585
+ 'template': {'service:base': 'channel'},
1578
1586
  'doc': 'A channel used to distribute messages.'}),
1579
1587
 
1580
1588
  ('inet:service:thread', ('guid', {}), {
1581
1589
  'interfaces': ('inet:service:object',),
1590
+ 'template': {'service:base': 'thread'},
1582
1591
  'doc': 'A message thread.'}),
1583
1592
 
1584
1593
  ('inet:service:channel:member', ('guid', {}), {
1585
1594
  'interfaces': ('inet:service:object',),
1595
+ 'template': {'service:base': 'channel membership'},
1586
1596
  'doc': 'Represents a service account being a member of a channel.'}),
1587
1597
 
1588
1598
  ('inet:service:message', ('guid', {}), {
@@ -1601,26 +1611,47 @@ class InetModule(s_module.CoreModule):
1601
1611
 
1602
1612
  ('inet:service:emote', ('guid', {}), {
1603
1613
  'interfaces': ('inet:service:object',),
1614
+ 'template': {'service:base': 'emote'},
1604
1615
  'doc': 'An emote or reaction by an account.'}),
1605
1616
 
1606
1617
  ('inet:service:access', ('guid', {}), {
1607
1618
  'interfaces': ('inet:service:action',),
1608
1619
  'doc': 'Represents a user access request to a service resource.'}),
1609
1620
 
1621
+ ('inet:service:tenant', ('guid', {}), {
1622
+ 'interfaces': ('inet:service:subscriber',),
1623
+ 'template': {'service:base': 'tenant'},
1624
+ 'doc': 'A tenant which groups accounts and instances.'}),
1625
+
1626
+ ('inet:service:subscription:level:taxonomy', ('taxonomy', {}), {
1627
+ 'interfaces': ('meta:taxonomy',),
1628
+ 'doc': 'A taxonomy of platform specific subscription levels.'}),
1629
+
1630
+ ('inet:service:subscription', ('guid', {}), {
1631
+ 'interfaces': ('inet:service:object',),
1632
+ 'template': {'service:base': 'subscription'},
1633
+ 'doc': 'A subscription to a service platform or instance.'}),
1634
+
1635
+ ('inet:service:subscriber', ('ndef', {'interface': 'inet:service:subscriber'}), {
1636
+ 'doc': 'A node which may subscribe to a service subscription.'}),
1637
+
1610
1638
  ('inet:service:resource:type:taxonomy', ('taxonomy', {}), {
1611
1639
  'interfaces': ('meta:taxonomy',),
1612
1640
  'doc': 'A taxonomy of inet service resource types.'}),
1613
1641
 
1614
1642
  ('inet:service:resource', ('guid', {}), {
1615
1643
  'interfaces': ('inet:service:object',),
1644
+ 'template': {'service:base': 'resource'},
1616
1645
  'doc': 'A generic resource provided by the service architecture.'}),
1617
1646
 
1618
1647
  ('inet:service:bucket', ('guid', {}), {
1619
1648
  'interfaces': ('inet:service:object',),
1649
+ 'template': {'service:base': 'bucket'},
1620
1650
  'doc': 'A file/blob storage object within a service architecture.'}),
1621
1651
 
1622
1652
  ('inet:service:bucket:item', ('guid', {}), {
1623
1653
  'interfaces': ('inet:service:object',),
1654
+ 'template': {'service:base': 'bucket item'},
1624
1655
  'doc': 'An individual file stored within a bucket.'}),
1625
1656
 
1626
1657
  ('inet:tls:handshake', ('guid', {}), {
@@ -1676,16 +1707,17 @@ class InetModule(s_module.CoreModule):
1676
1707
 
1677
1708
  ('inet:service:base', {
1678
1709
  'doc': 'Properties common to most forms within a service platform.',
1710
+ 'template': {'service:base': 'node'},
1679
1711
  'props': (
1680
1712
 
1681
1713
  ('id', ('str', {'strip': True}), {
1682
- 'doc': 'A platform specific ID.'}),
1714
+ 'doc': 'A platform specific ID which identifies the {service:base}.'}),
1683
1715
 
1684
1716
  ('platform', ('inet:service:platform', {}), {
1685
- 'doc': 'The platform which defines the node.'}),
1717
+ 'doc': 'The platform which defines the {service:base}.'}),
1686
1718
 
1687
1719
  ('instance', ('inet:service:instance', {}), {
1688
- 'doc': 'The platform instance which defines the node.'}),
1720
+ 'doc': 'The platform instance which defines the {service:base}.'}),
1689
1721
  ),
1690
1722
  }),
1691
1723
 
@@ -1693,23 +1725,34 @@ class InetModule(s_module.CoreModule):
1693
1725
 
1694
1726
  'doc': 'Properties common to objects within a service platform.',
1695
1727
  'interfaces': ('inet:service:base',),
1728
+ 'template': {'service:base': 'object'},
1696
1729
  'props': (
1697
1730
 
1698
1731
  ('status', ('inet:service:object:status', {}), {
1699
- 'doc': 'The status of this object.'}),
1732
+ 'doc': 'The status of the {service:base}.'}),
1700
1733
 
1701
1734
  ('period', ('ival', {}), {
1702
- 'doc': 'The period when the object existed.'}),
1735
+ 'doc': 'The period when the {service:base} existed.'}),
1703
1736
 
1704
1737
  ('creator', ('inet:service:account', {}), {
1705
- 'doc': 'The service account which created the object.'}),
1738
+ 'doc': 'The service account which created the {service:base}.'}),
1706
1739
 
1707
1740
  ('remover', ('inet:service:account', {}), {
1708
- 'doc': 'The service account which removed or decommissioned the object.'}),
1741
+ 'doc': 'The service account which removed or decommissioned the {service:base}.'}),
1709
1742
 
1710
1743
  ),
1711
1744
  }),
1712
1745
 
1746
+ ('inet:service:subscriber', {
1747
+ 'doc': 'Properties common to the nodes which subscribe to services.',
1748
+ 'interfaces': ('inet:service:object',),
1749
+ 'template': {'service:base': 'subscriber'},
1750
+ 'props': (
1751
+ ('profile', ('ps:contact', {}), {
1752
+ 'doc': 'The primary contact information for the {service:base}.'}),
1753
+ ),
1754
+ }),
1755
+
1713
1756
  ('inet:service:action', {
1714
1757
 
1715
1758
  'doc': 'Properties common to events within a service platform.',
@@ -3590,21 +3633,21 @@ class InetModule(s_module.CoreModule):
3590
3633
 
3591
3634
  ('owner', ('inet:service:account', {}), {
3592
3635
  'doc': 'The service account which owns the instance.'}),
3636
+
3637
+ ('tenant', ('inet:service:tenant', {}), {
3638
+ 'doc': 'The tenant which contains the instance.'}),
3593
3639
  )),
3594
3640
 
3595
3641
  ('inet:service:account', {}, (
3596
3642
 
3597
- ('id', ('str', {'strip': True}), {
3598
- 'doc': 'A platform specific ID used to identify the account.'}),
3599
-
3600
3643
  ('user', ('inet:user', {}), {
3601
3644
  'doc': 'The current user name of the account.'}),
3602
3645
 
3603
3646
  ('email', ('inet:email', {}), {
3604
3647
  'doc': 'The current email address associated with the account.'}),
3605
3648
 
3606
- ('profile', ('ps:contact', {}), {
3607
- 'doc': 'Current profile details associated with the account.'}),
3649
+ ('tenant', ('inet:service:tenant', {}), {
3650
+ 'doc': 'The tenant which contains the account.'}),
3608
3651
  )),
3609
3652
 
3610
3653
  ('inet:service:relationship:type:taxonomy', {}, ()),
@@ -3621,10 +3664,7 @@ class InetModule(s_module.CoreModule):
3621
3664
  'doc': 'The type of relationship between the source and the target.'}),
3622
3665
  )),
3623
3666
 
3624
- ('inet:service:group', {}, ( # inet:service:object
3625
-
3626
- ('id', ('str', {'strip': True}), {
3627
- 'doc': 'A platform specific ID used to identify the group.'}),
3667
+ ('inet:service:group', {}, (
3628
3668
 
3629
3669
  ('name', ('inet:group', {}), {
3630
3670
  'doc': 'The name of the group on this platform.'}),
@@ -3674,14 +3714,14 @@ class InetModule(s_module.CoreModule):
3674
3714
 
3675
3715
  ('inet:service:session', {}, (
3676
3716
 
3677
- ('id', ('str', {'strip': True}), {
3678
- 'doc': 'The service specific session id.'}),
3679
-
3680
3717
  ('creator', ('inet:service:account', {}), {
3681
3718
  'doc': 'The account which authenticated to create the session.'}),
3682
3719
 
3683
3720
  ('period', ('ival', {}), {
3684
3721
  'doc': 'The period where the session was valid.'}),
3722
+
3723
+ ('http:session', ('inet:http:session', {}), {
3724
+ 'doc': 'The HTTP session associated with the service session.'}),
3685
3725
  )),
3686
3726
 
3687
3727
  ('inet:service:login', {}, (
@@ -3742,7 +3782,8 @@ class InetModule(s_module.CoreModule):
3742
3782
  'doc': 'The name of the place that the message was sent from.'}),
3743
3783
 
3744
3784
  ('client:address', ('inet:client', {}), {
3745
- 'doc': 'The client address that the message was sent from.'}),
3785
+ 'deprecated': True,
3786
+ 'doc': 'Deprecated. Please use :client'}),
3746
3787
 
3747
3788
  ('client:software', ('it:prod:softver', {}), {
3748
3789
  'doc': 'The client software version used to send the message.'}),
@@ -3864,6 +3905,22 @@ class InetModule(s_module.CoreModule):
3864
3905
  ('type', ('int', {'enums': svcaccesstypes}), {
3865
3906
  'doc': 'The type of access requested.'}),
3866
3907
  )),
3908
+
3909
+ ('inet:service:tenant', {}, ()),
3910
+
3911
+ ('inet:service:subscription:level:taxonomy', {}, ()),
3912
+
3913
+ ('inet:service:subscription', {}, (
3914
+
3915
+ ('level', ('inet:service:subscription:level:taxonomy', {}), {
3916
+ 'doc': 'A platform specific subscription level.'}),
3917
+
3918
+ ('pay:instrument', ('econ:pay:instrument', {}), {
3919
+ 'doc': 'The primary payment instrument used to pay for the subscription.'}),
3920
+
3921
+ ('subscriber', ('inet:service:subscriber', {}), {
3922
+ 'doc': 'The subscriber who owns the subscription.'}),
3923
+ )),
3867
3924
  ),
3868
3925
  }),
3869
3926
  )