Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4082 from golemfactory/0.19-terms-weird-chars
Browse files Browse the repository at this point in the history
fix "unacceptable" characters ;p
  • Loading branch information
shadeofblue authored Apr 4, 2019
2 parents 3fcf2f3 + fa341ae commit 0be816f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
18 changes: 9 additions & 9 deletions golem/TERMS.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ <h6>External Network Monitor</h6>
contribute certain information about his or her node and the usage of the
application to the external network monitor. If the user decides to opt-in
to contribute network statistics to the Company, the following information
relating to the users use of the application (External Statistics) will
relating to the user's use of the application ("External Statistics") will
be transferred to the Company and published on
<a href="https://stats.golem.network/show">https://stats.golem.network/show</a>:
</p>
Expand Down Expand Up @@ -422,7 +422,7 @@ <h6>External Network Monitor</h6>
</p>
<p>
The processing of the information by storing and publishing the External
Statistics on the external network monitor is based on the users consent
Statistics on the external network monitor is based on the user's consent
pursuant to Article 6(1) lit. a GDPR. The user shall have the right to
withdraw his or her consent at any time. If the user wishes to end his or
her contribution of External Statistics to the external network monitor,
Expand All @@ -447,7 +447,7 @@ <h6>Internal Network Monitor</h6>
contribute certain information about his or her node and the usage of the
application to the internal network monitor. If the user decides to opt-in
to contribute network statistics to the Company, the following information
relating to the users use of the application (Internal Statistics)
relating to the user's use of the application ("Internal Statistics")
will be transferred to the Company and stored on its internal servers:
</p>
<ul>
Expand Down Expand Up @@ -497,7 +497,7 @@ <h6>Internal Network Monitor</h6>
</p>
<p>
The processing of the information by storing the Internal Statistics on
the internal network monitor is based on the users consent pursuant to
the internal network monitor is based on the user's consent pursuant to
Article 6(1) lit. a GDPR. The user shall have the right to withdraw his or
her consent at any time. If the user wishes to end his or her contribution
of information to the network monitor, he or she can opt out by using the
Expand All @@ -511,7 +511,7 @@ <h6>Sentry Service for Error Tracking</h6>
The Company uses an open-source error tracking service called Sentry that
is offered by Functional Software, Inc. domiciled in San Francisco and
provides real-time error tracking for web applications Sentry
(Sentry Sentry). The information collected by the Sentry Service and
("Sentry Sentry"). The information collected by the Sentry Service and
provided to the Company gives the Company the insight needed to reproduce
and fix crashes that happen in the Golem Network.
</p>
Expand All @@ -520,11 +520,11 @@ <h6>Sentry Service for Error Tracking</h6>
be asked during the installation procedure whether he or she wishes to
contribute information about errors happening in his or her node to the
Sentry Service, including the node name. If the user decides to opt-in to
contribute such error information, all errors that happen in the users
contribute such error information, all errors that happen in the user's
nodes as well as the name of the node are automatically sent to the Company
(Error Information). All other data related to the error is filtered and
("Error Information"). All other data related to the error is filtered and
encrypted so that the Company is not able to access it. The Error
Information sent to the Company is subsequently stored on the Companys
Information sent to the Company is subsequently stored on the Company's
servers in the form of logs.
</p>
<p>
Expand All @@ -537,7 +537,7 @@ <h6>Sentry Service for Error Tracking</h6>
</p>
<p>
The processing of the information by storing the Error Information on the
servers of the Company is based on the users consent pursuant to
servers of the Company is based on the user's consent pursuant to
Article 6(1) lit. a GDPR. The user shall have the right to withdraw his or
her consent at any time. If the user wishes to end his or her contribution
of information to the network monitor, he or she can opt out by using the
Expand Down
27 changes: 27 additions & 0 deletions tests/golem/test_terms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pathlib
import re
import unittest
from unittest.mock import patch

from faker import Faker
Expand Down Expand Up @@ -64,3 +66,28 @@ def test_show(self, read_mock):
"""
read_mock.return_value = content
self.assertEqual(self.terms.show(), content)


class TermsOfUseContentsTest(unittest.TestCase):
def assertContentsValid(self, contents):
matched = re.search(
r"([^a-zA-Z0-9_\n\<\>\/\.\:\"\=\x20\(\)\,\;\'\-\%])",
contents, flags=re.DOTALL)

try:
bad_char = matched.group(1)
except AttributeError:
bad_char = ''

self.assertFalse(
matched,
msg="Found unacceptable character {} ({})".format(
bad_char, bad_char.encode('utf-8').hex()
)
)

def test_tos_contents_valid(self):
self.assertContentsValid(terms.TermsOfUse.show())

def test_concent_tos_contents_valid(self):
self.assertContentsValid(terms.ConcentTermsOfUse.show())

0 comments on commit 0be816f

Please sign in to comment.