Skip to content

Commit 973a9cd

Browse files
authored
chore: version updates for Sept 2022 (#101)
1 parent a60bcc8 commit 973a9cd

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

python/py_vapid/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def verify_token(self, validation_token, verification_token):
261261
def _base_sign(self, claims):
262262
cclaims = copy.deepcopy(claims)
263263
if not cclaims.get('exp'):
264-
cclaims['exp'] = str(int(time.time()) + 86400)
264+
cclaims['exp'] = int(time.time()) + 86400
265265
if not self.conf.get('no-strict', False):
266266
valid = _check_sub(cclaims.get('sub', ''))
267267
else:
@@ -277,7 +277,6 @@ def _base_sign(self, claims):
277277
"Missing 'aud' from claims. "
278278
"'aud' is the scheme, host and optional port for this "
279279
"transaction e.g. https://example.com:8080")
280-
281280
return cclaims
282281

283282
def sign(self, claims, crypto_key=None):

python/py_vapid/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ def main():
3636
parser.add_argument('--applicationServerKey',
3737
help="show applicationServerKey value",
3838
default=False, action="store_true")
39+
parser.add_argument('--private-key', '-k', help='private key pem file',
40+
default="private_key.pem")
3941
args = parser.parse_args()
4042

4143
# Added to solve 2.7 => 3.* incompatibility
4244
Vapid = Vapid02
4345
if args.version1:
4446
Vapid = Vapid01
45-
if args.gen or not os.path.exists('private_key.pem'):
47+
if args.gen or not os.path.exists(args.private_key):
4648
if not args.gen:
47-
print("No private_key.pem file found.")
49+
print("No private key file found.")
4850
answer = None
4951
while answer not in ['y', 'n']:
5052
answer = prompt("Do you want me to create one for you? (Y/n)")
@@ -60,7 +62,7 @@ def main():
6062
vapid.save_key('private_key.pem')
6163
print("Generating public_key.pem")
6264
vapid.save_public_key('public_key.pem')
63-
vapid = Vapid.from_file('private_key.pem')
65+
vapid = Vapid.from_file(args.private_key)
6466
claim_file = args.sign
6567
result = dict()
6668
if args.applicationServerKey:

python/setup.py

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

44
from setuptools import setup, find_packages
55

6-
__version__ = "1.8.2"
6+
__version__ = "1.9.0"
77

88

99
def read_from(file):

rust/vapid/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "vapid"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
authors = ["jrconlin <jconlin+git@mozilla.com>"]
5-
edition = "2018"
5+
edition = "2021"
66
description = "An implementation of the RFC 8292 Voluntary Application Server Identification (VAPID) Auth header generator"
77
repository = "https://github.com/web-push-libs/vapid"
88
license = "MPL 2.0"

0 commit comments

Comments
 (0)