JWT Authentication for WP REST API - Version 1.2.1

Version Description

  • Add an extra validation to get the Authorization header
  • Increase determine_current_user priority Fix #13
  • Add the user object as parameter in the jwt_auth_token_before_sign hook
  • Improve error message when auth fails #34
  • Tested with 4.6.1
Download this release

Release Info

Developer Tmeister
Plugin Icon JWT Authentication for WP REST API
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

README.md CHANGED
@@ -319,6 +319,21 @@ $data = array(
319
  );
320
  ```
321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  ##Credits
323
  [WP REST API V2](http://v2.wp-api.org/)
324
 
319
  );
320
  ```
321
 
322
+ ## Testing
323
+
324
+ Since version **1.1.0** I've added a new test suite to be sure that the basic features of this plugin do what it's expected.
325
+
326
+ You can run this test using the following command
327
+
328
+ ```
329
+ composer install
330
+ includes/vendor/bin/phpunit tests
331
+ ```
332
+
333
+ ![Command Line Output](https://s3.amazonaws.com/f.cl.ly/items/2o0j0a403A0N1a0r1C3H/Image%202016-02-27%20at%208.16.48%20PM.png?v=5fe1c76e)
334
+
335
+ All the tests can be found at https://github.com/Tmeister/wp-api-jwt-auth/tree/develop/tests/GeneralTest.php
336
+
337
  ##Credits
338
  [WP REST API V2](http://v2.wp-api.org/)
339
 
composer.json CHANGED
@@ -4,5 +4,9 @@
4
  },
5
  "require": {
6
  "firebase/php-jwt": "^3.0"
 
 
 
 
7
  }
8
  }
4
  },
5
  "require": {
6
  "firebase/php-jwt": "^3.0"
7
+ },
8
+ "require-dev": {
9
+ "phpunit/phpunit": "^5.2",
10
+ "guzzlehttp/guzzle": "^6.1"
11
  }
12
  }
composer.lock CHANGED
@@ -4,7 +4,8 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "hash": "ed805bddf241eb374d3684456d1182bf",
 
8
  "packages": [
9
  {
10
  "name": "firebase/php-jwt",
@@ -50,7 +51,1321 @@
50
  "time": "2015-07-22 18:31:08"
51
  }
52
  ],
53
- "packages-dev": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  "aliases": [],
55
  "minimum-stability": "stable",
56
  "stability-flags": [],
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
+ "hash": "0dbb679a5ef11eca6594f732092699b6",
8
+ "content-hash": "9e314d7aeab7190356aa57664f458cd4",
9
  "packages": [
10
  {
11
  "name": "firebase/php-jwt",
51
  "time": "2015-07-22 18:31:08"
52
  }
53
  ],
54
+ "packages-dev": [
55
+ {
56
+ "name": "doctrine/instantiator",
57
+ "version": "1.0.5",
58
+ "source": {
59
+ "type": "git",
60
+ "url": "https://github.com/doctrine/instantiator.git",
61
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
62
+ },
63
+ "dist": {
64
+ "type": "zip",
65
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
66
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
67
+ "shasum": ""
68
+ },
69
+ "require": {
70
+ "php": ">=5.3,<8.0-DEV"
71
+ },
72
+ "require-dev": {
73
+ "athletic/athletic": "~0.1.8",
74
+ "ext-pdo": "*",
75
+ "ext-phar": "*",
76
+ "phpunit/phpunit": "~4.0",
77
+ "squizlabs/php_codesniffer": "~2.0"
78
+ },
79
+ "type": "library",
80
+ "extra": {
81
+ "branch-alias": {
82
+ "dev-master": "1.0.x-dev"
83
+ }
84
+ },
85
+ "autoload": {
86
+ "psr-4": {
87
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
88
+ }
89
+ },
90
+ "notification-url": "https://packagist.org/downloads/",
91
+ "license": [
92
+ "MIT"
93
+ ],
94
+ "authors": [
95
+ {
96
+ "name": "Marco Pivetta",
97
+ "email": "ocramius@gmail.com",
98
+ "homepage": "http://ocramius.github.com/"
99
+ }
100
+ ],
101
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
102
+ "homepage": "https://github.com/doctrine/instantiator",
103
+ "keywords": [
104
+ "constructor",
105
+ "instantiate"
106
+ ],
107
+ "time": "2015-06-14 21:17:01"
108
+ },
109
+ {
110
+ "name": "guzzlehttp/guzzle",
111
+ "version": "6.1.1",
112
+ "source": {
113
+ "type": "git",
114
+ "url": "https://github.com/guzzle/guzzle.git",
115
+ "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c"
116
+ },
117
+ "dist": {
118
+ "type": "zip",
119
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c6851d6e48f63b69357cbfa55bca116448140e0c",
120
+ "reference": "c6851d6e48f63b69357cbfa55bca116448140e0c",
121
+ "shasum": ""
122
+ },
123
+ "require": {
124
+ "guzzlehttp/promises": "~1.0",
125
+ "guzzlehttp/psr7": "~1.1",
126
+ "php": ">=5.5.0"
127
+ },
128
+ "require-dev": {
129
+ "ext-curl": "*",
130
+ "phpunit/phpunit": "~4.0",
131
+ "psr/log": "~1.0"
132
+ },
133
+ "type": "library",
134
+ "extra": {
135
+ "branch-alias": {
136
+ "dev-master": "6.1-dev"
137
+ }
138
+ },
139
+ "autoload": {
140
+ "files": [
141
+ "src/functions_include.php"
142
+ ],
143
+ "psr-4": {
144
+ "GuzzleHttp\\": "src/"
145
+ }
146
+ },
147
+ "notification-url": "https://packagist.org/downloads/",
148
+ "license": [
149
+ "MIT"
150
+ ],
151
+ "authors": [
152
+ {
153
+ "name": "Michael Dowling",
154
+ "email": "mtdowling@gmail.com",
155
+ "homepage": "https://github.com/mtdowling"
156
+ }
157
+ ],
158
+ "description": "Guzzle is a PHP HTTP client library",
159
+ "homepage": "http://guzzlephp.org/",
160
+ "keywords": [
161
+ "client",
162
+ "curl",
163
+ "framework",
164
+ "http",
165
+ "http client",
166
+ "rest",
167
+ "web service"
168
+ ],
169
+ "time": "2015-11-23 00:47:50"
170
+ },
171
+ {
172
+ "name": "guzzlehttp/promises",
173
+ "version": "1.0.3",
174
+ "source": {
175
+ "type": "git",
176
+ "url": "https://github.com/guzzle/promises.git",
177
+ "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea"
178
+ },
179
+ "dist": {
180
+ "type": "zip",
181
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea",
182
+ "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea",
183
+ "shasum": ""
184
+ },
185
+ "require": {
186
+ "php": ">=5.5.0"
187
+ },
188
+ "require-dev": {
189
+ "phpunit/phpunit": "~4.0"
190
+ },
191
+ "type": "library",
192
+ "extra": {
193
+ "branch-alias": {
194
+ "dev-master": "1.0-dev"
195
+ }
196
+ },
197
+ "autoload": {
198
+ "psr-4": {
199
+ "GuzzleHttp\\Promise\\": "src/"
200
+ },
201
+ "files": [
202
+ "src/functions_include.php"
203
+ ]
204
+ },
205
+ "notification-url": "https://packagist.org/downloads/",
206
+ "license": [
207
+ "MIT"
208
+ ],
209
+ "authors": [
210
+ {
211
+ "name": "Michael Dowling",
212
+ "email": "mtdowling@gmail.com",
213
+ "homepage": "https://github.com/mtdowling"
214
+ }
215
+ ],
216
+ "description": "Guzzle promises library",
217
+ "keywords": [
218
+ "promise"
219
+ ],
220
+ "time": "2015-10-15 22:28:00"
221
+ },
222
+ {
223
+ "name": "guzzlehttp/psr7",
224
+ "version": "1.2.3",
225
+ "source": {
226
+ "type": "git",
227
+ "url": "https://github.com/guzzle/psr7.git",
228
+ "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b"
229
+ },
230
+ "dist": {
231
+ "type": "zip",
232
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b",
233
+ "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b",
234
+ "shasum": ""
235
+ },
236
+ "require": {
237
+ "php": ">=5.4.0",
238
+ "psr/http-message": "~1.0"
239
+ },
240
+ "provide": {
241
+ "psr/http-message-implementation": "1.0"
242
+ },
243
+ "require-dev": {
244
+ "phpunit/phpunit": "~4.0"
245
+ },
246
+ "type": "library",
247
+ "extra": {
248
+ "branch-alias": {
249
+ "dev-master": "1.0-dev"
250
+ }
251
+ },
252
+ "autoload": {
253
+ "psr-4": {
254
+ "GuzzleHttp\\Psr7\\": "src/"
255
+ },
256
+ "files": [
257
+ "src/functions_include.php"
258
+ ]
259
+ },
260
+ "notification-url": "https://packagist.org/downloads/",
261
+ "license": [
262
+ "MIT"
263
+ ],
264
+ "authors": [
265
+ {
266
+ "name": "Michael Dowling",
267
+ "email": "mtdowling@gmail.com",
268
+ "homepage": "https://github.com/mtdowling"
269
+ }
270
+ ],
271
+ "description": "PSR-7 message implementation",
272
+ "keywords": [
273
+ "http",
274
+ "message",
275
+ "stream",
276
+ "uri"
277
+ ],
278
+ "time": "2016-02-18 21:54:00"
279
+ },
280
+ {
281
+ "name": "myclabs/deep-copy",
282
+ "version": "1.5.0",
283
+ "source": {
284
+ "type": "git",
285
+ "url": "https://github.com/myclabs/DeepCopy.git",
286
+ "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc"
287
+ },
288
+ "dist": {
289
+ "type": "zip",
290
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
291
+ "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
292
+ "shasum": ""
293
+ },
294
+ "require": {
295
+ "php": ">=5.4.0"
296
+ },
297
+ "require-dev": {
298
+ "doctrine/collections": "1.*",
299
+ "phpunit/phpunit": "~4.1"
300
+ },
301
+ "type": "library",
302
+ "autoload": {
303
+ "psr-4": {
304
+ "DeepCopy\\": "src/DeepCopy/"
305
+ }
306
+ },
307
+ "notification-url": "https://packagist.org/downloads/",
308
+ "license": [
309
+ "MIT"
310
+ ],
311
+ "description": "Create deep copies (clones) of your objects",
312
+ "homepage": "https://github.com/myclabs/DeepCopy",
313
+ "keywords": [
314
+ "clone",
315
+ "copy",
316
+ "duplicate",
317
+ "object",
318
+ "object graph"
319
+ ],
320
+ "time": "2015-11-07 22:20:37"
321
+ },
322
+ {
323
+ "name": "phpdocumentor/reflection-docblock",
324
+ "version": "2.0.4",
325
+ "source": {
326
+ "type": "git",
327
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
328
+ "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
329
+ },
330
+ "dist": {
331
+ "type": "zip",
332
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
333
+ "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
334
+ "shasum": ""
335
+ },
336
+ "require": {
337
+ "php": ">=5.3.3"
338
+ },
339
+ "require-dev": {
340
+ "phpunit/phpunit": "~4.0"
341
+ },
342
+ "suggest": {
343
+ "dflydev/markdown": "~1.0",
344
+ "erusev/parsedown": "~1.0"
345
+ },
346
+ "type": "library",
347
+ "extra": {
348
+ "branch-alias": {
349
+ "dev-master": "2.0.x-dev"
350
+ }
351
+ },
352
+ "autoload": {
353
+ "psr-0": {
354
+ "phpDocumentor": [
355
+ "src/"
356
+ ]
357
+ }
358
+ },
359
+ "notification-url": "https://packagist.org/downloads/",
360
+ "license": [
361
+ "MIT"
362
+ ],
363
+ "authors": [
364
+ {
365
+ "name": "Mike van Riel",
366
+ "email": "mike.vanriel@naenius.com"
367
+ }
368
+ ],
369
+ "time": "2015-02-03 12:10:50"
370
+ },
371
+ {
372
+ "name": "phpspec/prophecy",
373
+ "version": "v1.6.0",
374
+ "source": {
375
+ "type": "git",
376
+ "url": "https://github.com/phpspec/prophecy.git",
377
+ "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972"
378
+ },
379
+ "dist": {
380
+ "type": "zip",
381
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972",
382
+ "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972",
383
+ "shasum": ""
384
+ },
385
+ "require": {
386
+ "doctrine/instantiator": "^1.0.2",
387
+ "php": "^5.3|^7.0",
388
+ "phpdocumentor/reflection-docblock": "~2.0",
389
+ "sebastian/comparator": "~1.1",
390
+ "sebastian/recursion-context": "~1.0"
391
+ },
392
+ "require-dev": {
393
+ "phpspec/phpspec": "~2.0"
394
+ },
395
+ "type": "library",
396
+ "extra": {
397
+ "branch-alias": {
398
+ "dev-master": "1.5.x-dev"
399
+ }
400
+ },
401
+ "autoload": {
402
+ "psr-0": {
403
+ "Prophecy\\": "src/"
404
+ }
405
+ },
406
+ "notification-url": "https://packagist.org/downloads/",
407
+ "license": [
408
+ "MIT"
409
+ ],
410
+ "authors": [
411
+ {
412
+ "name": "Konstantin Kudryashov",
413
+ "email": "ever.zet@gmail.com",
414
+ "homepage": "http://everzet.com"
415
+ },
416
+ {
417
+ "name": "Marcello Duarte",
418
+ "email": "marcello.duarte@gmail.com"
419
+ }
420
+ ],
421
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
422
+ "homepage": "https://github.com/phpspec/prophecy",
423
+ "keywords": [
424
+ "Double",
425
+ "Dummy",
426
+ "fake",
427
+ "mock",
428
+ "spy",
429
+ "stub"
430
+ ],
431
+ "time": "2016-02-15 07:46:21"
432
+ },
433
+ {
434
+ "name": "phpunit/php-code-coverage",
435
+ "version": "3.2.1",
436
+ "source": {
437
+ "type": "git",
438
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
439
+ "reference": "a58f95ae76fe201b571fad3e8370a50c4368678c"
440
+ },
441
+ "dist": {
442
+ "type": "zip",
443
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a58f95ae76fe201b571fad3e8370a50c4368678c",
444
+ "reference": "a58f95ae76fe201b571fad3e8370a50c4368678c",
445
+ "shasum": ""
446
+ },
447
+ "require": {
448
+ "php": "^5.6 || ^7.0",
449
+ "phpunit/php-file-iterator": "~1.3",
450
+ "phpunit/php-text-template": "~1.2",
451
+ "phpunit/php-token-stream": "^1.4.2",
452
+ "sebastian/code-unit-reverse-lookup": "~1.0",
453
+ "sebastian/environment": "^1.3.2",
454
+ "sebastian/version": "~1.0|~2.0"
455
+ },
456
+ "require-dev": {
457
+ "ext-xdebug": ">=2.1.4",
458
+ "phpunit/phpunit": "~5"
459
+ },
460
+ "suggest": {
461
+ "ext-dom": "*",
462
+ "ext-xdebug": ">=2.2.1",
463
+ "ext-xmlwriter": "*"
464
+ },
465
+ "type": "library",
466
+ "extra": {
467
+ "branch-alias": {
468
+ "dev-master": "3.2.x-dev"
469
+ }
470
+ },
471
+ "autoload": {
472
+ "classmap": [
473
+ "src/"
474
+ ]
475
+ },
476
+ "notification-url": "https://packagist.org/downloads/",
477
+ "license": [
478
+ "BSD-3-Clause"
479
+ ],
480
+ "authors": [
481
+ {
482
+ "name": "Sebastian Bergmann",
483
+ "email": "sb@sebastian-bergmann.de",
484
+ "role": "lead"
485
+ }
486
+ ],
487
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
488
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
489
+ "keywords": [
490
+ "coverage",
491
+ "testing",
492
+ "xunit"
493
+ ],
494
+ "time": "2016-02-18 07:31:12"
495
+ },
496
+ {
497
+ "name": "phpunit/php-file-iterator",
498
+ "version": "1.4.1",
499
+ "source": {
500
+ "type": "git",
501
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
502
+ "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
503
+ },
504
+ "dist": {
505
+ "type": "zip",
506
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
507
+ "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
508
+ "shasum": ""
509
+ },
510
+ "require": {
511
+ "php": ">=5.3.3"
512
+ },
513
+ "type": "library",
514
+ "extra": {
515
+ "branch-alias": {
516
+ "dev-master": "1.4.x-dev"
517
+ }
518
+ },
519
+ "autoload": {
520
+ "classmap": [
521
+ "src/"
522
+ ]
523
+ },
524
+ "notification-url": "https://packagist.org/downloads/",
525
+ "license": [
526
+ "BSD-3-Clause"
527
+ ],
528
+ "authors": [
529
+ {
530
+ "name": "Sebastian Bergmann",
531
+ "email": "sb@sebastian-bergmann.de",
532
+ "role": "lead"
533
+ }
534
+ ],
535
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
536
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
537
+ "keywords": [
538
+ "filesystem",
539
+ "iterator"
540
+ ],
541
+ "time": "2015-06-21 13:08:43"
542
+ },
543
+ {
544
+ "name": "phpunit/php-text-template",
545
+ "version": "1.2.1",
546
+ "source": {
547
+ "type": "git",
548
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
549
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
550
+ },
551
+ "dist": {
552
+ "type": "zip",
553
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
554
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
555
+ "shasum": ""
556
+ },
557
+ "require": {
558
+ "php": ">=5.3.3"
559
+ },
560
+ "type": "library",
561
+ "autoload": {
562
+ "classmap": [
563
+ "src/"
564
+ ]
565
+ },
566
+ "notification-url": "https://packagist.org/downloads/",
567
+ "license": [
568
+ "BSD-3-Clause"
569
+ ],
570
+ "authors": [
571
+ {
572
+ "name": "Sebastian Bergmann",
573
+ "email": "sebastian@phpunit.de",
574
+ "role": "lead"
575
+ }
576
+ ],
577
+ "description": "Simple template engine.",
578
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
579
+ "keywords": [
580
+ "template"
581
+ ],
582
+ "time": "2015-06-21 13:50:34"
583
+ },
584
+ {
585
+ "name": "phpunit/php-timer",
586
+ "version": "1.0.7",
587
+ "source": {
588
+ "type": "git",
589
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
590
+ "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
591
+ },
592
+ "dist": {
593
+ "type": "zip",
594
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
595
+ "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
596
+ "shasum": ""
597
+ },
598
+ "require": {
599
+ "php": ">=5.3.3"
600
+ },
601
+ "type": "library",
602
+ "autoload": {
603
+ "classmap": [
604
+ "src/"
605
+ ]
606
+ },
607
+ "notification-url": "https://packagist.org/downloads/",
608
+ "license": [
609
+ "BSD-3-Clause"
610
+ ],
611
+ "authors": [
612
+ {
613
+ "name": "Sebastian Bergmann",
614
+ "email": "sb@sebastian-bergmann.de",
615
+ "role": "lead"
616
+ }
617
+ ],
618
+ "description": "Utility class for timing",
619
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
620
+ "keywords": [
621
+ "timer"
622
+ ],
623
+ "time": "2015-06-21 08:01:12"
624
+ },
625
+ {
626
+ "name": "phpunit/php-token-stream",
627
+ "version": "1.4.8",
628
+ "source": {
629
+ "type": "git",
630
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
631
+ "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
632
+ },
633
+ "dist": {
634
+ "type": "zip",
635
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
636
+ "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
637
+ "shasum": ""
638
+ },
639
+ "require": {
640
+ "ext-tokenizer": "*",
641
+ "php": ">=5.3.3"
642
+ },
643
+ "require-dev": {
644
+ "phpunit/phpunit": "~4.2"
645
+ },
646
+ "type": "library",
647
+ "extra": {
648
+ "branch-alias": {
649
+ "dev-master": "1.4-dev"
650
+ }
651
+ },
652
+ "autoload": {
653
+ "classmap": [
654
+ "src/"
655
+ ]
656
+ },
657
+ "notification-url": "https://packagist.org/downloads/",
658
+ "license": [
659
+ "BSD-3-Clause"
660
+ ],
661
+ "authors": [
662
+ {
663
+ "name": "Sebastian Bergmann",
664
+ "email": "sebastian@phpunit.de"
665
+ }
666
+ ],
667
+ "description": "Wrapper around PHP's tokenizer extension.",
668
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
669
+ "keywords": [
670
+ "tokenizer"
671
+ ],
672
+ "time": "2015-09-15 10:49:45"
673
+ },
674
+ {
675
+ "name": "phpunit/phpunit",
676
+ "version": "5.2.9",
677
+ "source": {
678
+ "type": "git",
679
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
680
+ "reference": "b12b9c37e382c096b93c3f26e7395775f59a5eea"
681
+ },
682
+ "dist": {
683
+ "type": "zip",
684
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b12b9c37e382c096b93c3f26e7395775f59a5eea",
685
+ "reference": "b12b9c37e382c096b93c3f26e7395775f59a5eea",
686
+ "shasum": ""
687
+ },
688
+ "require": {
689
+ "ext-dom": "*",
690
+ "ext-json": "*",
691
+ "ext-pcre": "*",
692
+ "ext-reflection": "*",
693
+ "ext-spl": "*",
694
+ "myclabs/deep-copy": "~1.3",
695
+ "php": "^5.6 || ^7.0",
696
+ "phpspec/prophecy": "^1.3.1",
697
+ "phpunit/php-code-coverage": "^3.2.1",
698
+ "phpunit/php-file-iterator": "~1.4",
699
+ "phpunit/php-text-template": "~1.2",
700
+ "phpunit/php-timer": ">=1.0.6",
701
+ "phpunit/phpunit-mock-objects": ">=3.0.5",
702
+ "sebastian/comparator": "~1.1",
703
+ "sebastian/diff": "~1.2",
704
+ "sebastian/environment": "~1.3",
705
+ "sebastian/exporter": "~1.2",
706
+ "sebastian/global-state": "~1.0",
707
+ "sebastian/resource-operations": "~1.0",
708
+ "sebastian/version": "~1.0|~2.0",
709
+ "symfony/yaml": "~2.1|~3.0"
710
+ },
711
+ "suggest": {
712
+ "phpunit/php-invoker": "~1.1"
713
+ },
714
+ "bin": [
715
+ "phpunit"
716
+ ],
717
+ "type": "library",
718
+ "extra": {
719
+ "branch-alias": {
720
+ "dev-master": "5.2.x-dev"
721
+ }
722
+ },
723
+ "autoload": {
724
+ "classmap": [
725
+ "src/"
726
+ ]
727
+ },
728
+ "notification-url": "https://packagist.org/downloads/",
729
+ "license": [
730
+ "BSD-3-Clause"
731
+ ],
732
+ "authors": [
733
+ {
734
+ "name": "Sebastian Bergmann",
735
+ "email": "sebastian@phpunit.de",
736
+ "role": "lead"
737
+ }
738
+ ],
739
+ "description": "The PHP Unit Testing framework.",
740
+ "homepage": "https://phpunit.de/",
741
+ "keywords": [
742
+ "phpunit",
743
+ "testing",
744
+ "xunit"
745
+ ],
746
+ "time": "2016-02-19 11:43:07"
747
+ },
748
+ {
749
+ "name": "phpunit/phpunit-mock-objects",
750
+ "version": "3.0.6",
751
+ "source": {
752
+ "type": "git",
753
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
754
+ "reference": "49bc700750196c04dd6bc2c4c99cb632b893836b"
755
+ },
756
+ "dist": {
757
+ "type": "zip",
758
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/49bc700750196c04dd6bc2c4c99cb632b893836b",
759
+ "reference": "49bc700750196c04dd6bc2c4c99cb632b893836b",
760
+ "shasum": ""
761
+ },
762
+ "require": {
763
+ "doctrine/instantiator": "^1.0.2",
764
+ "php": ">=5.6",
765
+ "phpunit/php-text-template": "~1.2",
766
+ "sebastian/exporter": "~1.2"
767
+ },
768
+ "require-dev": {
769
+ "phpunit/phpunit": "~5"
770
+ },
771
+ "suggest": {
772
+ "ext-soap": "*"
773
+ },
774
+ "type": "library",
775
+ "extra": {
776
+ "branch-alias": {
777
+ "dev-master": "3.0.x-dev"
778
+ }
779
+ },
780
+ "autoload": {
781
+ "classmap": [
782
+ "src/"
783
+ ]
784
+ },
785
+ "notification-url": "https://packagist.org/downloads/",
786
+ "license": [
787
+ "BSD-3-Clause"
788
+ ],
789
+ "authors": [
790
+ {
791
+ "name": "Sebastian Bergmann",
792
+ "email": "sb@sebastian-bergmann.de",
793
+ "role": "lead"
794
+ }
795
+ ],
796
+ "description": "Mock Object library for PHPUnit",
797
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
798
+ "keywords": [
799
+ "mock",
800
+ "xunit"
801
+ ],
802
+ "time": "2015-12-08 08:47:06"
803
+ },
804
+ {
805
+ "name": "psr/http-message",
806
+ "version": "1.0",
807
+ "source": {
808
+ "type": "git",
809
+ "url": "https://github.com/php-fig/http-message.git",
810
+ "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298"
811
+ },
812
+ "dist": {
813
+ "type": "zip",
814
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
815
+ "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
816
+ "shasum": ""
817
+ },
818
+ "require": {
819
+ "php": ">=5.3.0"
820
+ },
821
+ "type": "library",
822
+ "extra": {
823
+ "branch-alias": {
824
+ "dev-master": "1.0.x-dev"
825
+ }
826
+ },
827
+ "autoload": {
828
+ "psr-4": {
829
+ "Psr\\Http\\Message\\": "src/"
830
+ }
831
+ },
832
+ "notification-url": "https://packagist.org/downloads/",
833
+ "license": [
834
+ "MIT"
835
+ ],
836
+ "authors": [
837
+ {
838
+ "name": "PHP-FIG",
839
+ "homepage": "http://www.php-fig.org/"
840
+ }
841
+ ],
842
+ "description": "Common interface for HTTP messages",
843
+ "keywords": [
844
+ "http",
845
+ "http-message",
846
+ "psr",
847
+ "psr-7",
848
+ "request",
849
+ "response"
850
+ ],
851
+ "time": "2015-05-04 20:22:00"
852
+ },
853
+ {
854
+ "name": "sebastian/code-unit-reverse-lookup",
855
+ "version": "1.0.0",
856
+ "source": {
857
+ "type": "git",
858
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
859
+ "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe"
860
+ },
861
+ "dist": {
862
+ "type": "zip",
863
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
864
+ "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
865
+ "shasum": ""
866
+ },
867
+ "require": {
868
+ "php": ">=5.6"
869
+ },
870
+ "require-dev": {
871
+ "phpunit/phpunit": "~5"
872
+ },
873
+ "type": "library",
874
+ "extra": {
875
+ "branch-alias": {
876
+ "dev-master": "1.0.x-dev"
877
+ }
878
+ },
879
+ "autoload": {
880
+ "classmap": [
881
+ "src/"
882
+ ]
883
+ },
884
+ "notification-url": "https://packagist.org/downloads/",
885
+ "license": [
886
+ "BSD-3-Clause"
887
+ ],
888
+ "authors": [
889
+ {
890
+ "name": "Sebastian Bergmann",
891
+ "email": "sebastian@phpunit.de"
892
+ }
893
+ ],
894
+ "description": "Looks up which function or method a line of code belongs to",
895
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
896
+ "time": "2016-02-13 06:45:14"
897
+ },
898
+ {
899
+ "name": "sebastian/comparator",
900
+ "version": "1.2.0",
901
+ "source": {
902
+ "type": "git",
903
+ "url": "https://github.com/sebastianbergmann/comparator.git",
904
+ "reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
905
+ },
906
+ "dist": {
907
+ "type": "zip",
908
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
909
+ "reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
910
+ "shasum": ""
911
+ },
912
+ "require": {
913
+ "php": ">=5.3.3",
914
+ "sebastian/diff": "~1.2",
915
+ "sebastian/exporter": "~1.2"
916
+ },
917
+ "require-dev": {
918
+ "phpunit/phpunit": "~4.4"
919
+ },
920
+ "type": "library",
921
+ "extra": {
922
+ "branch-alias": {
923
+ "dev-master": "1.2.x-dev"
924
+ }
925
+ },
926
+ "autoload": {
927
+ "classmap": [
928
+ "src/"
929
+ ]
930
+ },
931
+ "notification-url": "https://packagist.org/downloads/",
932
+ "license": [
933
+ "BSD-3-Clause"
934
+ ],
935
+ "authors": [
936
+ {
937
+ "name": "Jeff Welch",
938
+ "email": "whatthejeff@gmail.com"
939
+ },
940
+ {
941
+ "name": "Volker Dusch",
942
+ "email": "github@wallbash.com"
943
+ },
944
+ {
945
+ "name": "Bernhard Schussek",
946
+ "email": "bschussek@2bepublished.at"
947
+ },
948
+ {
949
+ "name": "Sebastian Bergmann",
950
+ "email": "sebastian@phpunit.de"
951
+ }
952
+ ],
953
+ "description": "Provides the functionality to compare PHP values for equality",
954
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
955
+ "keywords": [
956
+ "comparator",
957
+ "compare",
958
+ "equality"
959
+ ],
960
+ "time": "2015-07-26 15:48:44"
961
+ },
962
+ {
963
+ "name": "sebastian/diff",
964
+ "version": "1.4.1",
965
+ "source": {
966
+ "type": "git",
967
+ "url": "https://github.com/sebastianbergmann/diff.git",
968
+ "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
969
+ },
970
+ "dist": {
971
+ "type": "zip",
972
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
973
+ "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
974
+ "shasum": ""
975
+ },
976
+ "require": {
977
+ "php": ">=5.3.3"
978
+ },
979
+ "require-dev": {
980
+ "phpunit/phpunit": "~4.8"
981
+ },
982
+ "type": "library",
983
+ "extra": {
984
+ "branch-alias": {
985
+ "dev-master": "1.4-dev"
986
+ }
987
+ },
988
+ "autoload": {
989
+ "classmap": [
990
+ "src/"
991
+ ]
992
+ },
993
+ "notification-url": "https://packagist.org/downloads/",
994
+ "license": [
995
+ "BSD-3-Clause"
996
+ ],
997
+ "authors": [
998
+ {
999
+ "name": "Kore Nordmann",
1000
+ "email": "mail@kore-nordmann.de"
1001
+ },
1002
+ {
1003
+ "name": "Sebastian Bergmann",
1004
+ "email": "sebastian@phpunit.de"
1005
+ }
1006
+ ],
1007
+ "description": "Diff implementation",
1008
+ "homepage": "https://github.com/sebastianbergmann/diff",
1009
+ "keywords": [
1010
+ "diff"
1011
+ ],
1012
+ "time": "2015-12-08 07:14:41"
1013
+ },
1014
+ {
1015
+ "name": "sebastian/environment",
1016
+ "version": "1.3.5",
1017
+ "source": {
1018
+ "type": "git",
1019
+ "url": "https://github.com/sebastianbergmann/environment.git",
1020
+ "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
1021
+ },
1022
+ "dist": {
1023
+ "type": "zip",
1024
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
1025
+ "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
1026
+ "shasum": ""
1027
+ },
1028
+ "require": {
1029
+ "php": ">=5.3.3"
1030
+ },
1031
+ "require-dev": {
1032
+ "phpunit/phpunit": "~4.4"
1033
+ },
1034
+ "type": "library",
1035
+ "extra": {
1036
+ "branch-alias": {
1037
+ "dev-master": "1.3.x-dev"
1038
+ }
1039
+ },
1040
+ "autoload": {
1041
+ "classmap": [
1042
+ "src/"
1043
+ ]
1044
+ },
1045
+ "notification-url": "https://packagist.org/downloads/",
1046
+ "license": [
1047
+ "BSD-3-Clause"
1048
+ ],
1049
+ "authors": [
1050
+ {
1051
+ "name": "Sebastian Bergmann",
1052
+ "email": "sebastian@phpunit.de"
1053
+ }
1054
+ ],
1055
+ "description": "Provides functionality to handle HHVM/PHP environments",
1056
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
1057
+ "keywords": [
1058
+ "Xdebug",
1059
+ "environment",
1060
+ "hhvm"
1061
+ ],
1062
+ "time": "2016-02-26 18:40:46"
1063
+ },
1064
+ {
1065
+ "name": "sebastian/exporter",
1066
+ "version": "1.2.1",
1067
+ "source": {
1068
+ "type": "git",
1069
+ "url": "https://github.com/sebastianbergmann/exporter.git",
1070
+ "reference": "7ae5513327cb536431847bcc0c10edba2701064e"
1071
+ },
1072
+ "dist": {
1073
+ "type": "zip",
1074
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e",
1075
+ "reference": "7ae5513327cb536431847bcc0c10edba2701064e",
1076
+ "shasum": ""
1077
+ },
1078
+ "require": {
1079
+ "php": ">=5.3.3",
1080
+ "sebastian/recursion-context": "~1.0"
1081
+ },
1082
+ "require-dev": {
1083
+ "phpunit/phpunit": "~4.4"
1084
+ },
1085
+ "type": "library",
1086
+ "extra": {
1087
+ "branch-alias": {
1088
+ "dev-master": "1.2.x-dev"
1089
+ }
1090
+ },
1091
+ "autoload": {
1092
+ "classmap": [
1093
+ "src/"
1094
+ ]
1095
+ },
1096
+ "notification-url": "https://packagist.org/downloads/",
1097
+ "license": [
1098
+ "BSD-3-Clause"
1099
+ ],
1100
+ "authors": [
1101
+ {
1102
+ "name": "Jeff Welch",
1103
+ "email": "whatthejeff@gmail.com"
1104
+ },
1105
+ {
1106
+ "name": "Volker Dusch",
1107
+ "email": "github@wallbash.com"
1108
+ },
1109
+ {
1110
+ "name": "Bernhard Schussek",
1111
+ "email": "bschussek@2bepublished.at"
1112
+ },
1113
+ {
1114
+ "name": "Sebastian Bergmann",
1115
+ "email": "sebastian@phpunit.de"
1116
+ },
1117
+ {
1118
+ "name": "Adam Harvey",
1119
+ "email": "aharvey@php.net"
1120
+ }
1121
+ ],
1122
+ "description": "Provides the functionality to export PHP variables for visualization",
1123
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
1124
+ "keywords": [
1125
+ "export",
1126
+ "exporter"
1127
+ ],
1128
+ "time": "2015-06-21 07:55:53"
1129
+ },
1130
+ {
1131
+ "name": "sebastian/global-state",
1132
+ "version": "1.1.1",
1133
+ "source": {
1134
+ "type": "git",
1135
+ "url": "https://github.com/sebastianbergmann/global-state.git",
1136
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
1137
+ },
1138
+ "dist": {
1139
+ "type": "zip",
1140
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
1141
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
1142
+ "shasum": ""
1143
+ },
1144
+ "require": {
1145
+ "php": ">=5.3.3"
1146
+ },
1147
+ "require-dev": {
1148
+ "phpunit/phpunit": "~4.2"
1149
+ },
1150
+ "suggest": {
1151
+ "ext-uopz": "*"
1152
+ },
1153
+ "type": "library",
1154
+ "extra": {
1155
+ "branch-alias": {
1156
+ "dev-master": "1.0-dev"
1157
+ }
1158
+ },
1159
+ "autoload": {
1160
+ "classmap": [
1161
+ "src/"
1162
+ ]
1163
+ },
1164
+ "notification-url": "https://packagist.org/downloads/",
1165
+ "license": [
1166
+ "BSD-3-Clause"
1167
+ ],
1168
+ "authors": [
1169
+ {
1170
+ "name": "Sebastian Bergmann",
1171
+ "email": "sebastian@phpunit.de"
1172
+ }
1173
+ ],
1174
+ "description": "Snapshotting of global state",
1175
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
1176
+ "keywords": [
1177
+ "global state"
1178
+ ],
1179
+ "time": "2015-10-12 03:26:01"
1180
+ },
1181
+ {
1182
+ "name": "sebastian/recursion-context",
1183
+ "version": "1.0.2",
1184
+ "source": {
1185
+ "type": "git",
1186
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
1187
+ "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
1188
+ },
1189
+ "dist": {
1190
+ "type": "zip",
1191
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
1192
+ "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
1193
+ "shasum": ""
1194
+ },
1195
+ "require": {
1196
+ "php": ">=5.3.3"
1197
+ },
1198
+ "require-dev": {
1199
+ "phpunit/phpunit": "~4.4"
1200
+ },
1201
+ "type": "library",
1202
+ "extra": {
1203
+ "branch-alias": {
1204
+ "dev-master": "1.0.x-dev"
1205
+ }
1206
+ },
1207
+ "autoload": {
1208
+ "classmap": [
1209
+ "src/"
1210
+ ]
1211
+ },
1212
+ "notification-url": "https://packagist.org/downloads/",
1213
+ "license": [
1214
+ "BSD-3-Clause"
1215
+ ],
1216
+ "authors": [
1217
+ {
1218
+ "name": "Jeff Welch",
1219
+ "email": "whatthejeff@gmail.com"
1220
+ },
1221
+ {
1222
+ "name": "Sebastian Bergmann",
1223
+ "email": "sebastian@phpunit.de"
1224
+ },
1225
+ {
1226
+ "name": "Adam Harvey",
1227
+ "email": "aharvey@php.net"
1228
+ }
1229
+ ],
1230
+ "description": "Provides functionality to recursively process PHP variables",
1231
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1232
+ "time": "2015-11-11 19:50:13"
1233
+ },
1234
+ {
1235
+ "name": "sebastian/resource-operations",
1236
+ "version": "1.0.0",
1237
+ "source": {
1238
+ "type": "git",
1239
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
1240
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
1241
+ },
1242
+ "dist": {
1243
+ "type": "zip",
1244
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1245
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1246
+ "shasum": ""
1247
+ },
1248
+ "require": {
1249
+ "php": ">=5.6.0"
1250
+ },
1251
+ "type": "library",
1252
+ "extra": {
1253
+ "branch-alias": {
1254
+ "dev-master": "1.0.x-dev"
1255
+ }
1256
+ },
1257
+ "autoload": {
1258
+ "classmap": [
1259
+ "src/"
1260
+ ]
1261
+ },
1262
+ "notification-url": "https://packagist.org/downloads/",
1263
+ "license": [
1264
+ "BSD-3-Clause"
1265
+ ],
1266
+ "authors": [
1267
+ {
1268
+ "name": "Sebastian Bergmann",
1269
+ "email": "sebastian@phpunit.de"
1270
+ }
1271
+ ],
1272
+ "description": "Provides a list of PHP built-in functions that operate on resources",
1273
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1274
+ "time": "2015-07-28 20:34:47"
1275
+ },
1276
+ {
1277
+ "name": "sebastian/version",
1278
+ "version": "2.0.0",
1279
+ "source": {
1280
+ "type": "git",
1281
+ "url": "https://github.com/sebastianbergmann/version.git",
1282
+ "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5"
1283
+ },
1284
+ "dist": {
1285
+ "type": "zip",
1286
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5",
1287
+ "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5",
1288
+ "shasum": ""
1289
+ },
1290
+ "require": {
1291
+ "php": ">=5.6"
1292
+ },
1293
+ "type": "library",
1294
+ "extra": {
1295
+ "branch-alias": {
1296
+ "dev-master": "2.0.x-dev"
1297
+ }
1298
+ },
1299
+ "autoload": {
1300
+ "classmap": [
1301
+ "src/"
1302
+ ]
1303
+ },
1304
+ "notification-url": "https://packagist.org/downloads/",
1305
+ "license": [
1306
+ "BSD-3-Clause"
1307
+ ],
1308
+ "authors": [
1309
+ {
1310
+ "name": "Sebastian Bergmann",
1311
+ "email": "sebastian@phpunit.de",
1312
+ "role": "lead"
1313
+ }
1314
+ ],
1315
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1316
+ "homepage": "https://github.com/sebastianbergmann/version",
1317
+ "time": "2016-02-04 12:56:52"
1318
+ },
1319
+ {
1320
+ "name": "symfony/yaml",
1321
+ "version": "v3.0.2",
1322
+ "source": {
1323
+ "type": "git",
1324
+ "url": "https://github.com/symfony/yaml.git",
1325
+ "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a"
1326
+ },
1327
+ "dist": {
1328
+ "type": "zip",
1329
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/3cf0709d7fe936e97bee9e954382e449003f1d9a",
1330
+ "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a",
1331
+ "shasum": ""
1332
+ },
1333
+ "require": {
1334
+ "php": ">=5.5.9"
1335
+ },
1336
+ "type": "library",
1337
+ "extra": {
1338
+ "branch-alias": {
1339
+ "dev-master": "3.0-dev"
1340
+ }
1341
+ },
1342
+ "autoload": {
1343
+ "psr-4": {
1344
+ "Symfony\\Component\\Yaml\\": ""
1345
+ },
1346
+ "exclude-from-classmap": [
1347
+ "/Tests/"
1348
+ ]
1349
+ },
1350
+ "notification-url": "https://packagist.org/downloads/",
1351
+ "license": [
1352
+ "MIT"
1353
+ ],
1354
+ "authors": [
1355
+ {
1356
+ "name": "Fabien Potencier",
1357
+ "email": "fabien@symfony.com"
1358
+ },
1359
+ {
1360
+ "name": "Symfony Community",
1361
+ "homepage": "https://symfony.com/contributors"
1362
+ }
1363
+ ],
1364
+ "description": "Symfony Yaml Component",
1365
+ "homepage": "https://symfony.com",
1366
+ "time": "2016-02-02 13:44:19"
1367
+ }
1368
+ ],
1369
  "aliases": [],
1370
  "minimum-stability": "stable",
1371
  "stability-flags": [],
includes/class-jwt-auth.php CHANGED
@@ -65,7 +65,7 @@ class Jwt_Auth
65
  public function __construct()
66
  {
67
  $this->plugin_name = 'jwt-auth';
68
- $this->version = '1.0.0';
69
 
70
  $this->load_dependencies();
71
  $this->set_locale();
@@ -141,7 +141,7 @@ class Jwt_Auth
141
  $plugin_public = new Jwt_Auth_Public($this->get_plugin_name(), $this->get_version());
142
  $this->loader->add_action('rest_api_init', $plugin_public, 'add_api_routes');
143
  $this->loader->add_filter('rest_api_init', $plugin_public, 'add_cors_support');
144
- $this->loader->add_filter('determine_current_user', $plugin_public, 'determine_current_user', 99);
145
  $this->loader->add_filter( 'rest_pre_dispatch', $plugin_public, 'rest_pre_dispatch', 10, 2 );
146
  }
147
 
65
  public function __construct()
66
  {
67
  $this->plugin_name = 'jwt-auth';
68
+ $this->version = '1.1.0';
69
 
70
  $this->load_dependencies();
71
  $this->set_locale();
141
  $plugin_public = new Jwt_Auth_Public($this->get_plugin_name(), $this->get_version());
142
  $this->loader->add_action('rest_api_init', $plugin_public, 'add_api_routes');
143
  $this->loader->add_filter('rest_api_init', $plugin_public, 'add_cors_support');
144
+ $this->loader->add_filter('determine_current_user', $plugin_public, 'determine_current_user', 10);
145
  $this->loader->add_filter( 'rest_pre_dispatch', $plugin_public, 'rest_pre_dispatch', 10, 2 );
146
  }
147
 
includes/vendor/composer/ClassLoader.php CHANGED
@@ -13,9 +13,7 @@
13
  namespace Composer\Autoload;
14
 
15
  /**
16
- * ClassLoader implements a PSR-0 class loader
17
- *
18
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
19
  *
20
  * $loader = new \Composer\Autoload\ClassLoader();
21
  *
@@ -39,6 +37,8 @@ namespace Composer\Autoload;
39
  *
40
  * @author Fabien Potencier <fabien@symfony.com>
41
  * @author Jordi Boggiano <j.boggiano@seld.be>
 
 
42
  */
43
  class ClassLoader
44
  {
@@ -147,7 +147,7 @@ class ClassLoader
147
  * appending or prepending to the ones previously set for this namespace.
148
  *
149
  * @param string $prefix The prefix/namespace, with trailing '\\'
150
- * @param array|string $paths The PSR-0 base directories
151
  * @param bool $prepend Whether to prepend the directories
152
  *
153
  * @throws \InvalidArgumentException
@@ -351,7 +351,7 @@ class ClassLoader
351
  foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
  if (0 === strpos($class, $prefix)) {
353
  foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
- if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
  return $file;
356
  }
357
  }
@@ -361,7 +361,7 @@ class ClassLoader
361
 
362
  // PSR-4 fallback dirs
363
  foreach ($this->fallbackDirsPsr4 as $dir) {
364
- if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
  return $file;
366
  }
367
  }
@@ -380,7 +380,7 @@ class ClassLoader
380
  foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
  if (0 === strpos($class, $prefix)) {
382
  foreach ($dirs as $dir) {
383
- if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
  return $file;
385
  }
386
  }
@@ -390,7 +390,7 @@ class ClassLoader
390
 
391
  // PSR-0 fallback dirs
392
  foreach ($this->fallbackDirsPsr0 as $dir) {
393
- if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
  return $file;
395
  }
396
  }
13
  namespace Composer\Autoload;
14
 
15
  /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 
 
17
  *
18
  * $loader = new \Composer\Autoload\ClassLoader();
19
  *
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
147
  * appending or prepending to the ones previously set for this namespace.
148
  *
149
  * @param string $prefix The prefix/namespace, with trailing '\\'
150
+ * @param array|string $paths The PSR-4 base directories
151
  * @param bool $prepend Whether to prepend the directories
152
  *
153
  * @throws \InvalidArgumentException
351
  foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
  if (0 === strpos($class, $prefix)) {
353
  foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
  return $file;
356
  }
357
  }
361
 
362
  // PSR-4 fallback dirs
363
  foreach ($this->fallbackDirsPsr4 as $dir) {
364
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
  return $file;
366
  }
367
  }
380
  foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
  if (0 === strpos($class, $prefix)) {
382
  foreach ($dirs as $dir) {
383
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
  return $file;
385
  }
386
  }
390
 
391
  // PSR-0 fallback dirs
392
  foreach ($this->fallbackDirsPsr0 as $dir) {
393
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
  return $file;
395
  }
396
  }
includes/vendor/composer/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
 
2
- Copyright (c) 2015 Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
1
 
2
+ Copyright (c) 2016 Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
includes/vendor/composer/autoload_real.php CHANGED
@@ -23,19 +23,26 @@ class ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5', 'loadClassLoader'));
25
 
26
- $map = require __DIR__ . '/autoload_namespaces.php';
27
- foreach ($map as $namespace => $path) {
28
- $loader->set($namespace, $path);
29
- }
30
-
31
- $map = require __DIR__ . '/autoload_psr4.php';
32
- foreach ($map as $namespace => $path) {
33
- $loader->setPsr4($namespace, $path);
34
- }
35
-
36
- $classMap = require __DIR__ . '/autoload_classmap.php';
37
- if ($classMap) {
38
- $loader->addClassMap($classMap);
 
 
 
 
 
 
 
39
  }
40
 
41
  $loader->register(true);
@@ -43,8 +50,3 @@ class ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5
43
  return $loader;
44
  }
45
  }
46
-
47
- function composerRequire6ba6ee55693d165c056f65e51c5383a5($file)
48
- {
49
- require $file;
50
- }
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5', 'loadClassLoader'));
25
 
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
+ if ($useStaticLoader) {
28
+ require_once __DIR__ . '/autoload_static.php';
29
+
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::getInitializer($loader));
31
+ } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
+
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
+ $classMap = require __DIR__ . '/autoload_classmap.php';
43
+ if ($classMap) {
44
+ $loader->addClassMap($classMap);
45
+ }
46
  }
47
 
48
  $loader->register(true);
50
  return $loader;
51
  }
52
  }
 
 
 
 
 
jwt-auth.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: JWT Authentication for WP-API
16
  * Plugin URI: https://enriquechavez.co
17
  * Description: Extends the WP REST API using JSON Web Tokens Authentication as an authentication method.
18
- * Version: 1.2.0
19
  * Author: Enrique Chavez
20
  * Author URI: https://enriquechavez.co
21
  * License: GPL-2.0+
15
  * Plugin Name: JWT Authentication for WP-API
16
  * Plugin URI: https://enriquechavez.co
17
  * Description: Extends the WP REST API using JSON Web Tokens Authentication as an authentication method.
18
+ * Version: 1.2.1
19
  * Author: Enrique Chavez
20
  * Author URI: https://enriquechavez.co
21
  * License: GPL-2.0+
public/class-jwt-auth-public.php CHANGED
@@ -123,9 +123,10 @@ class Jwt_Auth_Public
123
 
124
  /** If the authentication fails return a error*/
125
  if (is_wp_error($user)) {
 
126
  return new WP_Error(
127
- 'jwt_auth_failed',
128
- __('Invalid Credentials.', 'wp-api-jwt-auth'),
129
  array(
130
  'status' => 403,
131
  )
@@ -150,7 +151,7 @@ class Jwt_Auth_Public
150
  );
151
 
152
  /** Let the user modify the token data before the sign. */
153
- $token = JWT::encode(apply_filters('jwt_auth_token_before_sign', $token), $secret_key);
154
 
155
  /** The token is signed, now create the object with no sensible user data to the client*/
156
  $data = array(
@@ -213,6 +214,13 @@ class Jwt_Auth_Public
213
  * return the user.
214
  */
215
  $auth = isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : false;
 
 
 
 
 
 
 
216
  if (!$auth) {
217
  return new WP_Error(
218
  'jwt_auth_no_auth_header',
123
 
124
  /** If the authentication fails return a error*/
125
  if (is_wp_error($user)) {
126
+ $error_code = $user->get_error_code();
127
  return new WP_Error(
128
+ '[jwt_auth] '.$error_code,
129
+ $user->get_error_message($error_code),
130
  array(
131
  'status' => 403,
132
  )
151
  );
152
 
153
  /** Let the user modify the token data before the sign. */
154
+ $token = JWT::encode(apply_filters('jwt_auth_token_before_sign', $token, $user), $secret_key);
155
 
156
  /** The token is signed, now create the object with no sensible user data to the client*/
157
  $data = array(
214
  * return the user.
215
  */
216
  $auth = isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : false;
217
+
218
+
219
+ /* Double check for different auth header string (server dependent) */
220
+ if (!$auth) {
221
+ $auth = isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) ? $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] : false;
222
+ }
223
+
224
  if (!$auth) {
225
  return new WP_Error(
226
  'jwt_auth_no_auth_header',
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: tmeister
4
  Donate link: https://enriquechavez.co
5
  Tags: wp-json, jwt, json web authentication, wp-api
6
  Requires at least: 4.2
7
- Tested up to: 4.4.2
8
- Stable tag: 1.2.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -340,13 +340,18 @@ $data = array(
340
  ###Please read how to configured the plugin https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/
341
 
342
  == Changelog ==
 
 
 
 
 
 
 
343
  = 1.2.0 =
344
  * Tested with 4.4.2
345
 
346
  = 1.0.0 =
347
  * Initial Release.
348
 
349
-
350
-
351
  == Upgrade Notice ==
352
  .
4
  Donate link: https://enriquechavez.co
5
  Tags: wp-json, jwt, json web authentication, wp-api
6
  Requires at least: 4.2
7
+ Tested up to: 4.6.1
8
+ Stable tag: 1.2.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
340
  ###Please read how to configured the plugin https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/
341
 
342
  == Changelog ==
343
+ = 1.2.1 =
344
+ * Add an extra validation to get the Authorization header
345
+ * Increase determine_current_user priority Fix #13
346
+ * Add the user object as parameter in the jwt_auth_token_before_sign hook
347
+ * Improve error message when auth fails #34
348
+ * Tested with 4.6.1
349
+
350
  = 1.2.0 =
351
  * Tested with 4.4.2
352
 
353
  = 1.0.0 =
354
  * Initial Release.
355
 
 
 
356
  == Upgrade Notice ==
357
  .