Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 5, 2019
1 parent a3e2556 commit f0ad094
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions src/Protocol/Eulogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ final class Eulogin implements CasInterface
*/
private $cas;

/**
* @var \Psr\Http\Message\StreamFactoryInterface
*/
private $streamFactory;

/**
* Eulogin constructor.
*
Expand Down Expand Up @@ -61,6 +66,8 @@ public function __construct(
$cache,
$logger
);

$this->streamFactory = $streamFactory;
}

/**
Expand Down Expand Up @@ -106,50 +113,60 @@ public function logout(array $parameters = []): ResponseInterface
/**
* {@inheritdoc}
*/
public function requestProxyCallback(array $parameters = []): ResponseInterface
{
public function requestProxyCallback(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
$body = '<?xml version="1.0" encoding="utf-8"?><proxySuccess xmlns="http://www.yale.edu/tp/casClient" />';

return $this
->cas
->requestProxyCallback()
->requestProxyCallback($parameters, $response)
->withBody(
$this
->getStreamFactory()
->streamFactory
->createStream($body)
);
}

/**
* {@inheritdoc}
*/
public function requestProxyTicket(array $parameters = []): ?ResponseInterface
{
return $this->cas->requestProxyTicket($parameters);
public function requestProxyTicket(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
return $this->cas->requestProxyTicket($parameters, $response);
}

/**
* {@inheritdoc}
*/
public function requestProxyValidate(array $parameters = []): ?ResponseInterface
{
return $this->cas->requestProxyValidate($parameters);
public function requestProxyValidate(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
return $this->cas->requestProxyValidate($parameters, $response);
}

/**
* {@inheritdoc}
*/
public function requestServiceValidate(array $parameters = []): ?ResponseInterface
{
return $this->cas->requestServiceValidate($parameters);
public function requestServiceValidate(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
return $this->cas->requestServiceValidate($parameters, $response);
}

/**
* {@inheritdoc}
*/
public function requestTicketValidation(array $parameters = []): ?ResponseInterface
{
return $this->cas->requestTicketValidation($parameters);
public function requestTicketValidation(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
return $this->cas->requestTicketValidation($parameters, $response);
}

/**
Expand All @@ -160,14 +177,6 @@ public function supportAuthentication(): bool
return $this->cas->supportAuthentication();
}

/**
* {@inheritdoc}
*/
public function validateTicketResponse(ResponseInterface $response): ?ResponseInterface
{
return $this->cas->validateTicketResponse($response);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit f0ad094

Please sign in to comment.