Diglin\Ricardo\Managers\Security
Class Security
Do the bridge with the Security service class and its data
Synopsis
- // members
- protected string $_serviceName = 'security';
- protected $_allowSimulateAuthorization;
- protected $_temporaryToken;
- protected $_temporaryTokenExpirationDate;
- protected string $_validationUrl = null;
- protected $_anonymousToken;
- protected $_anonymousTokenExpirationDate;
- protected $_credentialToken;
- protected $_credentialTokenExpirationDate;
- protected $_credentialTokenSessionDuration;
- protected $_credentialTokenSessionStart;
- protected bool $_credentialTokenRefreshed = false;
- protected $_antiforgeryToken;
- protected $_antiforgeryTokenExpirationDate;
- // Inherited members from ManagerAbstract
- protected $_serviceName;
- protected Service $_serviceManager;
- protected Helper $_helper;
- // methods
- public void __construct()
- public bool|mixed|string getToken()
- public string|array getAnonymousToken()
- public string|array getTemporaryToken()
- public string parseValidationUrl()
- public string|array getCredentialToken()
- public string getAntiforgeryToken()
- public string refreshToken()
- public bool isDateExpired()
- public bool|mixed simulateValidationUrl()
- public $this setAnonymousToken()
- public $this setCredentialToken()
- public $this setTemporaryToken()
- public void setAntiforgeryToken()
- public void setAllowSimulateAuthorization()
- public bool getAllowSimulateAuthorization()
- public $this setAnonymousTokenExpirationDate()
- public void getAnonymousTokenExpirationDate()
- public $this setCredentialTokenExpirationDate()
- public string getCredentialTokenExpirationDate()
- public $this setTemporaryTokenExpirationDate()
- public string getTemporaryTokenExpirationDate()
- public $this setAntiforgeryTokenExpirationDate()
- public string getAntiforgeryTokenExpirationDate()
- public $this setCredentialTokenSessionDuration()
- public int getCredentialTokenSessionDuration()
- public $this setCredentialTokenSessionStart()
- public int getCredentialTokenSessionStart()
- public string getValidationUrl()
- public $this setIsCredentialTokenRefreshed()
- public boolean getIsCredentialTokenRefreshed()
- // Inherited methods from ManagerAbstract
- public void __construct()
- public Helper getHelper()
- protected array _proceed()
- protected void extractError()
- public Service getServiceManager()
- public string getTypeOfToken()
Hierarchy
Violations
PHPMessDetector
Line | Rule | Message |
---|---|---|
200 - 228 | CyclomaticComplexity | The method parseValidationUrl() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. |
200 - 228 | NPathComplexity | The method parseValidationUrl() has an NPath complexity of 7812500. The configured NPath complexity threshold is 200. |
330 - 400 | CyclomaticComplexity | The method simulateValidationUrl() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. |
330 - 400 | NPathComplexity | The method simulateValidationUrl() has an NPath complexity of 6000. The configured NPath complexity threshold is 200. |
Members
protected
- $_allowSimulateAuthorization — string
- $_anonymousToken — string
- $_anonymousTokenExpirationDate — string
- $_antiforgeryToken — string
- $_antiforgeryTokenExpirationDate — string
- $_credentialToken — string
- $_credentialTokenExpirationDate — string
- $_credentialTokenRefreshed — Diglin\Ricardo\Managers\bool
- $_credentialTokenSessionDuration — int
- $_credentialTokenSessionStart — int
- $_helper — Diglin\Ricardo\Core\Helper
- $_serviceManager — Diglin\Ricardo\Service
- $_serviceName — string
- $_serviceName — string
- $_temporaryToken — string
- $_temporaryTokenExpirationDate — string
- $_validationUrl — string
Methods
public
- __construct()
- getAllowSimulateAuthorization() — Get if allow or not to simulate the authorization process
- getAnonymousToken() — Get the anonymous token and set internally the expiration date for this anonymous token
- getAnonymousTokenExpirationDate()
- getAntiforgeryToken()
- getAntiforgeryTokenExpirationDate() — Get the antiforgery token expiration date
- getCredentialToken() — Get the token credential, set internally expiration date and session duration Refresh the token if necessary
- getCredentialTokenExpirationDate() — Get the credential token expiration date
- getCredentialTokenSessionDuration()
- getCredentialTokenSessionStart()
- getIsCredentialTokenRefreshed()
- getTemporaryToken() — Get the temporary token, set internally the expiration date for this temporary token and the validation url
- getTemporaryTokenExpirationDate() — Get the temporary token expiration date
- getToken() — Get the token depending of the type wished
- getValidationUrl() — Get the validation Url
- isDateExpired() — Check if the date in parameter is expired or not The parameter must be a json date
- parseValidationUrl() — Example: https://www.ch.betaqxl.com/apiconnect/login/index?token=XXXXX-XXXX-XXXX-XXXX-XXXXXXX&countryId=2&partnershipId=XXXX&partnerurl=
- refreshToken() — If the session duration period has expired, the token must be refreshed
- setAllowSimulateAuthorization() — Allow or not to simulate the authorization process
- setAnonymousToken() — Set the anonymous token, useful in case of data coming from saved DB
- setAnonymousTokenExpirationDate() — Set the anonymous token expiration date, useful in case of data coming from saved DB
- setAntiforgeryToken() — Set the antiforgery token, useful in case of data coming from saved DB
- setAntiforgeryTokenExpirationDate() — Set the antiforgery token expiration date, useful in case of data coming from saved DB
- setCredentialToken() — Set the credential token, useful in case of data coming from saved DB
- setCredentialTokenExpirationDate() — Set the credential token expiration date, useful in case of data coming from saved DB
- setCredentialTokenSessionDuration()
- setCredentialTokenSessionStart()
- setIsCredentialTokenRefreshed()
- setTemporaryToken() — Set the temporary token, useful in case of data coming from saved DB
- setTemporaryTokenExpirationDate() — Set the temporary token expiration date, useful in case of data coming from saved DB
- simulateValidationUrl() — The simulation of the authorization process is for development purpose
Inherited from Diglin\Ricardo\Managers\ManagerAbstract
protected
- _proceed()
- extractError() — Extract code error and type from API call
public
History
-
2015-02-05T13:02:27+01:00 (commit #17cc8fe)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Change license from OSL v3 to GPL v3
-
2014-12-16T12:45:07+01:00 (commit #ec26574)
Author: Sylvain Rayé (sylvain.raye@rissip.com) / Commiter: Sylvain Rayé (sylvain.raye@rissip.com)
PSR2 compliant
-
2014-10-21T02:08:42+02:00 (commit #1b5577c)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Anonymize username and password for log and debug for future use
-
2014-09-28T11:22:59+02:00 (commit #3e11a2c)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Update the License to OSL v3.0, add license file, change code header and composer.json
-
2014-09-14T22:13:09+02:00 (commit #b6cf445)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Replace class name for the exceptions
-
2014-09-04T17:15:35+02:00 (commit #9286388)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[]RIC-38 Add log implementation for unit test, structure differently enumeration classes, update the constant of the enums in the different classes
-
2014-08-14T00:05:28+02:00 (commit #a08a26d)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Change the logic regarding refresh of the token. Use exception to get potential errors and make the workflow more fluent
-
2014-08-10T23:12:33+02:00 (commit #7e05cb1)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Fix wrong logic to know if token is expired or need to be refreshed
-
2014-08-10T20:29:01+02:00 (commit #30fd026)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Rename getTokenCredential to getCredentialToken. Add getIsCredentialTokenRefreshed to detect token changes
-
2014-08-10T20:18:28+02:00 (commit #fc0e52a)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Standardize namespace use
-
2014-08-02T19:36:47+02:00 (commit #f95fc40)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Set any related dates be returned as a timestamp
-
2014-08-02T19:35:24+02:00 (commit #69eee81)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Get the validation url with the partner_url value.
-
2014-08-01T16:00:09+02:00 (commit #3df2f7d)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Change the simulation authorization process implementation and update unit test
-
2014-07-30T22:51:54+02:00 (commit #bf0e20f)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Some small refactoring/improvements and cleanup
-
2014-07-30T20:54:56+02:00 (commit #63608a6)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Simplify date format, work on timestamp base UTC+0
-
2014-07-11T02:01:39+02:00 (commit #6a5232f)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-38] Move the Service class to a different folder to prevent misunderstanding with the classes in the manager folder
-
2014-07-07T18:27:40+02:00 (commit #3b6fa9d)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
[RIC-2] [FEATURE] finish to implement the System Service for the PHP library.
-
2014-07-01T13:49:07+02:00 (commit #37b2bde)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Add test for Helper, add to the helper a method to convert in both directions date from/to json/php, add the Ricardo Service System and its test (still in progress), improve information of error curl message, add method into the testAbstract to get the latest api debug
-
2014-06-22T17:08:27+02:00 (commit #61fc8b6)
Author: Sylvain Rayé (sly@diglin.com) / Commiter: Sylvain Rayé (sly@diglin.com)
Add PhpUnit Tests for Security, SellerAccount (in progress) and System (in progress) Services. Add a way to configure the unit test, documentation exist to configure it thanks to a readme file Implement the security protocol at the manager level