summaryrefslogtreecommitdiff
path: root/server/core/LibOverride
diff options
context:
space:
mode:
authorEole <EoleDev@outlook.fr>2016-01-31 17:53:27 +0100
committerEole <EoleDev@outlook.fr>2016-01-31 17:53:27 +0100
commit33463352403037ad03877f18bc3bdd17a7478d3c (patch)
treecf816db9a4a44676c11351c013f3fd3a78c65663 /server/core/LibOverride
parente11520996ae8a487ca46b00865ffcce4385f1efb (diff)
Debug TokenGen
Diffstat (limited to 'server/core/LibOverride')
-rwxr-xr-xserver/core/LibOverride/genTokenOptions.php69
1 files changed, 43 insertions, 26 deletions
diff --git a/server/core/LibOverride/genTokenOptions.php b/server/core/LibOverride/genTokenOptions.php
index 9cb4100..81ecfc8 100755
--- a/server/core/LibOverride/genTokenOptions.php
+++ b/server/core/LibOverride/genTokenOptions.php
@@ -33,7 +33,7 @@ class genTokenOptions
$options['authHandler'] = function () use ($options) {
return $options['identityService']->generateToken($options);
};
-
+
$this->optionsGlobal['Common'] = $options;
}
@@ -60,13 +60,15 @@ class genTokenOptions
$baseUrl = $options["authUrl"];
$token = $options['identityService']->generateToken($options);
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
+
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
- $this->addDebugMiddleware($options, $this->stack);
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Identity'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
@@ -82,17 +84,20 @@ class genTokenOptions
$this->backup['Identity'] = unserialize($opt);
$token = $this->unserializeToken($this->backup['Identity']['token']);
$baseUrl = $this->backup['Identity']['baseUrl'];
-
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
- $this->addDebugMiddleware($options, $this->stack);
+ $stack = HandlerStack::create();
+
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
+
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Identity'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
$this->optionsGlobal['Identity'] = $options;
+
}
public function genImageToken(){
@@ -103,13 +108,15 @@ class genTokenOptions
list($token, $baseUrl) = $options['identityService']->authenticate($options);
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
- $this->addDebugMiddleware($options, $this->stack);
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
+
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Image'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
@@ -126,13 +133,15 @@ class genTokenOptions
$token = $this->unserializeToken($this->backup['Image']['token']);
$baseUrl = $this->backup['Image']['baseUrl'];
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
- $this->addDebugMiddleware($options, $this->stack);
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
+
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Image'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
$this->optionsGlobal['Image'] = $options;
@@ -146,13 +155,15 @@ class genTokenOptions
list($token, $baseUrl) = $options['identityService']->authenticate($options);
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
+
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
- $this->addDebugMiddleware($options, $this->stack);
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Network'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
@@ -169,13 +180,15 @@ class genTokenOptions
$token = $this->unserializeToken($this->backup['Network']['token']);
$baseUrl = $this->backup['Network']['baseUrl'];
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
+
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
- $this->addDebugMiddleware($options, $this->stack);
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Network'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
$this->optionsGlobal['Network'] = $options;
@@ -189,13 +202,15 @@ class genTokenOptions
list($token, $baseUrl) = $options['identityService']->authenticate($options);
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
+
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
- $this->addDebugMiddleware($options, $this->stack);
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Compute'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
@@ -213,13 +228,15 @@ class genTokenOptions
$token = $this->unserializeToken($this->backup['Compute']['token']);
$baseUrl = $this->backup['Compute']['baseUrl'];
- $this->stack->push(Middleware::authHandler($options['authHandler'], $token));
+ $stack = HandlerStack::create();
+
+ $stack->push(Middleware::authHandler($options['authHandler'], $token));
- $this->addDebugMiddleware($options, $this->stack);
+ $this->addDebugMiddleware($options, $stack);
$options['httpClient'] = new Client([
'base_uri' => Utils::normalizeUrl($baseUrl),
- 'handler' => $this->stack,
+ 'handler' => $stack,
]);
$this->backup['Compute'] = array('token' => $this->serializeToken($token), 'baseUrl' => $baseUrl );
$this->optionsGlobal['Compute'] = $options;