Skip to content
This repository was archived by the owner on Jan 26, 2025. It is now read-only.

Commit 02e3621

Browse files
authored
Merge pull request #47 from okta/develop
Merging 1.0.0 from Develop to Master
2 parents b9d0242 + 6f02334 commit 02e3621

File tree

191 files changed

+5471
-596
lines changed

Some content is hidden

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

191 files changed

+5471
-596
lines changed

.travis.yml

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,62 @@
11
language: php
2-
32
env:
43
global:
5-
- COVERAGE=false
6-
- SETUP=basic
7-
- DEPLOY_DOCS=false
8-
4+
- COVERAGE=false
5+
- SETUP=basic
6+
- DEPLOY_DOCS=false
97
install:
10-
- if [[ $SETUP = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction --no-suggest; fi
11-
- if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable; fi
12-
- if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable --prefer-lowest; fi
13-
8+
- if [[ $SETUP = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction
9+
--no-suggest; fi
10+
- if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction
11+
--no-suggest --prefer-stable; fi
12+
- if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction
13+
--no-suggest --prefer-stable --prefer-lowest; fi
1414
before_script:
15-
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc
16-
- mkdir -p ~/.okta
17-
15+
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc
16+
- mkdir -p ~/.okta
1817
script:
19-
- vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml
20-
18+
- vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml
2119
after_success:
22-
- if [[ $COVERAGE = 'true' ]]; then bash <(curl -s https://codecov.io/bash); fi
23-
- if [[ $DEPLOY_DOCS = 'true' ]]; then wget -O sami.phar http://get.sensiolabs.org/sami.phar; fi;
24-
- if [[ $DEPLOY_DOCS = 'true' ]]; then chmod +x ./scripts/prepare-docs.sh; fi
25-
- if [[ $DEPLOY_DOCS = 'true' ]]; then ./scripts/prepare-docs.sh; fi
26-
20+
- if [[ $COVERAGE = 'true' ]]; then bash <(curl -s https://codecov.io/bash); fi
21+
- if [[ $DEPLOY_DOCS = 'true' ]]; then wget -O sami.phar http://get.sensiolabs.org/sami.phar;
22+
fi;
23+
- if [[ $DEPLOY_DOCS = 'true' ]]; then chmod +x ./scripts/prepare-docs.sh; fi
24+
- if [[ $DEPLOY_DOCS = 'true' ]]; then ./scripts/prepare-docs.sh; fi
2725
deploy:
28-
- provider: pages
29-
skip_cleanup: true
30-
github_token: $GITHUB_TOKEN
31-
local_dir: full/build/gh-pages
32-
33-
name: PHP Deployment Bot
34-
on:
35-
php: 7.1
36-
condition: $DEPLOY_DOCS = true
37-
tags: true
38-
- provider: pages
39-
skip_cleanup: true
40-
github_token: $GITHUB_TOKEN
41-
local_dir: full/build/gh-pages
42-
43-
name: PHP Deployment Bot
44-
on:
45-
php: 7.1
46-
condition: $DEPLOY_DOCS = true
47-
branch: develop
48-
26+
- provider: pages
27+
skip_cleanup: true
28+
github_token: "$GITHUB_TOKEN"
29+
local_dir: full/build/gh-pages
30+
31+
name: PHP Deployment Bot
32+
on:
33+
php: 7.1
34+
condition: "$DEPLOY_DOCS = true"
35+
tags: true
36+
- provider: pages
37+
skip_cleanup: true
38+
github_token: "$GITHUB_TOKEN"
39+
local_dir: full/build/gh-pages
40+
41+
name: PHP Deployment Bot
42+
on:
43+
php: 7.1
44+
condition: "$DEPLOY_DOCS = true"
45+
branch: develop
4946
matrix:
5047
include:
51-
- php: 7.0
52-
env: SETUP=lowest
53-
- php: 7.0
54-
env: SETUP=stable
55-
- php: 7.1
56-
env: SETUP=lowest
57-
- php: 7.1
58-
env:
59-
- COVERAGE=true
60-
- SETUP=stable
61-
- DEPLOY_DOCS=true
48+
- php: 7.0
49+
env: SETUP=lowest
50+
- php: 7.0
51+
env: SETUP=stable
52+
- php: 7.1
53+
env: SETUP=lowest
54+
- php: 7.1
55+
env:
56+
- COVERAGE=true
57+
- SETUP=stable
58+
- DEPLOY_DOCS=true
59+
notifications:
60+
slack:
61+
rooms:
62+
secure: pPjnzjBbTuUFSMOKdJQfzQWk8XeCxCg7Y0cRds/DP0YRIDIPOOGzUTWdzJG4oKGmwVFmnlmqGBnC3JaufXmIj0wSw9p/YmAOV9cdaZ6ZaqpqghL6EnN2y3M5jMkmTq7A1vAAvPC8g/NLORiR4fOcgGLzNRgHVVRYIMPE840mWxpEnohfHB/8PquL2/wjlzBuPOJBieq9SAGxb25SPAwMTaP1vewX3CP/zT5IDqqeuULZzR94xNiVIkeYzniDjjmBMh1FYUXbUBhR08jUVLCuvUgk959fpowbWf4UcqwRmcnDGeGYTatvX36MbmLHRhOU1zRvMuMG+uOQwr7kWOqJya3mxcPf6IW0gwXs6TVvruInKjkhsZHyc5oVC4WKgWZ41cd+RRlLbRcLHIvALN1jhLFda/KLpfGUVGFwrVv61kPLGvExMIZMQCxNj7PIr5RZB8faYBfrT3hf2SvG4bDwhdzjc07lqzhGQWvCi12Rc0Yzmo+PuAA4crPCG2OfjAj1U4IyOznvuhXGMfHtQMy5ow6bW9w/q1HTMwNBtswY78hyTetf7FHYmEe29IUnL44Ecv/34FWuY+Hszb1KwPKVdx0g7D9gdWU6sZZSipNrhG84rYIIRTi0zSDlZBS0+0P7WQQsXRJCplQtxHOTgImWDzIXVzqX9kep/AvT0IiO4CY=

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ $client = (new \Okta\ClientBuilder())
2323
->build();
2424
```
2525

26+
By default, The client builder will look for a file in your home directory with the Okta properties you want to use.
27+
This file should be placed at `~/.okta/okta.yaml`. If at this location, you do not need to define the location
28+
during initialization. If you are unable to place the file there, or you are on a Windows based machine, you will
29+
have to define the location of this file manually if you want to use the file.
30+
31+
```php
32+
$client = (new \Okta\ClientBuilder())
33+
->setConfigFileLocation('path/to/okta.yaml')
34+
->build();
35+
```
36+
2637
If you need to override any of the defaults from your `~/.okta/okta.yaml` file, or you do not have one, you can set
2738
the properties on the client builder directly. The minimum required properties are your token and organization url.
2839

@@ -132,6 +143,31 @@ To start at the second entry and get the next two items:
132143
$users = (new \Okta\Okta)->getUsers(['query' => ['limit' = 2, 'after' = 2]]);
133144
```
134145

146+
## Caching
147+
The Okta PHP SDK allows any resource with a self link to be cached by default. The SDK uses any PSR-6
148+
caching adaptor that you would like to use. By default, we ship with the
149+
[filesystem cache pool](https://github.com/php-cache/filesystem-adapter) with the
150+
[flysystem memory adaptor](https://github.com/thephpleague/flysystem-memory). By doing this, there is no
151+
need to configure anything, however, if you would like to run with your own Cache strategy, or change how
152+
the default works, you are able to swap out the Cache Manager. Create a new Cache Manager that extends the
153+
base `\Okta\Cache\CacheManager` class, and call the parent `setCachePool()` method. This should be called
154+
with an instance of a PSR-6 compliant cache pool implementation. Once created, you can swap out the manager
155+
using the `ClientBuilder` class
156+
157+
```php
158+
$clientBuilder = new ClientBuilder();
159+
$clientBuilder->setCacheManager(new MyCacheManager());
160+
$client = $clientBuilder->build();
161+
```
162+
163+
### Contents of the okta.yaml File
164+
```php
165+
okta:
166+
client:
167+
orgUrl: null
168+
token: null
169+
```
170+
135171
For information on what can go into the query property, visit
136172
[our documentation](https://developer.okta.com/docs/api/resources/users.html#list-users)
137173

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
"php-http/curl-client": "^1.7",
2020
"symfony/yaml": "^3.2",
2121
"nesbot/carbon": "^1.22",
22-
"tightenco/collect": "^5.4",
23-
"guzzlehttp/psr7": "^1.4"
22+
"tightenco/collect": "5.4.*",
23+
"guzzlehttp/psr7": "^1.4",
24+
"psr/cache": "^1.0",
25+
"league/flysystem-memory": "^1.0",
26+
"cache/filesystem-adapter": "^1.0"
2427
},
2528
"require-dev": {
2629
"phpunit/phpunit": "^6.0",

0 commit comments

Comments
 (0)