Commit Graph

56 Commits

Author SHA1 Message Date
Martin Plicka 248cd434ba
fix accepting all Vapid key instances (#137) (#139)
confirmed source change
2021-07-27 11:37:12 -07:00
Bruno Windels 336b1fb1ed
Support requests_session param in webpush fn too (#133)
* support requests_session param in webpush fn too
* format for line length
* move new requests_session argument to the end of the arg list
2021-03-15 10:51:52 -07:00
JR Conlin 94516459c6
chore: Updates for 2021 (#135)
* chore: Updates for 2021
* drop nose for pytest

Closes #124
2021-03-15 08:00:37 -07:00
Braedon Vickers 12a894ddf1
Webpush headers (#123)
* Support adding arbitrary HTTP headers when using webpush()

Useful for adding headers like `Topic` an `Urgency` that don't have
dedicated parameters.

* Send headers provided in the `--head` CLI argument
2020-04-29 13:16:48 -07:00
Andrew Trusty 1dceb01bc8 Use six.text_type instead of six.string_types (#119)
In Python 2, using six.string_types causes the code to attempt to re-encode already encoded data because six.string_types matches Python 2 str and unicode data.  Using six.text_type makes sure that the code only attempts to encode unicode data.
2019-11-27 08:32:55 -08:00
JR Conlin 10e2e1629c
feat: Add `--verbose` flag (#117)
Closes: #116
2019-08-13 15:16:50 -07:00
JR Conlin 32e3fd9420
bug: Update vapid `exp` value if it's expired. (#113)
Closes #100
2019-05-09 10:05:00 -07:00
kilgoretrout1985 4919ec186a Select legacy GCM or actual FCM endpoint for send based on the gcm_key (#110)
* Select legacy GCM or actual FCM endpoint for send based on the key provided.

* Fixed flake8 issue
2019-04-05 09:30:05 -07:00
JR Conlin 051e1575a3
bug: stand-alone still used old encoding format (#109)
* bug: stand-alone still used old encoding format
2019-04-02 13:33:15 -07:00
jrconlin 368e59272e
Fixes for cryptography update 2019-03-13 14:13:06 -07:00
jrconlin f3aabe1664
Fixup aes128gcm key injection 2019-01-04 20:29:04 -08:00
jrconlin 24d746bbf0
Merge branch 'master' of github.com:web-push-libs/pywebpush into feat/97 2019-01-04 13:59:37 -08:00
jrconlin ebf65981f4
feat: Move to RFC 8188 "aes128gcm" content encoding default
Closes #97
2019-01-04 13:52:44 -08:00
Arlo Purcell ef54603785
fix typo 2018-11-01 13:53:22 -05:00
arlo e30f7df85c Add default 'exp' field to vapid claims dict 2018-11-01 13:45:07 -05:00
jrconlin 5e8189849b bug: return the remote server response in the WebpushException
Closes #90
2018-03-30 10:42:38 -07:00
jrconlin 8667d54802 added 'ttl' as argument for webpush function
Closes #85
2018-02-01 09:50:21 -08:00
Christopher Viel 2e95413167 Copy subscription before altering the keys.
Altering subscriptions reference by changing the keys from string to
byte causes hard to debug issues in libraries. For exemple, trying to
call `json.dumps()` after initializing `WebPusher` throws an error
because json cannot handle bytes.
2018-01-03 14:58:23 -05:00
Matej Vetrak 2653f353af Fix pep8 errors 2017-12-14 13:16:41 +01:00
Matej Vetrak b3d56c9c2d Add test for requests session 2017-12-14 12:59:09 +01:00
Matej Vetrak b4ae4e125e Add option to use requests.Session object 2017-12-14 12:49:00 +01:00
jrconlin 1d1e1d47d2 bug: merge fail 2017-12-04 15:31:40 -08:00
jrconlin e02be4c16f bug: update to use vapid 'from_string' function
remove crypto upper version limit
bump py-vapid base version
2017-12-04 14:55:18 -08:00
Jonathan Bouzekri a7833643b6 add requests timeout parameter 2017-07-26 10:40:10 +02:00
jrconlin 35fd0a2e5f This fix addresses an incompatibility with Chrome 2017-05-15 09:19:18 -07:00
jrconlin 812b8c7110 feat: update to use Cryptography library
* uses lastest ece(1.7.2) and vapid libraries (1.2.1)
* Will attempt to autofill vapid `aud` from the endpoint if VAPID
requested
* Allows for the older `'aesgcm'` and newer, albeit not as widely
supported `'aes128gcm'` encryption content types.
* Includes fixes provided by https://github.com/Flimm

NOTE: Currently BLOCKED due to
https://github.com/martinthomson/encrypted-content-encoding/issues/36

closes: #49, #48, #42
2017-05-10 16:24:03 -07:00
jrconlin caf331dab8 feat: Allow VAPID with [gf]cm
* added primative CLI
* dump as curl

closes #44
2017-03-21 20:21:11 -07:00
jrconlin ac3322f653 feat: update to http-ece 0.6.4 (with draft-06 support)
use new "content_type" argument to specify either "aesgcm" (draft-01)
or "aes128gcm" (draft-04).

NOTE: Not all clients yet support Draft-04.

closes #33
2017-02-14 14:47:24 -08:00
jr conlin b2e621c798 feat: Allow empty payloads
closes #40
2017-02-14 13:23:47 -08:00
jrconlin 8ff7c68248 Convert README from markdown to restructured text
closes #35
2017-02-06 16:16:35 -08:00
Robbie Trencheny d7b5c36488 Change long to int to support Python 3 2016-10-01 11:44:20 -07:00
Matej Capkovic b6da769739 GCM ttl fix 2016-09-30 18:43:22 +02:00
jr conlin 79f3bca599 Merge branch 'master' of github.com:web-push-libs/pywebpush into bug/18
Conflicts:
	pywebpush/__init__.py
	pywebpush/tests/test_webpush.py
	requirements.txt
2016-09-05 11:23:44 -07:00
jr conlin 9dd51ea05b feat: Updated requirements, use string TTL
closes #22
2016-09-05 11:18:18 -07:00
jrconlin e284b328a2 feat: Update requirements to latest version.
Updated libraries and tests for latest depenedent library versions.
Note: can't tie in requires.io quite yet, investigating how to best do
that.

fixes: #18
2016-09-05 11:18:18 -07:00
JR Conlin 1a2e565047 Merge pull request #19 from web-push-libs/feat/18
feat: Update requirements to latest version.
2016-09-05 11:08:45 -07:00
Gasper Zejn 097d5bcbd5 Separate network request from Web Push business logic, which allows using pywebpush with both blocking and nonblocking IO. 2016-08-25 16:52:39 +02:00
jrconlin 4d1497d88c feat: Update requirements to latest version.
Updated libraries and tests for latest depenedent library versions.
Note: can't tie in requires.io quite yet, investigating how to best do
that.

fixes: #18
2016-08-15 11:11:45 -07:00
jrconlin 567a63aa39 bug: append vapid and encryption headers with a ';'
FCM, unfortunately, rejects multiple parameter sets for Crypto-Key.
This is a work-around fix until the issue is properly resolved by the
respective working groups.

closes #8
2016-08-12 11:27:35 -07:00
JR Conlin 928dfebc23 Merge pull request #9 from web-push-libs/bug/8
bug: append vapid and encryption headers with a ';'
2016-08-10 09:16:20 -07:00
flagboy d37b259af7 update send() doc string 2016-08-10 12:40:23 +09:00
Zahim Anas 7374014689 Updating docstring for WebPusher.send method
Removed duplicate description for :param reg_id:
2016-07-26 12:43:22 +01:00
jrconlin a450f68f6a bug: append vapid and encryption headers with a ';'
FCM, unfortunately, rejects multiple parameter sets for Crypto-Key.
This is a work-around fix until the issue is properly resolved by the
respective working groups.

closes #8
2016-06-28 15:34:58 -07:00
jrconlin 11abb6eb05 Merge branch 'master' of github.com:mozilla-services/pywebpush into bug/03 2016-06-06 17:26:55 -07:00
jrconlin 2056b8189e feat: Add tests for GCM compatibility
Fixed some Python3 GCM issues
2016-06-06 17:25:07 -07:00
jrconlin b39b76f614 fix flake8 errors 2016-06-06 17:23:44 -07:00
jrconlin 93c40e5e2e Added Chrome Support 2016-06-06 17:22:47 -07:00
jrconlin 66227f9aa7 feat: Add tests for GCM compatibility
Fixed some Python3 GCM issues
2016-06-06 16:58:12 -07:00
GobletSky31689 c8ccb8fabe fix flake8 errors 2016-06-06 16:55:56 -07:00
GobletSk31689 203e48f91d Added Chrome Support 2016-06-06 16:55:56 -07:00