Skip to content

Commit c83634d

Browse files
authored
Merge pull request #48 from web-push-libs/bug/45
bug: discuss how to generate the applicationServerKey
2 parents e991f98 + 60c56ce commit c83634d

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

python/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ with this distribution.
7575
`bin/vapid --sign claims.json --json` will output the headers in
7676
JSON format, which may be useful for other programs.
7777

78+
`bin/vapid --applicationServerKey` will return the
79+
`applicationServerKey` value you can use to make a restricted
80+
endpoint. See
81+
https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe
82+
for more details. Be aware that this value is tied to the generated
83+
public/private key. If you remove or generate a new key, any
84+
restricted URL you've previously generated will need to be
85+
reallocated. Please note that some User Agents may require you [to
86+
decode this string into a Uint8Array](https://github.com/GoogleChrome/push-notifications/blob/master/app/scripts/main.js).
87+
7888
See `bin/vapid -h` for all options and commands.
7989

8090

python/README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,14 @@ with this distribution.
8282
``bin/vapid --sign claims.json --json`` will output the headers in JSON
8383
format, which may be useful for other programs.
8484

85+
``bin/vapid --applicationServerKey`` will return the
86+
``applicationServerKey`` value you can use to make a restricted
87+
endpoint. See
88+
https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe
89+
for more details. Be aware that this value is tied to the generated
90+
public/private key. If you remove or generate a new key, any restricted
91+
URL you've previously generated will need to be reallocated. Please note
92+
that some User Agents may require you `to decode this string into a
93+
Uint8Array <https://github.com/GoogleChrome/push-notifications/blob/master/app/scripts/main.js>`__.
94+
8595
See ``bin/vapid -h`` for all options and commands.

python/py_vapid/main.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ def main():
101101
print("{}: {}\n".format(key, value))
102102
print("\n")
103103

104-
token = args.validate
105-
if token:
106-
print("signed token for dashboard validation:\n")
107-
print(vapid.validate(token))
108-
print("\n")
109-
110104

111105
if __name__ == '__main__':
112106
main()

0 commit comments

Comments
 (0)