mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 22:34:48 -04:00
Change the format of access tokens away from macaroons (#5588)
This commit is contained in:
parent
affaffb0ab
commit
7562d887e1
9 changed files with 78 additions and 103 deletions
|
@ -13,7 +13,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.util.stringutils import assert_valid_client_secret
|
||||
from synapse.util.stringutils import assert_valid_client_secret, base62_encode
|
||||
|
||||
from .. import unittest
|
||||
|
||||
|
@ -45,3 +45,9 @@ class StringUtilsTestCase(unittest.TestCase):
|
|||
for client_secret in bad:
|
||||
with self.assertRaises(SynapseError):
|
||||
assert_valid_client_secret(client_secret)
|
||||
|
||||
def test_base62_encode(self):
|
||||
self.assertEqual("0", base62_encode(0))
|
||||
self.assertEqual("10", base62_encode(62))
|
||||
self.assertEqual("1c", base62_encode(100))
|
||||
self.assertEqual("001c", base62_encode(100, minwidth=4))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue