Validate length of token_hash. Increase expiry times of routing status.

This commit is contained in:
Reckless_Satoshi 2022-05-30 07:08:32 -07:00
parent d1f671cf66
commit 5b214c3b9c
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 12 additions and 10 deletions

View File

@ -395,12 +395,12 @@ class Order(models.Model):
10: 60 * 60 * int(config("FIAT_EXCHANGE_DURATION")),# 'Fiat sent - In chatroom'
11: 1 * 24 * 60 * 60, # 'In dispute'
12: 0, # 'Collaboratively cancelled'
13: 24 * 60 * 60, # 'Sending satoshis to buyer'
14: 24 * 60 * 60, # 'Sucessful trade'
15: 24 * 60 * 60, # 'Failed lightning network routing'
13: 10 * 24 * 60 * 60, # 'Sending satoshis to buyer'
14: 10 * 24 * 60 * 60, # 'Sucessful trade'
15: 10 * 24 * 60 * 60, # 'Failed lightning network routing'
16: 10 * 24 * 60 * 60, # 'Wait for dispute resolution'
17: 24 * 60 * 60, # 'Maker lost dispute'
18: 24 * 60 * 60, # 'Taker lost dispute'
17: 10 * 24 * 60 * 60, # 'Maker lost dispute'
18: 10 * 24 * 60 * 60, # 'Taker lost dispute'
}
return t_to_expire[status]

View File

@ -82,17 +82,19 @@ class UpdateOrderSerializer(serializers.Serializer):
class UserGenSerializer(serializers.Serializer):
# Mandatory fields
token_sha256 = serializers.CharField(max_length=64,
token_sha256 = serializers.CharField(
min_length=64,
max_length=64,
allow_null=False,
allow_blank=False,
required=True,
help_text="SHA256 of user secret")
public_key = serializers.CharField(max_length=999,
public_key = serializers.CharField(max_length=2000,
allow_null=False,
allow_blank=False,
required=True,
help_text="Armored ASCII PGP public key block")
encrypted_private_key = serializers.CharField(max_length=999,
encrypted_private_key = serializers.CharField(max_length=2000,
allow_null=False,
allow_blank=False,
required=True,