Skip to content

Commit 184632e

Browse files
committed
CHANGES:
- Security setting to YAML parser added. - Default ports to schemas added. - Tacview: Ports are ints now in the schema (in opposite to the TV settings in options.lua but in favor of the port checks)
1 parent aaf2a6c commit 184632e

File tree

42 files changed

+54
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+54
-57
lines changed

core/data/impl/nodeimpl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# ruamel YAML support
5050
from ruamel.yaml import YAML
5151
from ruamel.yaml.error import MarkedYAMLError
52-
yaml = YAML()
52+
yaml = YAML(typ='safe')
5353

5454

5555
__all__ = [

core/data/impl/serverimpl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# ruamel YAML support
3838
from ruamel.yaml import YAML
39-
yaml = YAML()
39+
yaml = YAML(typ='safe')
4040

4141
if TYPE_CHECKING:
4242
from core import Instance

core/data/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# ruamel YAML support
1616
from ruamel.yaml import YAML
1717
from ruamel.yaml.error import MarkedYAMLError
18-
yaml = YAML()
18+
yaml = YAML(typ='safe')
1919

2020
if TYPE_CHECKING:
2121
from core import Server, Instance

core/data/proxy/nodeproxy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
# ruamel YAML support
1313
from ruamel.yaml import YAML
14+
yaml = YAML(typ='safe')
1415

1516
if TYPE_CHECKING:
1617
from core import Instance, Server
1718
from core import NodeImpl
1819

19-
yaml = YAML()
20-
2120
__all__ = ["NodeProxy"]
2221

2322

core/data/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# ruamel YAML support
2121
from ruamel.yaml import YAML
2222
from ruamel.yaml.error import MarkedYAMLError
23-
yaml = YAML()
23+
yaml = YAML(typ='safe')
2424

2525
if TYPE_CHECKING:
2626
from core import Extension, Instance, Mission, UploadStatus, Player

core/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# ruamel YAML support
3232
from ruamel.yaml import YAML
3333
from ruamel.yaml.error import MarkedYAMLError
34-
yaml = YAML()
34+
yaml = YAML(typ='safe')
3535

3636
if TYPE_CHECKING:
3737
from core import Server

core/services/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from pykwalify.errors import PyKwalifyException
2323
from ruamel.yaml import YAML
2424
from ruamel.yaml.error import MarkedYAMLError
25-
yaml = YAML()
25+
yaml = YAML(typ='safe')
2626

2727
__all__ = [
2828
"proxy",

core/translations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# ruamel YAML support
99
from ruamel.yaml import YAML
10-
yaml = YAML()
10+
yaml = YAML(typ='safe')
1111

1212

1313
__all__ = [

core/utils/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from pykwalify.errors import SchemaError
4141
from ruamel.yaml import YAML
4242
from ruamel.yaml.error import MarkedYAMLError
43-
yaml = YAML()
43+
yaml = YAML(typ='safe')
4444

4545
if TYPE_CHECKING:
4646
from core import ServerProxy, DataObject, Node

core/utils/validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
# ruamel YAML support
5151
from ruamel.yaml import YAML
52-
yaml = YAML()
52+
yaml = YAML(typ='safe')
5353

5454
# Global ports that survive multiple loads
5555
if 'ports' not in vars(sys):
@@ -139,7 +139,7 @@ def obsolete(value, rule, path):
139139
logger.warning(f'"{os.path.basename(path)}" is obsolete and will be set by the bot: Path "{path}"')
140140
return True
141141

142-
def unique_port(value, _, path):
142+
def unique_port(value, rule, path):
143143
try:
144144
value = int(value)
145145
if value < 1024 or value > 65535:

0 commit comments

Comments
 (0)