@@ -52,11 +52,6 @@ <h1>VAPID verification</h1>
52
52
< div id ="result " class ="section ">
53
53
< a name ="claims "> < h2 > Claims</ h2 > </ a >
54
54
< p > Claims are the information a site uses to identify itself.
55
- < div class ="row ">
56
- < label for ="aud " title ="The full URL to your site. "> < b > Aud</ b > ience:</ label >
57
- < p > The optional full URL to your site.</ p >
58
- < input name ="aud " placeholder ="https://push.example.com ">
59
- </ div >
60
55
< div class ="row ">
61
56
< label for ="sub " > < b > Sub</ b > scriber:</ label >
62
57
< p > The required administrative email address that can be contacted if there's an issue</ p >
@@ -67,6 +62,17 @@ <h1>VAPID verification</h1>
67
62
< p > Time in seconds for this claim to live. (Default/Max: 24 hours from now)</ p >
68
63
< input name ="exp " id ="vapid_exp " placeholder ="Time in seconds ">
69
64
</ div >
65
+ < p > </ p >
66
+ < p > < b > < i > Note</ i > </ b > : You can add more claims if you wish.
67
+ These can include things
68
+ like, the ID of the originating server (if you have several that may be
69
+ publishing updates), a proxied customer ID or hash (for privacy reasons,
70
+ you probably don't want to make this easily determinable), or any other
71
+ value that may be useful between the Push Server Ops team and yours.
72
+ Just make the values short so you don't run the risk of the server
73
+ rejecting a request because the headers are too big.</ p >
74
+ < p > For example:
75
+ < code > {'ami_id':'e-1248296','cust_id':'a9afd519s919faio3'}</ code > </ p >
70
76
< div class ="control ">
71
77
< button id ="gen "> Generate VAPID</ button >
72
78
</ div >
@@ -124,7 +130,7 @@ <h3>Claims JSON object:</h3>
124
130
}
125
131
126
132
function success ( claims ) {
127
- for ( let n of [ "aud" , " sub", "exp" ] ) {
133
+ for ( let n of [ "sub" , "exp" ] ) {
128
134
let item = document . getElementsByName ( n ) [ 0 ] ;
129
135
item . value = claims [ n ] ;
130
136
item . classList . add ( "updated" ) ;
@@ -171,15 +177,6 @@ <h3>Claims JSON object:</h3>
171
177
reply [ item . name ] = item . value ;
172
178
}
173
179
174
- // verify aud
175
- if ( ! / ^ h t t p s ? : \/ \/ / . test ( reply [ 'aud' ] ) ) {
176
- error ( null ,
177
- `Invalid Audience: Use the full URL of your site e.g. "http://example.com"` ) ;
178
- document . getElementsByName ( "aud" ) [ 0 ] . classList . add ( "err" ) ;
179
- err = true ;
180
- } else {
181
- document . getElementsByName ( "aud" ) [ 0 ] . classList . remove ( "err" ) ;
182
- }
183
180
// verify sub
184
181
if ( ! / ^ m a i l t o : .+ @ .+ / . test ( reply [ 'sub' ] ) ) {
185
182
error ( null ,
@@ -227,7 +224,9 @@ <h3>Claims JSON object:</h3>
227
224
}
228
225
try {
229
226
let rclaims = document . getElementById ( "raw_claims" ) ;
230
- rclaims . innerHTML = JSON . stringify ( claims , null , " " ) ;
227
+ let sc = JSON . stringify ( claims , null , 4 ) ;
228
+ console . debug ( sc ) ;
229
+ rclaims . innerHTML = sc ;
231
230
rclaims . classList . add ( "updated" ) ;
232
231
vapid . generate_keys ( ) . then ( x => {
233
232
vapid . sign ( claims )
0 commit comments