Begin Serialization Token
This commit is contained in:
parent
6c4cdf62ac
commit
c796facb13
1 changed files with 49 additions and 6 deletions
|
@ -53,7 +53,7 @@ class genTokenOptions
|
||||||
$options['region'] = 'RegionOne';
|
$options['region'] = 'RegionOne';
|
||||||
|
|
||||||
list($token, $baseUrl) = $options['identityService']->authenticate($options);
|
list($token, $baseUrl) = $options['identityService']->authenticate($options);
|
||||||
var_dump($token);
|
//var_dump($token);
|
||||||
//$stack = HandlerStack::create();
|
//$stack = HandlerStack::create();
|
||||||
$this->stack->push(Middleware::authHandler($options['authHandler'], $token));
|
$this->stack->push(Middleware::authHandler($options['authHandler'], $token));
|
||||||
|
|
||||||
|
@ -63,7 +63,49 @@ class genTokenOptions
|
||||||
'base_uri' => Utils::normalizeUrl($baseUrl),
|
'base_uri' => Utils::normalizeUrl($baseUrl),
|
||||||
'handler' => $this->stack,
|
'handler' => $this->stack,
|
||||||
]);
|
]);
|
||||||
$this->backup['Compute'] = array('token' => serialize($token), 'baseUrl' => $baseUrl );
|
$this->backup['Compute'] = array('token' => json_encode($token), 'baseUrl' => $baseUrl );
|
||||||
|
serialize($token->methods);
|
||||||
|
foreach($token->roles as $role){
|
||||||
|
serialize($role->name);
|
||||||
|
serialize($role->links);
|
||||||
|
serialize($role->id);
|
||||||
|
}
|
||||||
|
serialize($token->expires);
|
||||||
|
serialize($token->project->domainId);
|
||||||
|
serialize($token->project->parentId);
|
||||||
|
serialize($token->project->enabled);
|
||||||
|
serialize($token->project->description);
|
||||||
|
serialize($token->project->id);
|
||||||
|
serialize($token->project->links);
|
||||||
|
serialize($token->project->name);
|
||||||
|
foreach($token->catalog->services as $service){
|
||||||
|
serialize($service->id);
|
||||||
|
serialize($service->name);
|
||||||
|
serialize($service->description);
|
||||||
|
serialize($service->type);
|
||||||
|
foreach($service->endpoints as $end){
|
||||||
|
serialize($end->id);
|
||||||
|
serialize($end->interface);
|
||||||
|
serialize($end->name);
|
||||||
|
serialize($end->serviceId);
|
||||||
|
serialize($end->region);
|
||||||
|
serialize($end->links);
|
||||||
|
serialize($end->url);
|
||||||
|
}
|
||||||
|
serialize($service->links);
|
||||||
|
}
|
||||||
|
serialize($token->extras);
|
||||||
|
serialize($token->user->domainId);
|
||||||
|
serialize($token->user->defaultProjectId);
|
||||||
|
serialize($token->user->id);
|
||||||
|
serialize($token->user->email);
|
||||||
|
serialize($token->user->enabled);
|
||||||
|
serialize($token->user->description);
|
||||||
|
serialize($token->user->links);
|
||||||
|
serialize($token->user->name);
|
||||||
|
serialize($token->issued);
|
||||||
|
serialize($token->id);
|
||||||
|
var_dump($token->id);
|
||||||
$this->optionsGlobal['Compute'] = $options;
|
$this->optionsGlobal['Compute'] = $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,8 +117,9 @@ class genTokenOptions
|
||||||
$options['region'] = 'RegionOne';
|
$options['region'] = 'RegionOne';
|
||||||
|
|
||||||
//list($token, $baseUrl) = $options['identityService']->authenticate($options);
|
//list($token, $baseUrl) = $options['identityService']->authenticate($options);
|
||||||
$this->backup['Compute'] = unserialize($opt);
|
$this->backup['Compute'] = json_decode($opt, true);
|
||||||
$token = unserialize($this->backup['Compute'] ['token']);
|
var_dump($this->backup['Compute']);
|
||||||
|
$token = json_decode($this->backup['Compute']['token'], true);
|
||||||
$baseUrl = $this->backup['Compute']['baseUrl'];
|
$baseUrl = $this->backup['Compute']['baseUrl'];
|
||||||
|
|
||||||
//$stack = HandlerStack::create();
|
//$stack = HandlerStack::create();
|
||||||
|
@ -89,12 +132,12 @@ class genTokenOptions
|
||||||
'base_uri' => Utils::normalizeUrl($baseUrl),
|
'base_uri' => Utils::normalizeUrl($baseUrl),
|
||||||
'handler' => $this->stack,
|
'handler' => $this->stack,
|
||||||
]);
|
]);
|
||||||
$this->backup['Compute'] = array('token' => serialize($token), 'baseUrl' => $baseUrl );
|
$this->backup['Compute'] = array('token' => json_encode($token), 'baseUrl' => $baseUrl );
|
||||||
$this->optionsGlobal['Compute'] = $options;
|
$this->optionsGlobal['Compute'] = $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBackup($service){
|
public function getBackup($service){
|
||||||
return serialize($this->backup[$service]);
|
return json_encode($this->backup[$service]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOptionsCompute(){
|
public function getOptionsCompute(){
|
||||||
|
|
Loading…
Add table
Reference in a new issue