Skip to content

Commit

Permalink
Security_Authenticate message structure
Browse files Browse the repository at this point in the history
  • Loading branch information
DerMika committed Mar 30, 2016
1 parent 0d2f8c3 commit 3c3ddaf
Show file tree
Hide file tree
Showing 14 changed files with 619 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Amadeus/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ public function __construct($params)
{
if ($params->authParams instanceof Params\AuthParams) {
$this->authParams = $params->authParams;
$params->sessionHandlerParams->authParams = $this->authParams;
if (isset($params->sessionHandlerParams) && $params->sessionHandlerParams instanceof Params\SessionHandlerParams) {
$params->sessionHandlerParams->authParams = $this->authParams;
}
}

$this->sessionHandler = $this->loadSessionHandler(
Expand Down
41 changes: 41 additions & 0 deletions src/Amadeus/Client/Struct/Security/ApplicationDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* ApplicationDetails
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class ApplicationDetails
{
/**
* @var string
*/
public $internalId;
/**
* @var string
*/
public $seqNumber;
}
37 changes: 37 additions & 0 deletions src/Amadeus/Client/Struct/Security/ApplicationId.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* ApplicationId
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class ApplicationId
{
/**
* @var ApplicationDetails
*/
public $applicationDetails;
}
25 changes: 24 additions & 1 deletion src/Amadeus/Client/Struct/Security/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

namespace Amadeus\Client\Struct\Security;

use Amadeus\Client\RequestOptions\SecurityAuthenticateOptions;
use Amadeus\Client\Struct\BaseWsMessage;

/**
* Authenticate
*
* @todo Implement this message when we support SoapHeader v. 1 or 2
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
Expand Down Expand Up @@ -61,4 +61,27 @@ class Authenticate extends BaseWsMessage
* @var ApplicationId
*/
public $applicationId;

/**
* Authenticate constructor.
*
* @param SecurityAuthenticateOptions $params
*/
public function __construct(SecurityAuthenticateOptions $params)
{
$this->userIdentifier = new UserIdentifier(
$params->officeId,
$params->originatorTypeCode,
$params->userId
);

$this->dutyCode = new DutyCode($params->dutyCode);

$this->systemDetails = new SystemDetails($params->organizationId);

$this->passwordInfo = new PasswordInfo(
$params->passwordData,
$params->passwordLength
);
}
}
49 changes: 49 additions & 0 deletions src/Amadeus/Client/Struct/Security/ConversationClt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* ConversationClt
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class ConversationClt
{
/**
* @var string
*/
public $senderIdentification = 0;
/**
* @var string
*/
public $recipientIdentification = 0;
/**
* @var string
*/
public $senderInterchangeControlReference = 0;
/**
* @var string
*/
public $recipientInterchangeControlReference = 0;
}
47 changes: 47 additions & 0 deletions src/Amadeus/Client/Struct/Security/DutyCode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* DutyCode
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class DutyCode
{
/**
* @var DutyCodeDetails
*/
public $dutyCodeDetails;

/**
* DutyCode constructor.
*
* @param string $dutyCode
*/
public function __construct($dutyCode)
{
$this->dutyCodeDetails = new DutyCodeDetails($dutyCode);
}
}
62 changes: 62 additions & 0 deletions src/Amadeus/Client/Struct/Security/DutyCodeDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* DutyCodeDetails
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class DutyCodeDetails
{
/**
* Definition of Dutycode Reference qualifier "Duty Code"
*
* See Amadeus Core Webservices documentation
* [Reference qualifier codesets (Ref: 1153 IA 01.2.57)]
* @var string
*/
const RQ_DUTYCODE = "DUT";

/**
* @var string
*/
public $referenceQualifier;
/**
* @var string
*/
public $referenceIdentifier;

/**
* DutyCodeDetails constructor.
*
* @param string $dutyCode
* @param string $qual
*/
public function __construct($dutyCode, $qual = self::RQ_DUTYCODE)
{
$this->referenceIdentifier = $dutyCode;
$this->referenceQualifier = $qual;
}
}
47 changes: 47 additions & 0 deletions src/Amadeus/Client/Struct/Security/OrganizationDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* OrganizationDetails
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class OrganizationDetails
{
/**
* @var string
*/
public $organizationId;

/**
* OrganizationDetails constructor.
*
* @param string $organizationId
*/
public function __construct($organizationId)
{
$this->organizationId = $organizationId;
}
}
47 changes: 47 additions & 0 deletions src/Amadeus/Client/Struct/Security/OriginIdentification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\Struct\Security;

/**
* OriginIdentification
*
* @package Amadeus\Client\Struct\Security
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class OriginIdentification
{
/**
* @var string
*/
public $sourceOffice;

/**
* OriginIdentification constructor.
*
* @param string $officeId
*/
public function __construct($officeId)
{
$this->sourceOffice = $officeId;
}
}
Loading

0 comments on commit 3c3ddaf

Please sign in to comment.