summaryrefslogtreecommitdiff
path: root/server/core/LibOverride
diff options
context:
space:
mode:
authorEoleDev <EoleDev@outlook.fr>2016-03-15 23:08:55 +0100
committerEoleDev <EoleDev@outlook.fr>2016-03-15 23:08:55 +0100
commit85b5ebaa182ae8897d825638a2c9b103d7e88eca (patch)
treeaf162fdf2467c1ea2ee84f362628aa1b45d9c49c /server/core/LibOverride
parentb50d3cc788038122b0afc22a3e94161e1848d022 (diff)
parent2b8decb81faeb7928bcbfda84c6f33a003f707fd (diff)
Merge branch 'Eole' into develop
Diffstat (limited to 'server/core/LibOverride')
-rwxr-xr-xserver/core/LibOverride/genTokenOptions.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/server/core/LibOverride/genTokenOptions.php b/server/core/LibOverride/genTokenOptions.php
index 18d880f..bdae8a6 100755
--- a/server/core/LibOverride/genTokenOptions.php
+++ b/server/core/LibOverride/genTokenOptions.php
@@ -75,6 +75,12 @@ class genTokenOptions
$this->optionsGlobal['Identity'] = $options;
}
+ public function revokeIdentityToken(){
+ $token = $this->unserializeToken($this->backup['Identity']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadIdentityBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'false';
@@ -123,6 +129,12 @@ class genTokenOptions
$this->optionsGlobal['Image'] = $options;
}
+ public function revokeImageToken(){
+ $token = $this->unserializeToken($this->backup['Image']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadImageBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'glance';
@@ -157,7 +169,7 @@ class genTokenOptions
$stack = HandlerStack::create();
- $stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
$this->addDebugMiddleware($options, $stack);
@@ -170,6 +182,12 @@ class genTokenOptions
$this->optionsGlobal['Network'] = $options;
}
+ public function revokeNetworkToken(){
+ $token = $this->unserializeToken($this->backup['Network']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadNetworkBackup($opt){
$options = $this->optionsGlobal['Common'];
$options['catalogName'] = 'neutron';
@@ -217,6 +235,12 @@ class genTokenOptions
$this->optionsGlobal['Compute'] = $options;
}
+ public function revokeComputeToken(){
+ $token = $this->unserializeToken($this->backup['Compute']['token']);
+ $this->optionsGlobal['Common']['identityService']->revokeToken($token->id);
+
+ }
+
public function loadComputeBackup($opt){
$options = $this->optionsGlobal['Common'];
@@ -245,7 +269,7 @@ class genTokenOptions
private function saveBackup($name, $data){
$token = $this->serializeToken($data["token"]);
$path = "core/LibOverride/projectTokenData/".$token['saved']["project"]["name"];
- error_log(print_r($path, true), 0);
+ //error_log(print_r($path, true), 0);
file_put_contents("core/LibOverride/projectTokenData/".$token['saved']["project"]["name"], serialize($token['saved']));
$this->backup["roles"] = $token["roles"];
$this->backup["project"] = $token['saved']["project"]["name"];