A wrapper for the OpenStack SDK that caches and renews the authentication token. Works with Laravel and Lumen.
The wrapper is specifically intended for use in long running daemon queue workers as it renews the cached authentication token automatically.
composer require biigle/laravel-cached-openstack
use Biigle\CachedOpenStack\OpenStack;
$cache = app('cache');
$options = [
// OpenStack options...
];
$openstack = new OpenStack($cache, $options);
You can include cache options in the OpenStack options array. Example:
$options = [
'cacheOptions' => [
'ttl' => 3600,
],
];
$openstack = new OpenStack($cache, $options);
Available options:
ttl
: Overrides the duration that the authentication token should be cached in seconds. If not set, the token is cached until itsexpires_at
minus 60 seconds. Ifexpires_at
is less than the specifiedttl
,ttl
is ignored.