Remove VAPIDKeyset.public_key, generate on demand
Also rename `gen_vapid_keys` to `gen_vapid_key`, and merge migrations
This commit is contained in:
@ -11,10 +11,8 @@ class Command(BaseCommand):
|
||||
|
||||
def handle(self, *args, **options):
|
||||
priv_key = SigningKey.generate(curve=ecdsa.NIST256p)
|
||||
pub_key = priv_key.get_verifying_key()
|
||||
|
||||
VAPIDKeyset.objects.create(
|
||||
public_key=urlsafe_b64encode(b"\x04" + pub_key.to_string()).strip(b"="),
|
||||
private_key=urlsafe_b64encode(priv_key.to_string()).strip(b"=")
|
||||
)
|
||||
|
Reference in New Issue
Block a user