Skip to content

Commit 3ea4c30

Browse files
committed
Cleanup strip=True typeopts now that it is the default
1 parent 56abe50 commit 3ea4c30

File tree

12 files changed

+61
-62
lines changed

12 files changed

+61
-62
lines changed

synapse/models/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
('date', ('time', {'precision': 'day'}), {
2323
'doc': 'A date precision time value.'}),
2424

25-
('base:id', ('str', {'strip': True}), {
25+
('base:id', ('str', {}), {
2626
'doc': 'A base type for ID strings.'}),
2727

2828
('meta:id', ('base:id', {}), {
@@ -383,7 +383,7 @@
383383
('offset', ('int', {}), {
384384
'doc': 'The offset of the last record consumed from the feed.'}),
385385

386-
('cursor', ('str', {'strip': True}), {
386+
('cursor', ('str', {}), {
387387
'doc': 'A cursor used to track ingest offset within the feed.'}),
388388
)),
389389

synapse/models/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@
616616
'doc': 'The version integer in the certificate. (ex. 2 == v3 ).',
617617
}),
618618

619-
('subject:cn', ('str', {'strip': True}), {
619+
('subject:cn', ('str', {}), {
620620
'doc': 'The Common Name (CN) attribute of the x509 Subject.',
621621
}),
622622

synapse/models/economic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@
432432
('exchange', ('econ:fin:exchange', {}), {
433433
'doc': 'The exchange on which the security is traded.'}),
434434

435-
('ticker', ('str', {'lower': True, 'strip': True}), {
435+
('ticker', ('str', {'lower': True}), {
436436
'doc': 'The identifier for this security within the exchange.'}),
437437

438438
('type', ('econ:fin:security:type:taxonomy', {}), {

synapse/models/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ async def _normPyStr(self, valu, view=None):
693693
('working', ('file:path', {}), {
694694
'doc': 'The working directory used when activating the link target.'}),
695695

696-
('relative', ('str', {'strip': True}), {
696+
('relative', ('str', {}), {
697697
'doc': 'The relative target path string contained within the StringData structure of the LNK file.'}),
698698

699699
('arguments', ('it:cmd', {}), {

synapse/models/inet.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ async def _onSetWhoisText(node):
15571557
('inet:email:message:link', ('guid', {}), {
15581558
'doc': 'A url/link embedded in an email message.'}),
15591559

1560-
('inet:tls:jarmhash', ('str', {'lower': True, 'strip': True, 'regex': '^(?<ciphers>[0-9a-f]{30})(?<extensions>[0-9a-f]{32})$'}), {
1560+
('inet:tls:jarmhash', ('str', {'lower': True, 'regex': '^(?<ciphers>[0-9a-f]{30})(?<extensions>[0-9a-f]{32})$'}), {
15611561
'interfaces': (
15621562
('meta:observable', {'template': {'title': 'JARM fingerprint'}}),
15631563
),
@@ -1786,13 +1786,13 @@ async def _onSetWhoisText(node):
17861786
),
17871787
'doc': 'An instance of a TLS handshake between a client and server.'}),
17881788

1789-
('inet:tls:ja4', ('str', {'strip': True, 'regex': ja4_regex}), {
1789+
('inet:tls:ja4', ('str', {'regex': ja4_regex}), {
17901790
'interfaces': (
17911791
('meta:observable', {'template': {'title': 'JA4 fingerprint'}}),
17921792
),
17931793
'doc': 'A JA4 TLS client fingerprint.'}),
17941794

1795-
('inet:tls:ja4s', ('str', {'strip': True, 'regex': ja4s_regex}), {
1795+
('inet:tls:ja4s', ('str', {'regex': ja4s_regex}), {
17961796
'interfaces': (
17971797
('meta:observable', {'template': {'title': 'JA4S fingerprint'}}),
17981798
),
@@ -1972,10 +1972,10 @@ async def _onSetWhoisText(node):
19721972
('rule', ('inet:service:rule', {}), {
19731973
'doc': 'The rule which allowed or denied the action.'}),
19741974

1975-
('error:code', ('str', {'strip': True}), {
1975+
('error:code', ('str', {}), {
19761976
'doc': 'The platform specific error code if the action was unsuccessful.'}),
19771977

1978-
('error:reason', ('str', {'strip': True}), {
1978+
('error:reason', ('str', {}), {
19791979
'doc': 'The platform specific friendly error reason if the action was unsuccessful.'}),
19801980

19811981
('platform', ('inet:service:platform', {}), {
@@ -2388,7 +2388,7 @@ async def _onSetWhoisText(node):
23882388
('host', ('it:host', {}), {
23892389
'doc': 'The guid of the host the interface is associated with.'}),
23902390

2391-
('name', ('str', {'strip': True}), {
2391+
('name', ('str', {}), {
23922392
'ex': 'eth0',
23932393
'doc': 'The interface name.'}),
23942394

@@ -2720,7 +2720,7 @@ async def _onSetWhoisText(node):
27202720
('channel', ('int', {}), {
27212721
'doc': 'The WIFI channel that the AP was last observed operating on.'}),
27222722

2723-
('encryption', ('str', {'lower': True, 'strip': True}), {
2723+
('encryption', ('str', {'lower': True}), {
27242724
'doc': 'The type of encryption used by the WIFI AP such as "wpa2".'}),
27252725

27262726
# FIXME ownable interface?
@@ -2731,10 +2731,10 @@ async def _onSetWhoisText(node):
27312731
('inet:wifi:ssid', {}, ()),
27322732

27332733
('inet:tls:jarmhash', {}, (
2734-
('ciphers', ('str', {'lower': True, 'strip': True, 'regex': '^[0-9a-f]{30}$'}), {
2734+
('ciphers', ('str', {'lower': True, 'regex': '^[0-9a-f]{30}$'}), {
27352735
'computed': True,
27362736
'doc': 'The encoded cipher and TLS version of the server.'}),
2737-
('extensions', ('str', {'lower': True, 'strip': True, 'regex': '^[0-9a-f]{32}$'}), {
2737+
('extensions', ('str', {'lower': True, 'regex': '^[0-9a-f]{32}$'}), {
27382738
'computed': True,
27392739
'doc': 'The truncated SHA256 of the TLS server extensions.'}),
27402740
)),
@@ -3095,7 +3095,7 @@ async def _onSetWhoisText(node):
30953095

30963096
('inet:service:message:link', {}, (
30973097

3098-
('title', ('str', {'strip': True}), {
3098+
('title', ('str', {}), {
30993099
'doc': 'The displayed hyperlink text if it was not the URL.'}),
31003100

31013101
('url', ('inet:url', {}), {
@@ -3119,7 +3119,7 @@ async def _onSetWhoisText(node):
31193119
('about', ('inet:service:object', {}), {
31203120
'doc': 'The node that the emote is about.'}),
31213121

3122-
('text', ('str', {'strip': True}), {
3122+
('text', ('str', {}), {
31233123
'ex': ':partyparrot:',
31243124
'doc': 'The unicode or emote text of the reaction.'}),
31253125
)),

synapse/models/infotech.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def postTypeInit(self):
345345
s_types.Str.postTypeInit(self)
346346

347347
self.cpe22 = self.modl.type('it:sec:cpe:v2_2')
348-
self.strtype = self.modl.type('str').clone({'lower': True, 'strip': True})
348+
self.strtype = self.modl.type('str').clone({'lower': True})
349349
self.metatype = self.modl.type('meta:name')
350350

351351
async def _normPyStr(self, valu, view=None):
@@ -634,7 +634,7 @@ async def _onFormItDevStr(node):
634634
),
635635
'types': (
636636

637-
('it:hostname', ('str', {'strip': True, 'lower': True}), {
637+
('it:hostname', ('str', {'lower': True}), {
638638
'interfaces': (
639639
('meta:observable', {'template': {'title': 'hostname'}}),
640640
),
@@ -912,7 +912,7 @@ async def _onFormItDevStr(node):
912912
),
913913
'doc': 'A memory mapped segment located in a process.'}),
914914

915-
('it:cmd', ('str', {'strip': True}), {
915+
('it:cmd', ('str', {}), {
916916
'doc': 'A unique command-line string.',
917917
'ex': 'foo.exe --dostuff bar'}),
918918

@@ -922,7 +922,7 @@ async def _onFormItDevStr(node):
922922
('it:cmd:history', ('guid', {}), {
923923
'doc': 'A single command executed within a session.'}),
924924

925-
('it:query', ('str', {'strip': True}), {
925+
('it:query', ('str', {}), {
926926
'doc': 'A unique query string.'}),
927927

928928
('it:exec:query', ('guid', {}), {
@@ -1454,47 +1454,47 @@ async def _onFormItDevStr(node):
14541454
('v2_2', ('it:sec:cpe:v2_2', {}), {
14551455
'doc': 'The CPE 2.2 string which is equivalent to the primary property.'}),
14561456

1457-
('part', ('str', {'lower': True, 'strip': True}), {
1457+
('part', ('str', {'lower': True}), {
14581458
'computed': True,
14591459
'doc': 'The "part" field from the CPE 2.3 string.'}),
14601460

14611461
('vendor', ('meta:name', {}), {
14621462
'computed': True,
14631463
'doc': 'The "vendor" field from the CPE 2.3 string.'}),
14641464

1465-
('product', ('str', {'lower': True, 'strip': True}), {
1465+
('product', ('str', {'lower': True}), {
14661466
'computed': True,
14671467
'doc': 'The "product" field from the CPE 2.3 string.'}),
14681468

1469-
('version', ('str', {'lower': True, 'strip': True}), {
1469+
('version', ('str', {'lower': True}), {
14701470
'computed': True,
14711471
'doc': 'The "version" field from the CPE 2.3 string.'}),
14721472

1473-
('update', ('str', {'lower': True, 'strip': True}), {
1473+
('update', ('str', {'lower': True}), {
14741474
'computed': True,
14751475
'doc': 'The "update" field from the CPE 2.3 string.'}),
14761476

1477-
('edition', ('str', {'lower': True, 'strip': True}), {
1477+
('edition', ('str', {'lower': True}), {
14781478
'computed': True,
14791479
'doc': 'The "edition" field from the CPE 2.3 string.'}),
14801480

1481-
('language', ('str', {'lower': True, 'strip': True}), {
1481+
('language', ('str', {'lower': True}), {
14821482
'computed': True,
14831483
'doc': 'The "language" field from the CPE 2.3 string.'}),
14841484

1485-
('sw_edition', ('str', {'lower': True, 'strip': True}), {
1485+
('sw_edition', ('str', {'lower': True}), {
14861486
'computed': True,
14871487
'doc': 'The "sw_edition" field from the CPE 2.3 string.'}),
14881488

1489-
('target_sw', ('str', {'lower': True, 'strip': True}), {
1489+
('target_sw', ('str', {'lower': True}), {
14901490
'computed': True,
14911491
'doc': 'The "target_sw" field from the CPE 2.3 string.'}),
14921492

1493-
('target_hw', ('str', {'lower': True, 'strip': True}), {
1493+
('target_hw', ('str', {'lower': True}), {
14941494
'computed': True,
14951495
'doc': 'The "target_hw" field from the CPE 2.3 string.'}),
14961496

1497-
('other', ('str', {'lower': True, 'strip': True}), {
1497+
('other', ('str', {'lower': True}), {
14981498
'computed': True,
14991499
'doc': 'The "other" field from the CPE 2.3 string.'}),
15001500
)),
@@ -1642,7 +1642,7 @@ async def _onFormItDevStr(node):
16421642
('it:dev:repo:type:taxonomy', {}, ()),
16431643
('it:dev:repo', {}, (
16441644

1645-
('name', ('str', {'lower': True, 'strip': True}), {
1645+
('name', ('str', {'lower': True}), {
16461646
'doc': 'The name of the repository.'}),
16471647

16481648
('desc', ('text', {}), {
@@ -1683,7 +1683,7 @@ async def _onFormItDevStr(node):
16831683
('start', ('it:dev:repo:commit', {}), {
16841684
'doc': 'The commit in the parent branch this branch was created at.'}),
16851685

1686-
('name', ('str', {'strip': True}), {
1686+
('name', ('str', {}), {
16871687
'doc': 'The name of the branch.'}),
16881688

16891689
('url', ('inet:url', {}), {
@@ -1746,7 +1746,7 @@ async def _onFormItDevStr(node):
17461746
('repo', ('it:dev:repo', {}), {
17471747
'doc': 'The repo where the issue was logged.'}),
17481748

1749-
('title', ('str', {'lower': True, 'strip': True}), {
1749+
('title', ('str', {'lower': True}), {
17501750
'doc': 'The title of the issue.'}),
17511751

17521752
('desc', ('text', {}), {
@@ -1767,7 +1767,7 @@ async def _onFormItDevStr(node):
17671767
('id', ('meta:id', {}), {
17681768
'doc': 'The ID of the label.'}),
17691769

1770-
('title', ('str', {'lower': True, 'strip': True}), {
1770+
('title', ('str', {'lower': True}), {
17711771
'doc': 'The human friendly name of the label.'}),
17721772

17731773
('desc', ('text', {}), {
@@ -2550,8 +2550,7 @@ async def _onFormItDevStr(node):
25502550
('pattern', ('str', {}), {
25512551
'doc': 'The STIX indicator pattern text.'}),
25522552

2553-
('pattern_type', ('str', {'strip': True, 'lower': True,
2554-
'enums': 'stix,pcre,sigma,snort,suricata,yara'}), {
2553+
('pattern_type', ('str', {'lower': True, 'enums': 'stix,pcre,sigma,snort,suricata,yara'}), {
25552554
'doc': 'The STIX indicator pattern type.'}),
25562555

25572556
('created', ('time', {}), {

synapse/models/language.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
('lang:idiom', ('guid', {}), {
2020
'doc': 'An idiomatic use of a phrase.'}),
2121

22-
('lang:hashtag', ('str', {'lower': True, 'strip': True, 'regex': r'^#[^\p{Z}#]+$'}), {
22+
('lang:hashtag', ('str', {'lower': True, 'regex': r'^#[^\p{Z}#]+$'}), {
2323
# regex explanation:
2424
# - starts with pound
2525
# - one or more non-whitespace/non-pound character

synapse/models/orgs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
'ex': '0111',
6363
'doc': 'The four digit Standard Industrial Classification Code.'}),
6464

65-
('ou:naics', ('str', {'regex': r'^[1-9][0-9]{1,5}?$', 'strip': True}), {
65+
('ou:naics', ('str', {'regex': r'^[1-9][0-9]{1,5}?$'}), {
6666
'ex': '541715',
6767
'doc': 'North American Industry Classification System codes and prefixes.'}),
6868

@@ -406,7 +406,7 @@
406406
('submitted', ('time', {}), {
407407
'doc': 'The time the candidate was submitted for consideration.'}),
408408

409-
('intro', ('str', {'strip': True}), {
409+
('intro', ('str', {}), {
410410
'doc': 'An introduction or cover letter text submitted by the candidate.'}),
411411

412412
('resume', ('doc:resume', {}), {

synapse/models/planning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
)),
100100
('plan:procedure:variable', {}, (
101101

102-
('name', ('str', {'strip': True}), {
102+
('name', ('str', {}), {
103103
'doc': 'The name of the variable.'}),
104104

105105
('type', ('str', {}), {

synapse/models/syn.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,19 @@ async def _liftRuntSynTagProp(view, prop, cmprvalu=None):
151151
'doc': 'A Synapse role.'}),
152152
),
153153
'types': (
154-
('syn:type', ('str', {'strip': True}), {
154+
('syn:type', ('str', {}), {
155155
'doc': 'A Synapse type used for normalizing nodes and properties.',
156156
}),
157-
('syn:form', ('str', {'strip': True}), {
157+
('syn:form', ('str', {}), {
158158
'doc': 'A Synapse form used for representing nodes in the graph.',
159159
}),
160-
('syn:prop', ('str', {'strip': True}), {
160+
('syn:prop', ('str', {}), {
161161
'doc': 'A Synapse property.'
162162
}),
163-
('syn:tagprop', ('str', {'strip': True}), {
163+
('syn:tagprop', ('str', {}), {
164164
'doc': 'A user defined tag property.'
165165
}),
166-
('syn:cmd', ('str', {'strip': True}), {
166+
('syn:cmd', ('str', {}), {
167167
'doc': 'A Synapse storm command.'
168168
}),
169169
('syn:deleted', ('ndef', {}), {
@@ -196,53 +196,53 @@ async def _liftRuntSynTagProp(view, prop, cmprvalu=None):
196196
'doc': 'The tag base name. Eg baz for foo.bar.baz .'}),
197197
)),
198198
('syn:type', {'runt': True, 'liftfunc': 'synapse.models.syn._liftRuntSynType'}, (
199-
('doc', ('str', {'strip': True}), {
199+
('doc', ('str', {}), {
200200
'doc': 'The docstring for the type.', 'computed': True}),
201-
('ctor', ('str', {'strip': True}), {
201+
('ctor', ('str', {}), {
202202
'doc': 'The python ctor path for the type object.', 'computed': True}),
203203
('subof', ('syn:type', {}), {
204204
'doc': 'Type which this inherits from.', 'computed': True}),
205205
('opts', ('data', {}), {
206206
'doc': 'Arbitrary type options.', 'computed': True})
207207
)),
208208
('syn:form', {'runt': True, 'liftfunc': 'synapse.models.syn._liftRuntSynForm'}, (
209-
('doc', ('str', {'strip': True}), {
209+
('doc', ('str', {}), {
210210
'doc': 'The docstring for the form.', 'computed': True}),
211211
('type', ('syn:type', {}), {
212212
'doc': 'Synapse type for this form.', 'computed': True}),
213213
('runt', ('bool', {}), {
214214
'doc': 'Whether or not the form is runtime only.', 'computed': True})
215215
)),
216216
('syn:prop', {'runt': True, 'liftfunc': 'synapse.models.syn._liftRuntSynProp'}, (
217-
('doc', ('str', {'strip': True}), {
217+
('doc', ('str', {}), {
218218
'doc': 'Description of the property definition.'}),
219219
('form', ('syn:form', {}), {
220220
'doc': 'The form of the property.', 'computed': True}),
221221
('type', ('syn:type', {}), {
222222
'doc': 'The synapse type for this property.', 'computed': True}),
223-
('relname', ('str', {'strip': True}), {
223+
('relname', ('str', {}), {
224224
'doc': 'Relative property name.', 'computed': True}),
225225
('univ', ('bool', {}), {
226226
'doc': 'Specifies if a prop is universal.', 'computed': True}),
227-
('base', ('str', {'strip': True}), {
227+
('base', ('str', {}), {
228228
'doc': 'Base name of the property.', 'computed': True}),
229229
('computed', ('bool', {}), {
230230
'doc': 'If the property is dynamically computed from other property values.', 'computed': True}),
231231
('extmodel', ('bool', {}), {
232232
'doc': 'If the property is an extended model property or not.', 'computed': True}),
233233
)),
234234
('syn:tagprop', {'runt': True, 'liftfunc': 'synapse.models.syn._liftRuntSynTagProp'}, (
235-
('doc', ('str', {'strip': True}), {
235+
('doc', ('str', {}), {
236236
'doc': 'Description of the tagprop definition.'}),
237237
('type', ('syn:type', {}), {
238238
'doc': 'The synapse type for this tagprop.', 'computed': True}),
239239
)),
240240
('syn:cmd', {'runt': True, 'liftfunc': 'synapse.models.syn._liftRuntSynCmd'}, (
241241

242-
('doc', ('text', {'strip': True}), {
242+
('doc', ('text', {}), {
243243
'doc': 'Description of the command.'}),
244244

245-
('package', ('str', {'strip': True}), {
245+
('package', ('str', {}), {
246246
'doc': 'Storm package which provided the command.'}),
247247

248248
('svciden', ('guid', {'strip': True}), {

0 commit comments

Comments
 (0)