Skip to content

Commit 7365613

Browse files
committed
feat: add TypedItem to allow for psr/cache:3
1 parent 21dd478 commit 7365613

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+678
-2026
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ accept your pull requests.
2323

2424
* Check that the issue has not already been reported.
2525
* Check that the issue has not already been fixed in the latest code
26-
(a.k.a. `master`).
26+
(a.k.a. `main`).
2727
* Be clear, concise and precise in your description of the problem.
2828
* Open an issue with a descriptive title and a summary in grammatically correct,
2929
complete sentences.

.github/actions/docs/sami.php

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

1717
$versions = GitVersionCollection::create($projectRoot)
1818
->addFromTags('v1.*')
19-
->add('master', 'master branch');
19+
->add('main', 'main branch');
2020

2121
return new Sami($iterator, [
2222
'title' => 'Google Auth Library for PHP API Reference',

.github/actions/unittest/entrypoint.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/actions/unittest/retry.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ name: Generate Documentation
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
tags:
77
- "*"
88

99
jobs:
1010
docs:
1111
name: "Generate Project Documentation"
12-
runs-on: ubuntu-16.04
12+
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
2020
php-version: 7.3
2121
- name: Install Dependencies
22-
uses: nick-invision/retry@v1
22+
uses: nick-invision/retry@v2
2323
with:
2424
timeout_minutes: 10
2525
max_attempts: 3

.github/workflows/tests.yml

Lines changed: 16 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,44 @@
11
name: Test Suite
22
on:
33
push:
4-
branches:
5-
- master
4+
branches: [ main ]
65
pull_request:
76

87
jobs:
98
test:
10-
runs-on: ${{matrix.operating-system}}
9+
runs-on: ubuntu-latest
1110
strategy:
1211
matrix:
13-
operating-system: [ ubuntu-latest ]
14-
php: [ "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0" ]
12+
php: [ "7.1", "7.2", "7.3", "7.4", "8.0", "8.1" ]
1513
name: PHP ${{matrix.php }} Unit Test
1614
steps:
17-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1816
- name: Setup PHP
1917
uses: shivammathur/setup-php@v2
2018
with:
2119
php-version: ${{ matrix.php }}
22-
- if: ${{ matrix.php != '8.0' }}
23-
name: Install Dependencies
24-
uses: nick-invision/retry@v1
20+
- name: Install Dependencies
21+
uses: nick-invision/retry@v2
2522
with:
2623
timeout_minutes: 10
2724
max_attempts: 3
2825
command: composer install
29-
- if: ${{ matrix.php == '8.0' }}
30-
name: Install Dependencies (PHP 8.0)
31-
uses: nick-invision/retry@v1
32-
with:
33-
timeout_minutes: 10
34-
max_attempts: 3
35-
command: |
36-
composer remove --dev --ignore-platform-reqs phpunit/phpunit
37-
composer require --dev --ignore-platform-reqs --update-with-all-dependencies phpunit/phpunit:^7
3826
- name: Run Script
3927
run: vendor/bin/phpunit
4028
test_lowest:
41-
runs-on: ${{matrix.operating-system}}
29+
runs-on: ubuntu-latest
4230
strategy:
4331
matrix:
44-
operating-system: [ ubuntu-latest ]
45-
php: [ "5.6", "7.0", "7.1", "7.2" ]
32+
php: [ "7.1", "7.2" ]
4633
name: PHP ${{matrix.php }} Unit Test Prefer Lowest
4734
steps:
48-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
4936
- name: Setup PHP
5037
uses: shivammathur/setup-php@v2
5138
with:
5239
php-version: ${{ matrix.php }}
5340
- name: Install Dependencies
54-
uses: nick-invision/retry@v1
41+
uses: nick-invision/retry@v2
5542
with:
5643
timeout_minutes: 10
5744
max_attempts: 3
@@ -62,79 +49,33 @@ jobs:
6249
runs-on: ubuntu-latest
6350
strategy:
6451
matrix:
65-
operating-system: [ ubuntu-latest ]
66-
php: [ "5.6", "7.2" ]
52+
php: [ "7.2" ]
6753
name: PHP ${{ matrix.php }} Unit Test Guzzle 6
6854
steps:
69-
- uses: actions/checkout@v2
55+
- uses: actions/checkout@v3
7056
- name: Setup PHP
7157
uses: shivammathur/setup-php@v2
7258
with:
7359
php-version: ${{ matrix.php }}
7460
- name: Install Dependencies
75-
uses: nick-invision/retry@v1
61+
uses: nick-invision/retry@v2
7662
with:
7763
timeout_minutes: 10
7864
max_attempts: 3
7965
command: composer require guzzlehttp/guzzle:^6 && composer update
8066
- name: Run Script
8167
run: vendor/bin/phpunit
82-
# use dockerfiles for oooooolllllldddd versions of php, setup-php times out for those.
83-
test_php55:
84-
name: "PHP 5.5 Unit Test"
85-
runs-on: ubuntu-latest
86-
steps:
87-
- name: Checkout
88-
uses: actions/checkout@v2
89-
- name: Run Unit Tests
90-
uses: docker://php:5.5-cli
91-
with:
92-
entrypoint: ./.github/actions/unittest/entrypoint.sh
93-
test_php55_lowest:
94-
name: "PHP 5.5 Unit Test Prefer Lowest"
95-
runs-on: ubuntu-latest
96-
steps:
97-
- name: Checkout
98-
uses: actions/checkout@v2
99-
- name: Run Unit Tests
100-
uses: docker://php:5.5-cli
101-
env:
102-
composerargs: "--prefer-lowest"
103-
with:
104-
entrypoint: ./.github/actions/unittest/entrypoint.sh
105-
test_php54:
106-
name: "PHP 5.4 Unit Test"
107-
runs-on: ubuntu-latest
108-
steps:
109-
- name: Checkout
110-
uses: actions/checkout@v2
111-
- name: Run Unit Tests
112-
uses: docker://php:5.4-cli
113-
with:
114-
entrypoint: ./.github/actions/unittest/entrypoint.sh
115-
test_php54_lowest:
116-
name: "PHP 5.4 Unit Test Prefer Lowest"
117-
runs-on: ubuntu-latest
118-
steps:
119-
- name: Checkout
120-
uses: actions/checkout@v2
121-
- name: Run Unit Tests
122-
uses: docker://php:5.4-cli
123-
env:
124-
composerargs: "--prefer-lowest"
125-
with:
126-
entrypoint: ./.github/actions/unittest/entrypoint.sh
12768
style:
12869
runs-on: ubuntu-latest
12970
name: PHP Style Check
13071
steps:
131-
- uses: actions/checkout@v2
72+
- uses: actions/checkout@v3
13273
- name: Setup PHP
13374
uses: shivammathur/setup-php@v2
13475
with:
135-
php-version: "7.4"
76+
php-version: "8.0"
13677
- name: Install Dependencies
137-
uses: nick-invision/retry@v1
78+
uses: nick-invision/retry@v2
13879
with:
13980
timeout_minutes: 10
14081
max_attempts: 3

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
## 1.11.1 (7/27/2020)
5757

5858
* [fix]: catch ConnectException in GCE check (#294)
59-
* [docs]: Adds [reference docs](https://googleapis.github.io/google-auth-library-php/master)
59+
* [docs]: Adds [reference docs](https://googleapis.github.io/google-auth-library-php/main)
6060

6161
## 1.11.0 (7/22/2020)
6262

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<dl>
44
<dt>Homepage</dt><dd><a href="http://www.github.com/google/google-auth-library-php">http://www.github.com/google/google-auth-library-php</a></dd>
5-
<dt>Reference Docs</dt><dd><a href="https://googleapis.github.io/google-auth-library-php/master/">https://googleapis.github.io/google-auth-library-php/master/</a></dd>
5+
<dt>Reference Docs</dt><dd><a href="https://googleapis.github.io/google-auth-library-php/main/">https://googleapis.github.io/google-auth-library-php/main/</a></dd>
66
<dt>Authors</dt>
77
<dd><a href="mailto:temiola@google.com">Tim Emiola</a></dd>
88
<dd><a href="mailto:stanleycheung@google.com">Stanley Cheung</a></dd>
@@ -175,7 +175,7 @@ used when you set up your protected resource as the target audience. See how to
175175
#### Call using a specific JSON key
176176
If you want to use a specific JSON key instead of using `GOOGLE_APPLICATION_CREDENTIALS` environment variable, you can
177177
do this:
178-
178+
179179
```php
180180
use Google\Auth\CredentialsLoader;
181181
use Google\Auth\Middleware\AuthTokenMiddleware;
@@ -216,10 +216,10 @@ print_r((string) $response->getBody());
216216

217217
#### Call using Proxy-Authorization Header
218218
If your application is behind a proxy such as [Google Cloud IAP][iap-proxy-header],
219-
and your application occupies the `Authorization` request header,
220-
you can include the ID token in a `Proxy-Authorization: Bearer`
221-
header instead. If a valid ID token is found in a `Proxy-Authorization` header,
222-
IAP authorizes the request with it. After authorizing the request, IAP passes
219+
and your application occupies the `Authorization` request header,
220+
you can include the ID token in a `Proxy-Authorization: Bearer`
221+
header instead. If a valid ID token is found in a `Proxy-Authorization` header,
222+
IAP authorizes the request with it. After authorizing the request, IAP passes
223223
the Authorization header to your application without processing the content.
224224
For this, use the static method `getProxyIdTokenMiddleware` on
225225
`ApplicationDefaultCredentials`.
@@ -305,8 +305,8 @@ about the client or APIs on [StackOverflow](http://stackoverflow.com).
305305

306306
[google-apis-php-client]: https://github.com/google/google-api-php-client
307307
[application default credentials]: https://developers.google.com/accounts/docs/application-default-credentials
308-
[contributing]: https://github.com/google/google-auth-library-php/tree/master/.github/CONTRIBUTING.md
309-
[copying]: https://github.com/google/google-auth-library-php/tree/master/COPYING
308+
[contributing]: https://github.com/google/google-auth-library-php/tree/main/.github/CONTRIBUTING.md
309+
[copying]: https://github.com/google/google-auth-library-php/tree/main/COPYING
310310
[Guzzle]: https://github.com/guzzle/guzzle
311311
[Guzzle 5]: http://docs.guzzlephp.org/en/5.3
312312
[developer console]: https://console.developers.google.com

composer.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
"homepage": "http://github.com/google/google-auth-library-php",
77
"license": "Apache-2.0",
88
"support": {
9-
"docs": "https://googleapis.github.io/google-auth-library-php/master/"
9+
"docs": "https://googleapis.github.io/google-auth-library-php/main/"
1010
},
1111
"require": {
12-
"php": ">=5.4",
13-
"firebase/php-jwt": "~2.0|~3.0|~4.0|~5.0",
14-
"guzzlehttp/guzzle": "^5.3.1|^6.2.1|^7.0",
12+
"php": "^7.1||^8.0",
13+
"firebase/php-jwt": "~5.0",
14+
"guzzlehttp/guzzle": "^6.2.1|^7.0",
1515
"guzzlehttp/psr7": "^1.7|^2.0",
1616
"psr/http-message": "^1.0",
17-
"psr/cache": "^1.0|^2.0"
17+
"psr/cache": "^1.0|^2.0|^3.0"
1818
},
1919
"require-dev": {
2020
"guzzlehttp/promises": "0.1.1|^1.3",
21-
"phpunit/phpunit": "^4.8.36|^5.7",
21+
"squizlabs/php_codesniffer": "^3.5",
22+
"phpunit/phpunit": "^7.5||^8.5",
23+
"phpspec/prophecy-phpunit": "^1.1",
2224
"sebastian/comparator": ">=1.2.3",
2325
"phpseclib/phpseclib": "^2.0.31",
2426
"kelvinmo/simplejwt": "^0.2.5|^0.5.1"

src/AccessToken.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,7 @@ private function setPhpsecConstants()
444444
*/
445445
protected function callJwtStatic($method, array $args = [])
446446
{
447-
$class = class_exists('Firebase\JWT\JWT')
448-
? 'Firebase\JWT\JWT'
449-
: 'JWT';
447+
$class = 'Firebase\JWT\JWT';
450448
return call_user_func_array([$class, $method], $args);
451449
}
452450

0 commit comments

Comments
 (0)