Plugin Directory

Changeset 2100367


Ignore:
Timestamp:
06/04/2019 11:20:25 AM (7 years ago)
Author:
ionos
Message:

V1.0.2

Location:
id4me
Files:
28 edited
1 copied

Legend:

Unmodified
Added
Removed
  • id4me/tags/1.0.2/id4me.php

    r2082608 r2100367  
    44 * Plugin URI:   https://wordpress.org/plugins/id4me/
    55 * Description:  One ID for everything. Log in into your WordPress with your domain, through any service you like!
    6  * Version:      1.0.0
     6 * Version:      1.0.2
    77 * License:      MIT
    88 * Author:       1&1 IONOS
    99 * Author URI:   https://www.ionos.com
    10  * Requires PHP: 7.1
     10 * Requires PHP: 7.0
    1111 * Text Domain:  id4me
    1212 */
  • id4me/tags/1.0.2/readme.txt

    r2082608 r2100367  
    11=== ID4me ===
    2 Contributors: gdespoulain, herrfeldmann, kimalumalu, pfefferle, rinma
     2Contributors: gdespoulain, herrfeldmann, kimalumalu, pfefferle, rinma, ionos
    33Tags: ID4me, login, domain
    44Requires at least: 5.0
    5 Requires PHP: 7.1
    6 Tested up to: 5.1
    7 Stable tag: 1.0.0
     5Requires PHP: 7.0
     6Tested up to: 5.2
     7Stable tag: 1.0.2
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    3535
    3636== Changelog ==
     37
     38= 1.0.2 =
     39
     40* Update library version to 1.1.0
     41
     42= 1.0.1 =
     43
     44* Update doc with tested up to 5.2
    3745
    3846= 1.0.0 =
     
    103111= Configuration of users =
    104112
    105 **Note:** The (current) **1.0.0** version only works with already registered WordPress users (who indicated their ID4me identifier
     113**Note:** The (current) **1.0.2** version only works with already registered WordPress users (who indicated their ID4me identifier
    106114in the **ID4me identifier** profile field). Next versions will include a more complex user management.
    107115
  • id4me/tags/1.0.2/vendor

    • Property svn:ignore set to
      bin
  • id4me/tags/1.0.2/vendor/composer/installed.json

    r2082608 r2100367  
    218218    {
    219219        "name": "id4me/id4me-rp",
    220         "version": "1.0.0",
    221         "version_normalized": "1.0.0.0",
     220        "version": "1.1.0",
     221        "version_normalized": "1.1.0.0",
    222222        "source": {
    223223            "type": "git",
    224224            "url": "https://gitlab.com/ID4me/id4me-rp-client-php.git",
    225             "reference": "4bcbd443be46f3555a09f10e9422f3fc03b2e89b"
     225            "reference": "fc5760acfb7f79f0114d6d167b4a9726313d727f"
    226226        },
    227227        "dist": {
    228228            "type": "zip",
    229             "url": "https://gitlab.com/api/v4/projects/ID4me%2Fid4me-rp-client-php/repository/archive.zip?sha=4bcbd443be46f3555a09f10e9422f3fc03b2e89b",
    230             "reference": "4bcbd443be46f3555a09f10e9422f3fc03b2e89b",
     229            "url": "https://gitlab.com/api/v4/projects/ID4me%2Fid4me-rp-client-php/repository/archive.zip?sha=fc5760acfb7f79f0114d6d167b4a9726313d727f",
     230            "reference": "fc5760acfb7f79f0114d6d167b4a9726313d727f",
    231231            "shasum": ""
    232232        },
     
    234234            "ext-json": "*",
    235235            "ext-openssl": "*",
    236             "php": ">=7.1",
     236            "php": ">=7.0",
    237237            "phpseclib/phpseclib": "^2.0"
    238238        },
     
    241241            "guzzlehttp/guzzle": "^6.2",
    242242            "guzzlehttp/psr7": "1.5.*",
    243             "phpunit/phpunit": "^8.0"
    244         },
    245         "time": "2019-05-07T09:35:43+00:00",
     243            "phpunit/phpunit": "^6"
     244        },
     245        "time": "2019-05-15T14:46:46+00:00",
    246246        "type": "library",
    247247        "installation-source": "dist",
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/CHANGELOG.md

    r2082608 r2100367  
    66
    77## [Unreleased]
     8
     9## [1.1.0] - 2019-05-15
     10### Changed
     11- PHP 7.1 to PHP 7.0 as minimal required version
    812
    913## [1.0.0] - 2019-05-07
     
    2933- Initial
    3034
    31 [Unreleased]: https://gitlab.com/ID4me/id4me-rp-client-php/compare/master...1.0.0
     35[Unreleased]: https://gitlab.com/ID4me/id4me-rp-client-php/compare/master...1.1.0
     36[1.1.0]: https://gitlab.com/ID4me/id4me-rp-client-php/tags/1.1.0
    3237[1.0.0]: https://gitlab.com/ID4me/id4me-rp-client-php/tags/1.0.0
    3338[0.1.0]: https://gitlab.com/ID4me/id4me-rp-client-php/tags/0.1.0
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/Dockerfile

    r2082608 r2100367  
    11# Dockerfile
    2 FROM php:7.2-apache
     2FROM php:7.0-apache
    33
    44RUN apt-get update \
    55    && apt-get install -y \
    66        git \
    7         libgmp-dev \
    87        curl \
    98        nano \
    10         gpm \
    119        unzip \
    1210        netcat
    1311
    1412RUN ln -s /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
    15 RUN docker-php-ext-install gmp
    1613RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    1714
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/composer.json

    r2082608 r2100367  
    77        "ext-json": "*",
    88        "ext-openssl": "*",
    9         "php": ">=7.1",
     9        "php": ">=7.0",
    1010        "phpseclib/phpseclib": "^2.0"
    1111    },
     
    1313        "guzzlehttp/guzzle": "^6.2",
    1414        "guzzlehttp/psr7": "1.5.*",
    15         "phpunit/phpunit": "^8.0",
     15        "phpunit/phpunit": "^6",
    1616        "ext-readline": "*"
    1717    },
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/src/Authorization.php

    r2082608 r2100367  
    216216     * @param HttpClient $httpClient
    217217     */
    218     public function setHttpClient(HttpClient $httpClient): void
     218    public function setHttpClient(HttpClient $httpClient)
    219219    {
    220220        $this->httpClient = $httpClient;
     
    226226     * @param Validation $validation
    227227     */
    228     public function setValidation(Validation $validation): void
     228    public function setValidation(Validation $validation)
    229229    {
    230230        $this->validation = $validation;
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/src/Model/Client.php

    r2082608 r2100367  
    7878     * @param string $issuer
    7979     */
    80     public function setIssuer(string $issuer): void
     80    public function setIssuer(string $issuer)
    8181    {
    8282        $this->issuer = $issuer;
     
    9494     * @param string $clientName
    9595     */
    96     public function setClientName(string $clientName): void
     96    public function setClientName(string $clientName)
    9797    {
    9898        $this->clientName = $clientName;
     
    110110     * @param string $clientId
    111111     */
    112     public function setClientId(string $clientId): void
     112    public function setClientId(string $clientId)
    113113    {
    114114        $this->clientId = $clientId;
     
    126126     * @param string $clientSecret
    127127     */
    128     public function setClientSecret(string $clientSecret): void
     128    public function setClientSecret(string $clientSecret)
    129129    {
    130130        $this->clientSecret = $clientSecret;
     
    142142     * @param int $clientExpirationTime
    143143     */
    144     public function setClientExpirationTime(int $clientExpirationTime): void
     144    public function setClientExpirationTime(int $clientExpirationTime)
    145145    {
    146146        $this->clientExpirationTime = $clientExpirationTime;
     
    158158     * @param string $activeRedirectUri
    159159     */
    160     public function setActiveRedirectUri(string $activeRedirectUri): void
     160    public function setActiveRedirectUri(string $activeRedirectUri)
    161161    {
    162162        $this->activeRedirectUri = $activeRedirectUri;
     
    174174     * @param array $redirectUris
    175175     */
    176     public function setRedirectUris(array $redirectUris): void
     176    public function setRedirectUris(array $redirectUris)
    177177    {
    178178        $this->redirectUris = $redirectUris;
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/src/Model/OpenIdConfig.php

    r2082608 r2100367  
    198198     * @param string $issuer
    199199     */
    200     public function setIssuer(string $issuer): void
     200    public function setIssuer(string $issuer)
    201201    {
    202202        $this->issuer = $issuer;
     
    214214     * @param string $jwksUri
    215215     */
    216     public function setJwksUri(string $jwksUri): void
     216    public function setJwksUri(string $jwksUri)
    217217    {
    218218        $this->jwks_uri = $jwksUri;
     
    230230     * @param string $authorizationEndpoint
    231231     */
    232     public function setAuthorizationEndpoint(string $authorizationEndpoint): void
     232    public function setAuthorizationEndpoint(string $authorizationEndpoint)
    233233    {
    234234        $this->authorization_endpoint = $authorizationEndpoint;
     
    246246     * @param string $tokenEndpoint
    247247     */
    248     public function setTokenEndpoint(string $tokenEndpoint): void
     248    public function setTokenEndpoint(string $tokenEndpoint)
    249249    {
    250250        $this->token_endpoint = $tokenEndpoint;
     
    262262     * @param string $registrationEndpoint
    263263     */
    264     public function setRegistrationEndpoint(string $registrationEndpoint): void
     264    public function setRegistrationEndpoint(string $registrationEndpoint)
    265265    {
    266266        $this->registration_endpoint = $registrationEndpoint;
     
    278278     * @param string $introspectionEndpoint
    279279     */
    280     public function setIntrospectionEndpoint(string $introspectionEndpoint): void
     280    public function setIntrospectionEndpoint(string $introspectionEndpoint)
    281281    {
    282282        $this->introspection_endpoint = $introspectionEndpoint;
     
    294294     * @param string $revocationEndpoint
    295295     */
    296     public function setRevocationEndpoint(string $revocationEndpoint): void
     296    public function setRevocationEndpoint(string $revocationEndpoint)
    297297    {
    298298        $this->revocation_endpoint = $revocationEndpoint;
     
    310310     * @param string $userInfoEndpoint
    311311     */
    312     public function setUserInfoEndpoint(string $userInfoEndpoint): void
     312    public function setUserInfoEndpoint(string $userInfoEndpoint)
    313313    {
    314314        $this->userinfo_endpoint = $userInfoEndpoint;
     
    326326     * @param string $endSessionEndpoint
    327327     */
    328     public function setEndSessionEndpoint(string $endSessionEndpoint): void
     328    public function setEndSessionEndpoint(string $endSessionEndpoint)
    329329    {
    330330        $this->end_session_endpoint = $endSessionEndpoint;
     
    342342     * @param array $scopesSupported
    343343     */
    344     public function setScopesSupported(array $scopesSupported): void
     344    public function setScopesSupported(array $scopesSupported)
    345345    {
    346346        $this->scopes_supported = $scopesSupported;
     
    358358     * @param array $responseTypesSupported
    359359     */
    360     public function setResponseTypesSupported(array $responseTypesSupported): void
     360    public function setResponseTypesSupported(array $responseTypesSupported)
    361361    {
    362362        $this->response_types_supported = $responseTypesSupported;
     
    374374     * @param array $responseModesSupported
    375375     */
    376     public function setResponseModesSupported(array $responseModesSupported): void
     376    public function setResponseModesSupported(array $responseModesSupported)
    377377    {
    378378        $this->response_modes_supported = $responseModesSupported;
     
    390390     * @param array $grantTypesSupported
    391391     */
    392     public function setGrantTypesSupported(array $grantTypesSupported): void
     392    public function setGrantTypesSupported(array $grantTypesSupported)
    393393    {
    394394        $this->grant_types_supported = $grantTypesSupported;
     
    406406     * @param array $codeChallengeMethodsSupported
    407407     */
    408     public function setCodeChallengeMethodsSupported(array $codeChallengeMethodsSupported): void
     408    public function setCodeChallengeMethodsSupported(array $codeChallengeMethodsSupported)
    409409    {
    410410        $this->code_challenge_methods_supported = $codeChallengeMethodsSupported;
     
    422422     * @param array $tokenEndpointAuthMethodsSupported
    423423     */
    424     public function setTokenEndpointAuthMethodsSupported(array $tokenEndpointAuthMethodsSupported): void
     424    public function setTokenEndpointAuthMethodsSupported(array $tokenEndpointAuthMethodsSupported)
    425425    {
    426426        $this->token_endpoint_auth_methods_supported = $tokenEndpointAuthMethodsSupported;
     
    438438     * @param array $tokenEndpointAuthSigningAlgValuesSupported
    439439     */
    440     public function setTokenEndpointAuthSigningAlgValuesSupported(array $tokenEndpointAuthSigningAlgValuesSupported): void
     440    public function setTokenEndpointAuthSigningAlgValuesSupported(array $tokenEndpointAuthSigningAlgValuesSupported)
    441441    {
    442442        $this->token_endpoint_auth_signing_alg_values_supported = $tokenEndpointAuthSigningAlgValuesSupported;
     
    454454     * @param array $requestObjectSigningAlgValuesSupported
    455455     */
    456     public function setRequestObjectSigningAlgValuesSupported(array $requestObjectSigningAlgValuesSupported): void
     456    public function setRequestObjectSigningAlgValuesSupported(array $requestObjectSigningAlgValuesSupported)
    457457    {
    458458        $this->request_object_signing_alg_values_supported = $requestObjectSigningAlgValuesSupported;
     
    470470     * @param array $uiLocalesSupported
    471471     */
    472     public function setUiLocalesSupported(array $uiLocalesSupported): void
     472    public function setUiLocalesSupported(array $uiLocalesSupported)
    473473    {
    474474        $this->ui_locales_supported = $uiLocalesSupported;
     
    486486     * @param bool $requestParameterSupported
    487487     */
    488     public function setRequestParameterSupported(bool $requestParameterSupported): void
     488    public function setRequestParameterSupported(bool $requestParameterSupported)
    489489    {
    490490        $this->request_parameter_supported = $requestParameterSupported;
     
    502502     * @param array $idTokenSigningAlgValuesSupported
    503503     */
    504     public function setIdTokenSigningAlgValuesSupported(array $idTokenSigningAlgValuesSupported): void
     504    public function setIdTokenSigningAlgValuesSupported(array $idTokenSigningAlgValuesSupported)
    505505    {
    506506        $this->id_token_signing_alg_values_supported = $idTokenSigningAlgValuesSupported;
     
    518518     * @param array $idTokenEncryptionEncValuesSupported
    519519     */
    520     public function setIdTokenEncryptionEncValuesSupported(array $idTokenEncryptionEncValuesSupported): void
     520    public function setIdTokenEncryptionEncValuesSupported(array $idTokenEncryptionEncValuesSupported)
    521521    {
    522522        $this->id_token_encryption_enc_values_supported = $idTokenEncryptionEncValuesSupported;
     
    534534     * @param array $userInfoSigningAlgValuesSupported
    535535     */
    536     public function setUserInfoSigningAlgValuesSupported(array $userInfoSigningAlgValuesSupported): void
     536    public function setUserInfoSigningAlgValuesSupported(array $userInfoSigningAlgValuesSupported)
    537537    {
    538538        $this->userinfo_signing_alg_values_supported = $userInfoSigningAlgValuesSupported;
     
    550550     * @param array $userInfoEncryptionAlgValuesSupported
    551551     */
    552     public function setUserInfoEncryptionAlgValuesSupported(array $userInfoEncryptionAlgValuesSupported): void
     552    public function setUserInfoEncryptionAlgValuesSupported(array $userInfoEncryptionAlgValuesSupported)
    553553    {
    554554        $this->userinfo_encryption_alg_values_supported = $userInfoEncryptionAlgValuesSupported;
     
    566566     * @param array $displayValuesSupported
    567567     */
    568     public function setDisplayValuesSupported(array $displayValuesSupported): void
     568    public function setDisplayValuesSupported(array $displayValuesSupported)
    569569    {
    570570        $this->display_values_supported = $displayValuesSupported;
     
    582582     * @param array $claimTypesSupported
    583583     */
    584     public function setClaimTypesSupported(array $claimTypesSupported): void
     584    public function setClaimTypesSupported(array $claimTypesSupported)
    585585    {
    586586        $this->claim_types_supported = $claimTypesSupported;
     
    598598     * @param array $claimsSupported
    599599     */
    600     public function setClaimsSupported(array $claimsSupported): void
     600    public function setClaimsSupported(array $claimsSupported)
    601601    {
    602602        $this->claims_supported = $claimsSupported;
     
    614614     * @param bool $claimsParameterSupported
    615615     */
    616     public function setClaimsParameterSupported(bool $claimsParameterSupported): void
     616    public function setClaimsParameterSupported(bool $claimsParameterSupported)
    617617    {
    618618        $this->claims_parameter_supported = $claimsParameterSupported;
     
    630630     * @param bool $frontChannelLogoutSupported
    631631     */
    632     public function setFrontChannelLogoutSupported(bool $frontChannelLogoutSupported): void
     632    public function setFrontChannelLogoutSupported(bool $frontChannelLogoutSupported)
    633633    {
    634634        $this->front_channel_logout_supported = $frontChannelLogoutSupported;
     
    646646     * @param bool $backChannelLogoutSupported
    647647     */
    648     public function setBackChannelLogoutSupported(bool $backChannelLogoutSupported): void
     648    public function setBackChannelLogoutSupported(bool $backChannelLogoutSupported)
    649649    {
    650650        $this->back_channel_logout_supported = $backChannelLogoutSupported;
     
    662662     * @param bool $requestUriParameterSupported
    663663     */
    664     public function setRequestUriParameterSupported(bool $requestUriParameterSupported): void
     664    public function setRequestUriParameterSupported(bool $requestUriParameterSupported)
    665665    {
    666666        $this->request_uri_parameter_supported = $requestUriParameterSupported;
     
    678678     * @param bool $requireRequestUriRegistration
    679679     */
    680     public function setRequireRequestUriRegistration(bool $requireRequestUriRegistration): void
     680    public function setRequireRequestUriRegistration(bool $requireRequestUriRegistration)
    681681    {
    682682        $this->require_request_uri_registration = $requireRequestUriRegistration;
     
    694694     * @param int $tlsClientCertificateBoundAccessTokens
    695695     */
    696     public function setTlsClientCertificateBoundAccessTokens(int $tlsClientCertificateBoundAccessTokens): void
     696    public function setTlsClientCertificateBoundAccessTokens(int $tlsClientCertificateBoundAccessTokens)
    697697    {
    698698        $this->tls_client_certificate_bound_access_tokens = $tlsClientCertificateBoundAccessTokens;
     
    710710     * @param int $requestUriQuota
    711711     */
    712     public function setRequestUriQuota(int $requestUriQuota): void
     712    public function setRequestUriQuota(int $requestUriQuota)
    713713    {
    714714        $this->request_uri_quota = $requestUriQuota;
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/src/Service.php

    r2082608 r2100367  
    200200     * @param Authorization $authorization
    201201     */
    202     public function setAuthorization(Authorization $authorization): void
     202    public function setAuthorization(Authorization $authorization)
    203203    {
    204204        $this->authorization = $authorization;
     
    210210     * @param OpenIdConfigHelper $openConfigHelper
    211211     */
    212     public function setOpenConfigHelper(OpenIdConfigHelper $openConfigHelper): void
     212    public function setOpenConfigHelper(OpenIdConfigHelper $openConfigHelper)
    213213    {
    214214        $this->openConfigHelper = $openConfigHelper;
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/src/Validation.php

    r2082608 r2100367  
    3737     * @throws InvalidAuthorityIssuerException if provided iss and issuer values are not equal
    3838     */
    39     public function validateISS(string $originIssuer, string $deliveredIssuer, bool $exactMatch = true): void
     39    public function validateISS(string $originIssuer, string $deliveredIssuer, bool $exactMatch = true)
    4040    {
    4141        if ($exactMatch && ($originIssuer !== $deliveredIssuer)) {
     
    6363        IdToken $idToken,
    6464        array $jwksArray
    65     ): void {
     65    ) {
    6666
    6767        if ($algorithm != 'RS256') {
     
    110110     * @throws InvalidIDTokenException
    111111     */
    112     public function validateAudience($audience, $authorizedParty, string $clientId): void
     112    public function validateAudience($audience, $authorizedParty, string $clientId)
    113113    {
    114114        $isValidAudience = false;
     
    163163     * @throws InvalidIDTokenException
    164164     */
    165     public function validateExpirationTime(string $expirationTime): void
     165    public function validateExpirationTime(string $expirationTime)
    166166    {
    167167        $isValidExpirationTime = false;
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/tests/Mock/HttpClientGuzzle.php

    r2082608 r2100367  
    88class HttpClientGuzzle implements HttpClient {
    99
    10     public function get($url, $headers = [])
     10    public function get($url, array $headers = [])
    1111    {
    1212        $httpClient = new Client();
     
    1717    }
    1818
    19     public function post($url, $body, $headers = [])
     19    public function post($url, $body, array $headers = [])
    2020    {
    2121        $httpClient = new Client();
  • id4me/tags/1.0.2/vendor/id4me/id4me-rp/tests/ValidationTest.php

    r2082608 r2100367  
    2626        IdToken $idToken,
    2727        array $jwksArray,
    28         string $exceptionMessage
    29     ): void {
    30 
    31         if ($exceptionMessage) {
    32             $this->expectException(InvalidIDTokenException::class);
    33             $this->expectExceptionMessage($exceptionMessage);
    34         } else {
    35             $this->expectNotToPerformAssertions();
     28        string $expectedErrorMsg,
     29        string $expectedExceptionType
     30    ) {
     31        $thrownExceptionMsg  = '';
     32        $thrownExceptionType = '';
     33
     34        try {
     35            $validation = new Validation();
     36            $validation->validateIdTokenSignature(
     37                $usedKey,
     38                $algorithm,
     39                $idToken,
     40                $jwksArray
     41            );
     42        } catch (Exception $e) {
     43            $thrownExceptionMsg  = $e->getMessage();
     44            $thrownExceptionType = get_class($e);
    3645        }
    37 
    38         $validation = new Validation();
    39         $validation->validateIdTokenSignature(
    40             $usedKey,
    41             $algorithm,
    42             $idToken,
    43             $jwksArray
    44         );
     46        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     47        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    4548    }
    4649
     
    6164                $idToken,
    6265                $jwks,
     66                '',
    6367                ''
    6468            ],
     
    6872                new IdToken('t.e.s.t'),
    6973                $jwks,
    70                 Validation::INVALID_ID_TOKEN_SIGNATURE_EXCEPTION
     74                Validation::INVALID_ID_TOKEN_SIGNATURE_EXCEPTION,
     75                get_class(new InvalidIDTokenException)
    7176            ],
    7277            [
     
    7580                $idToken,
    7681                $jwks,
    77                 Validation::INVALID_ID_TOKEN_JWS_KEYSET_KEY_NOT_FOUND
     82                Validation::INVALID_ID_TOKEN_JWS_KEYSET_KEY_NOT_FOUND,
     83                get_class(new InvalidIDTokenException)
    7884            ],
    7985            [
     
    8288                $idToken,
    8389                $jwks,
    84                 sprintf(Validation::INVALID_ID_TOKEN_ALGORITHM_EXCEPTION, 'wrong-algo')
     90                sprintf(Validation::INVALID_ID_TOKEN_ALGORITHM_EXCEPTION, 'wrong-algo'),
     91                get_class(new InvalidIDTokenException)
    8592            ]
    8693        ];
     
    103110        string $deliveredIssuer,
    104111        bool $exactMatch,
    105         bool $throwsException
    106     ): void {
    107 
    108         if ($throwsException) {
    109             $this->expectException(InvalidAuthorityIssuerException::class);
    110             $this->expectExceptionMessage(Validation::INVALID_ID_TOKEN_ISSUER_EXCEPTION);
    111         } else {
    112             $this->expectNotToPerformAssertions();
     112        string $expectedErrorMsg,
     113        string $expectedExceptionType
     114    ) {
     115        $thrownExceptionMsg  = '';
     116        $thrownExceptionType = '';
     117
     118        try {
     119            $validation = new Validation();
     120            $validation->validateISS(
     121                $originIssuer,
     122                $deliveredIssuer,
     123                $exactMatch
     124            );
     125        } catch (Exception $e) {
     126            $thrownExceptionMsg  = $e->getMessage();
     127            $thrownExceptionType = get_class($e);
    113128        }
    114 
    115         $validation = new Validation();
    116         $validation->validateISS(
    117             $originIssuer,
    118             $deliveredIssuer,
    119             $exactMatch
    120         );
     129        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     130        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    121131    }
    122132
     
    133143                'https://id.test.denic.de',
    134144                true,
    135                 false
     145                '',
     146                ''
    136147            ],
    137148            [
     
    139150                'https://id.test.denic.de',
    140151                false,
    141                 false
     152                '',
     153                ''
    142154            ],
    143155            [
     
    145157                'id.test.denic.de',
    146158                true,
    147                 true
     159                Validation::INVALID_ID_TOKEN_ISSUER_EXCEPTION,
     160                get_class(new InvalidAuthorityIssuerException)
    148161            ],
    149162            [
     
    151164                'https://id.test.denic.com',
    152165                true,
    153                 true
     166                Validation::INVALID_ID_TOKEN_ISSUER_EXCEPTION,
     167                get_class(new InvalidAuthorityIssuerException)
    154168            ]
    155169        ];
     
    172186        string $authorizedParty,
    173187        string $clientId,
    174         bool $throwsException
    175     ): void {
    176 
    177         if ($throwsException) {
    178             $this->expectException(InvalidIDTokenException::class);
    179             $this->expectExceptionMessage(Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION);
    180         } else {
    181             $this->expectNotToPerformAssertions();
     188        string $expectedErrorMsg,
     189        string $expectedExceptionType
     190    ) {
     191        $thrownExceptionMsg  = '';
     192        $thrownExceptionType = '';
     193        try {
     194            $validation = new Validation();
     195            $validation->validateAudience(
     196                $audience,
     197                $authorizedParty,
     198                $clientId
     199            );
     200        } catch (Exception $e) {
     201            $thrownExceptionMsg  = $e->getMessage();
     202            $thrownExceptionType = get_class($e);
    182203        }
    183 
    184         $validation = new Validation();
    185         $validation->validateAudience(
    186             $audience,
    187             $authorizedParty,
    188             $clientId
    189         );
     204        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     205        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    190206    }
    191207
     
    202218                '',
    203219                '7ftj6vw545suk',
    204                 false
    205             ],
    206             [
    207                 '7ftj6vw545suk',
    208                 '7ftj6vw545suk',
    209                 '7ftj6vw545suk',
    210                 false
     220                '',
     221                ''
     222            ],
     223            [
     224                '7ftj6vw545suk',
     225                '7ftj6vw545suk',
     226                '7ftj6vw545suk',
     227                '',
     228                ''
    211229            ],
    212230            [
     
    214232                '',
    215233                'wrong-client-id',
    216                 true
     234                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     235                get_class(new InvalidIDTokenException)
    217236            ],
    218237            [
     
    220239                '7ftj6vw545suk',
    221240                '7ftj6vw545suk',
    222                 false
     241                '',
     242                ''
    223243            ],
    224244            [
     
    226246                '',
    227247                '7ftj6vw545suk',
    228                 true
    229             ],
    230             [
    231                 '',
    232                 '7ftj6vw545suk',
    233                 '7ftj6vw545suk',
    234                 true
     248                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     249                get_class(new InvalidIDTokenException)
     250            ],
     251            [
     252                '',
     253                '7ftj6vw545suk',
     254                '7ftj6vw545suk',
     255                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     256                get_class(new InvalidIDTokenException)
    235257            ],
    236258            [
     
    238260                'vwsvw5',
    239261                '7ftj6vw545suk',
    240                 true
     262                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     263                get_class(new InvalidIDTokenException)
    241264            ]
    242265        ];
     
    255278    public function testValidateIDTokenExpirationTime(
    256279        string $expirationTime,
    257         bool $throwsException
    258     ): void {
    259 
    260         if ($throwsException) {
    261             $this->expectException(InvalidIDTokenException::class);
    262             $this->expectExceptionMessage(Validation::INVALID_ID_TOKEN_EXPIRATION_TIME_EXCEPTION);
    263         } else {
    264             $this->expectNotToPerformAssertions();
     280        string $expectedErrorMsg,
     281        string $expectedExceptionType
     282    ) {
     283        $thrownExceptionMsg  = '';
     284        $thrownExceptionType = '';
     285        try {
     286            $validation = new Validation();
     287            $validation->validateExpirationTime(
     288                $expirationTime
     289            );
     290        } catch (Exception $e) {
     291            $thrownExceptionMsg  = $e->getMessage();
     292            $thrownExceptionType = get_class($e);
    265293        }
    266 
    267         $validation = new Validation();
    268         $validation->validateExpirationTime($expirationTime);
     294        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     295        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    269296    }
    270297
     
    279306            [
    280307                (string) mktime(10, 30, 30, 1, 1, 2050),
    281                 false
    282             ],
    283             [
    284                 '',
    285                 true
     308                '',
     309                ''
     310            ],
     311            [
     312                '',
     313                Validation::INVALID_ID_TOKEN_EXPIRATION_TIME_EXCEPTION,
     314                get_class(new InvalidIDTokenException)
     315
    286316            ],
    287317            [
    288318                (string) mktime(10, 30, 30, 1, 1, 1950),
    289                 true
     319                Validation::INVALID_ID_TOKEN_EXPIRATION_TIME_EXCEPTION,
     320                get_class(new InvalidIDTokenException)
    290321            ]
    291322        ];
     
    323354
    324355        // Header data value test
    325         $this->assertIsArray($idToken->getDecodedHeader());
     356        $this->assertTrue(is_array($idToken->getDecodedHeader()));
    326357        $this->assertSame(
    327358            $idToken->getDecodedHeader(),
     
    333364
    334365        // Body data value test
    335         $this->assertIsArray($idToken->getDecodedBody());
     366        $this->assertTrue(is_array($idToken->getDecodedBody()));
    336367        $this->assertSame(
    337368            $idToken->getDecodedBody(),
  • id4me/trunk/id4me.php

    r2082608 r2100367  
    44 * Plugin URI:   https://wordpress.org/plugins/id4me/
    55 * Description:  One ID for everything. Log in into your WordPress with your domain, through any service you like!
    6  * Version:      1.0.0
     6 * Version:      1.0.2
    77 * License:      MIT
    88 * Author:       1&1 IONOS
    99 * Author URI:   https://www.ionos.com
    10  * Requires PHP: 7.1
     10 * Requires PHP: 7.0
    1111 * Text Domain:  id4me
    1212 */
  • id4me/trunk/readme.txt

    r2082608 r2100367  
    11=== ID4me ===
    2 Contributors: gdespoulain, herrfeldmann, kimalumalu, pfefferle, rinma
     2Contributors: gdespoulain, herrfeldmann, kimalumalu, pfefferle, rinma, ionos
    33Tags: ID4me, login, domain
    44Requires at least: 5.0
    5 Requires PHP: 7.1
    6 Tested up to: 5.1
    7 Stable tag: 1.0.0
     5Requires PHP: 7.0
     6Tested up to: 5.2
     7Stable tag: 1.0.2
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    3535
    3636== Changelog ==
     37
     38= 1.0.2 =
     39
     40* Update library version to 1.1.0
     41
     42= 1.0.1 =
     43
     44* Update doc with tested up to 5.2
    3745
    3846= 1.0.0 =
     
    103111= Configuration of users =
    104112
    105 **Note:** The (current) **1.0.0** version only works with already registered WordPress users (who indicated their ID4me identifier
     113**Note:** The (current) **1.0.2** version only works with already registered WordPress users (who indicated their ID4me identifier
    106114in the **ID4me identifier** profile field). Next versions will include a more complex user management.
    107115
  • id4me/trunk/vendor

    • Property svn:ignore set to
      bin
  • id4me/trunk/vendor/composer/installed.json

    r2082608 r2100367  
    218218    {
    219219        "name": "id4me/id4me-rp",
    220         "version": "1.0.0",
    221         "version_normalized": "1.0.0.0",
     220        "version": "1.1.0",
     221        "version_normalized": "1.1.0.0",
    222222        "source": {
    223223            "type": "git",
    224224            "url": "https://gitlab.com/ID4me/id4me-rp-client-php.git",
    225             "reference": "4bcbd443be46f3555a09f10e9422f3fc03b2e89b"
     225            "reference": "fc5760acfb7f79f0114d6d167b4a9726313d727f"
    226226        },
    227227        "dist": {
    228228            "type": "zip",
    229             "url": "https://gitlab.com/api/v4/projects/ID4me%2Fid4me-rp-client-php/repository/archive.zip?sha=4bcbd443be46f3555a09f10e9422f3fc03b2e89b",
    230             "reference": "4bcbd443be46f3555a09f10e9422f3fc03b2e89b",
     229            "url": "https://gitlab.com/api/v4/projects/ID4me%2Fid4me-rp-client-php/repository/archive.zip?sha=fc5760acfb7f79f0114d6d167b4a9726313d727f",
     230            "reference": "fc5760acfb7f79f0114d6d167b4a9726313d727f",
    231231            "shasum": ""
    232232        },
     
    234234            "ext-json": "*",
    235235            "ext-openssl": "*",
    236             "php": ">=7.1",
     236            "php": ">=7.0",
    237237            "phpseclib/phpseclib": "^2.0"
    238238        },
     
    241241            "guzzlehttp/guzzle": "^6.2",
    242242            "guzzlehttp/psr7": "1.5.*",
    243             "phpunit/phpunit": "^8.0"
    244         },
    245         "time": "2019-05-07T09:35:43+00:00",
     243            "phpunit/phpunit": "^6"
     244        },
     245        "time": "2019-05-15T14:46:46+00:00",
    246246        "type": "library",
    247247        "installation-source": "dist",
  • id4me/trunk/vendor/id4me/id4me-rp/CHANGELOG.md

    r2082608 r2100367  
    66
    77## [Unreleased]
     8
     9## [1.1.0] - 2019-05-15
     10### Changed
     11- PHP 7.1 to PHP 7.0 as minimal required version
    812
    913## [1.0.0] - 2019-05-07
     
    2933- Initial
    3034
    31 [Unreleased]: https://gitlab.com/ID4me/id4me-rp-client-php/compare/master...1.0.0
     35[Unreleased]: https://gitlab.com/ID4me/id4me-rp-client-php/compare/master...1.1.0
     36[1.1.0]: https://gitlab.com/ID4me/id4me-rp-client-php/tags/1.1.0
    3237[1.0.0]: https://gitlab.com/ID4me/id4me-rp-client-php/tags/1.0.0
    3338[0.1.0]: https://gitlab.com/ID4me/id4me-rp-client-php/tags/0.1.0
  • id4me/trunk/vendor/id4me/id4me-rp/Dockerfile

    r2082608 r2100367  
    11# Dockerfile
    2 FROM php:7.2-apache
     2FROM php:7.0-apache
    33
    44RUN apt-get update \
    55    && apt-get install -y \
    66        git \
    7         libgmp-dev \
    87        curl \
    98        nano \
    10         gpm \
    119        unzip \
    1210        netcat
    1311
    1412RUN ln -s /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
    15 RUN docker-php-ext-install gmp
    1613RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    1714
  • id4me/trunk/vendor/id4me/id4me-rp/composer.json

    r2082608 r2100367  
    77        "ext-json": "*",
    88        "ext-openssl": "*",
    9         "php": ">=7.1",
     9        "php": ">=7.0",
    1010        "phpseclib/phpseclib": "^2.0"
    1111    },
     
    1313        "guzzlehttp/guzzle": "^6.2",
    1414        "guzzlehttp/psr7": "1.5.*",
    15         "phpunit/phpunit": "^8.0",
     15        "phpunit/phpunit": "^6",
    1616        "ext-readline": "*"
    1717    },
  • id4me/trunk/vendor/id4me/id4me-rp/src/Authorization.php

    r2082608 r2100367  
    216216     * @param HttpClient $httpClient
    217217     */
    218     public function setHttpClient(HttpClient $httpClient): void
     218    public function setHttpClient(HttpClient $httpClient)
    219219    {
    220220        $this->httpClient = $httpClient;
     
    226226     * @param Validation $validation
    227227     */
    228     public function setValidation(Validation $validation): void
     228    public function setValidation(Validation $validation)
    229229    {
    230230        $this->validation = $validation;
  • id4me/trunk/vendor/id4me/id4me-rp/src/Model/Client.php

    r2082608 r2100367  
    7878     * @param string $issuer
    7979     */
    80     public function setIssuer(string $issuer): void
     80    public function setIssuer(string $issuer)
    8181    {
    8282        $this->issuer = $issuer;
     
    9494     * @param string $clientName
    9595     */
    96     public function setClientName(string $clientName): void
     96    public function setClientName(string $clientName)
    9797    {
    9898        $this->clientName = $clientName;
     
    110110     * @param string $clientId
    111111     */
    112     public function setClientId(string $clientId): void
     112    public function setClientId(string $clientId)
    113113    {
    114114        $this->clientId = $clientId;
     
    126126     * @param string $clientSecret
    127127     */
    128     public function setClientSecret(string $clientSecret): void
     128    public function setClientSecret(string $clientSecret)
    129129    {
    130130        $this->clientSecret = $clientSecret;
     
    142142     * @param int $clientExpirationTime
    143143     */
    144     public function setClientExpirationTime(int $clientExpirationTime): void
     144    public function setClientExpirationTime(int $clientExpirationTime)
    145145    {
    146146        $this->clientExpirationTime = $clientExpirationTime;
     
    158158     * @param string $activeRedirectUri
    159159     */
    160     public function setActiveRedirectUri(string $activeRedirectUri): void
     160    public function setActiveRedirectUri(string $activeRedirectUri)
    161161    {
    162162        $this->activeRedirectUri = $activeRedirectUri;
     
    174174     * @param array $redirectUris
    175175     */
    176     public function setRedirectUris(array $redirectUris): void
     176    public function setRedirectUris(array $redirectUris)
    177177    {
    178178        $this->redirectUris = $redirectUris;
  • id4me/trunk/vendor/id4me/id4me-rp/src/Model/OpenIdConfig.php

    r2082608 r2100367  
    198198     * @param string $issuer
    199199     */
    200     public function setIssuer(string $issuer): void
     200    public function setIssuer(string $issuer)
    201201    {
    202202        $this->issuer = $issuer;
     
    214214     * @param string $jwksUri
    215215     */
    216     public function setJwksUri(string $jwksUri): void
     216    public function setJwksUri(string $jwksUri)
    217217    {
    218218        $this->jwks_uri = $jwksUri;
     
    230230     * @param string $authorizationEndpoint
    231231     */
    232     public function setAuthorizationEndpoint(string $authorizationEndpoint): void
     232    public function setAuthorizationEndpoint(string $authorizationEndpoint)
    233233    {
    234234        $this->authorization_endpoint = $authorizationEndpoint;
     
    246246     * @param string $tokenEndpoint
    247247     */
    248     public function setTokenEndpoint(string $tokenEndpoint): void
     248    public function setTokenEndpoint(string $tokenEndpoint)
    249249    {
    250250        $this->token_endpoint = $tokenEndpoint;
     
    262262     * @param string $registrationEndpoint
    263263     */
    264     public function setRegistrationEndpoint(string $registrationEndpoint): void
     264    public function setRegistrationEndpoint(string $registrationEndpoint)
    265265    {
    266266        $this->registration_endpoint = $registrationEndpoint;
     
    278278     * @param string $introspectionEndpoint
    279279     */
    280     public function setIntrospectionEndpoint(string $introspectionEndpoint): void
     280    public function setIntrospectionEndpoint(string $introspectionEndpoint)
    281281    {
    282282        $this->introspection_endpoint = $introspectionEndpoint;
     
    294294     * @param string $revocationEndpoint
    295295     */
    296     public function setRevocationEndpoint(string $revocationEndpoint): void
     296    public function setRevocationEndpoint(string $revocationEndpoint)
    297297    {
    298298        $this->revocation_endpoint = $revocationEndpoint;
     
    310310     * @param string $userInfoEndpoint
    311311     */
    312     public function setUserInfoEndpoint(string $userInfoEndpoint): void
     312    public function setUserInfoEndpoint(string $userInfoEndpoint)
    313313    {
    314314        $this->userinfo_endpoint = $userInfoEndpoint;
     
    326326     * @param string $endSessionEndpoint
    327327     */
    328     public function setEndSessionEndpoint(string $endSessionEndpoint): void
     328    public function setEndSessionEndpoint(string $endSessionEndpoint)
    329329    {
    330330        $this->end_session_endpoint = $endSessionEndpoint;
     
    342342     * @param array $scopesSupported
    343343     */
    344     public function setScopesSupported(array $scopesSupported): void
     344    public function setScopesSupported(array $scopesSupported)
    345345    {
    346346        $this->scopes_supported = $scopesSupported;
     
    358358     * @param array $responseTypesSupported
    359359     */
    360     public function setResponseTypesSupported(array $responseTypesSupported): void
     360    public function setResponseTypesSupported(array $responseTypesSupported)
    361361    {
    362362        $this->response_types_supported = $responseTypesSupported;
     
    374374     * @param array $responseModesSupported
    375375     */
    376     public function setResponseModesSupported(array $responseModesSupported): void
     376    public function setResponseModesSupported(array $responseModesSupported)
    377377    {
    378378        $this->response_modes_supported = $responseModesSupported;
     
    390390     * @param array $grantTypesSupported
    391391     */
    392     public function setGrantTypesSupported(array $grantTypesSupported): void
     392    public function setGrantTypesSupported(array $grantTypesSupported)
    393393    {
    394394        $this->grant_types_supported = $grantTypesSupported;
     
    406406     * @param array $codeChallengeMethodsSupported
    407407     */
    408     public function setCodeChallengeMethodsSupported(array $codeChallengeMethodsSupported): void
     408    public function setCodeChallengeMethodsSupported(array $codeChallengeMethodsSupported)
    409409    {
    410410        $this->code_challenge_methods_supported = $codeChallengeMethodsSupported;
     
    422422     * @param array $tokenEndpointAuthMethodsSupported
    423423     */
    424     public function setTokenEndpointAuthMethodsSupported(array $tokenEndpointAuthMethodsSupported): void
     424    public function setTokenEndpointAuthMethodsSupported(array $tokenEndpointAuthMethodsSupported)
    425425    {
    426426        $this->token_endpoint_auth_methods_supported = $tokenEndpointAuthMethodsSupported;
     
    438438     * @param array $tokenEndpointAuthSigningAlgValuesSupported
    439439     */
    440     public function setTokenEndpointAuthSigningAlgValuesSupported(array $tokenEndpointAuthSigningAlgValuesSupported): void
     440    public function setTokenEndpointAuthSigningAlgValuesSupported(array $tokenEndpointAuthSigningAlgValuesSupported)
    441441    {
    442442        $this->token_endpoint_auth_signing_alg_values_supported = $tokenEndpointAuthSigningAlgValuesSupported;
     
    454454     * @param array $requestObjectSigningAlgValuesSupported
    455455     */
    456     public function setRequestObjectSigningAlgValuesSupported(array $requestObjectSigningAlgValuesSupported): void
     456    public function setRequestObjectSigningAlgValuesSupported(array $requestObjectSigningAlgValuesSupported)
    457457    {
    458458        $this->request_object_signing_alg_values_supported = $requestObjectSigningAlgValuesSupported;
     
    470470     * @param array $uiLocalesSupported
    471471     */
    472     public function setUiLocalesSupported(array $uiLocalesSupported): void
     472    public function setUiLocalesSupported(array $uiLocalesSupported)
    473473    {
    474474        $this->ui_locales_supported = $uiLocalesSupported;
     
    486486     * @param bool $requestParameterSupported
    487487     */
    488     public function setRequestParameterSupported(bool $requestParameterSupported): void
     488    public function setRequestParameterSupported(bool $requestParameterSupported)
    489489    {
    490490        $this->request_parameter_supported = $requestParameterSupported;
     
    502502     * @param array $idTokenSigningAlgValuesSupported
    503503     */
    504     public function setIdTokenSigningAlgValuesSupported(array $idTokenSigningAlgValuesSupported): void
     504    public function setIdTokenSigningAlgValuesSupported(array $idTokenSigningAlgValuesSupported)
    505505    {
    506506        $this->id_token_signing_alg_values_supported = $idTokenSigningAlgValuesSupported;
     
    518518     * @param array $idTokenEncryptionEncValuesSupported
    519519     */
    520     public function setIdTokenEncryptionEncValuesSupported(array $idTokenEncryptionEncValuesSupported): void
     520    public function setIdTokenEncryptionEncValuesSupported(array $idTokenEncryptionEncValuesSupported)
    521521    {
    522522        $this->id_token_encryption_enc_values_supported = $idTokenEncryptionEncValuesSupported;
     
    534534     * @param array $userInfoSigningAlgValuesSupported
    535535     */
    536     public function setUserInfoSigningAlgValuesSupported(array $userInfoSigningAlgValuesSupported): void
     536    public function setUserInfoSigningAlgValuesSupported(array $userInfoSigningAlgValuesSupported)
    537537    {
    538538        $this->userinfo_signing_alg_values_supported = $userInfoSigningAlgValuesSupported;
     
    550550     * @param array $userInfoEncryptionAlgValuesSupported
    551551     */
    552     public function setUserInfoEncryptionAlgValuesSupported(array $userInfoEncryptionAlgValuesSupported): void
     552    public function setUserInfoEncryptionAlgValuesSupported(array $userInfoEncryptionAlgValuesSupported)
    553553    {
    554554        $this->userinfo_encryption_alg_values_supported = $userInfoEncryptionAlgValuesSupported;
     
    566566     * @param array $displayValuesSupported
    567567     */
    568     public function setDisplayValuesSupported(array $displayValuesSupported): void
     568    public function setDisplayValuesSupported(array $displayValuesSupported)
    569569    {
    570570        $this->display_values_supported = $displayValuesSupported;
     
    582582     * @param array $claimTypesSupported
    583583     */
    584     public function setClaimTypesSupported(array $claimTypesSupported): void
     584    public function setClaimTypesSupported(array $claimTypesSupported)
    585585    {
    586586        $this->claim_types_supported = $claimTypesSupported;
     
    598598     * @param array $claimsSupported
    599599     */
    600     public function setClaimsSupported(array $claimsSupported): void
     600    public function setClaimsSupported(array $claimsSupported)
    601601    {
    602602        $this->claims_supported = $claimsSupported;
     
    614614     * @param bool $claimsParameterSupported
    615615     */
    616     public function setClaimsParameterSupported(bool $claimsParameterSupported): void
     616    public function setClaimsParameterSupported(bool $claimsParameterSupported)
    617617    {
    618618        $this->claims_parameter_supported = $claimsParameterSupported;
     
    630630     * @param bool $frontChannelLogoutSupported
    631631     */
    632     public function setFrontChannelLogoutSupported(bool $frontChannelLogoutSupported): void
     632    public function setFrontChannelLogoutSupported(bool $frontChannelLogoutSupported)
    633633    {
    634634        $this->front_channel_logout_supported = $frontChannelLogoutSupported;
     
    646646     * @param bool $backChannelLogoutSupported
    647647     */
    648     public function setBackChannelLogoutSupported(bool $backChannelLogoutSupported): void
     648    public function setBackChannelLogoutSupported(bool $backChannelLogoutSupported)
    649649    {
    650650        $this->back_channel_logout_supported = $backChannelLogoutSupported;
     
    662662     * @param bool $requestUriParameterSupported
    663663     */
    664     public function setRequestUriParameterSupported(bool $requestUriParameterSupported): void
     664    public function setRequestUriParameterSupported(bool $requestUriParameterSupported)
    665665    {
    666666        $this->request_uri_parameter_supported = $requestUriParameterSupported;
     
    678678     * @param bool $requireRequestUriRegistration
    679679     */
    680     public function setRequireRequestUriRegistration(bool $requireRequestUriRegistration): void
     680    public function setRequireRequestUriRegistration(bool $requireRequestUriRegistration)
    681681    {
    682682        $this->require_request_uri_registration = $requireRequestUriRegistration;
     
    694694     * @param int $tlsClientCertificateBoundAccessTokens
    695695     */
    696     public function setTlsClientCertificateBoundAccessTokens(int $tlsClientCertificateBoundAccessTokens): void
     696    public function setTlsClientCertificateBoundAccessTokens(int $tlsClientCertificateBoundAccessTokens)
    697697    {
    698698        $this->tls_client_certificate_bound_access_tokens = $tlsClientCertificateBoundAccessTokens;
     
    710710     * @param int $requestUriQuota
    711711     */
    712     public function setRequestUriQuota(int $requestUriQuota): void
     712    public function setRequestUriQuota(int $requestUriQuota)
    713713    {
    714714        $this->request_uri_quota = $requestUriQuota;
  • id4me/trunk/vendor/id4me/id4me-rp/src/Service.php

    r2082608 r2100367  
    200200     * @param Authorization $authorization
    201201     */
    202     public function setAuthorization(Authorization $authorization): void
     202    public function setAuthorization(Authorization $authorization)
    203203    {
    204204        $this->authorization = $authorization;
     
    210210     * @param OpenIdConfigHelper $openConfigHelper
    211211     */
    212     public function setOpenConfigHelper(OpenIdConfigHelper $openConfigHelper): void
     212    public function setOpenConfigHelper(OpenIdConfigHelper $openConfigHelper)
    213213    {
    214214        $this->openConfigHelper = $openConfigHelper;
  • id4me/trunk/vendor/id4me/id4me-rp/src/Validation.php

    r2082608 r2100367  
    3737     * @throws InvalidAuthorityIssuerException if provided iss and issuer values are not equal
    3838     */
    39     public function validateISS(string $originIssuer, string $deliveredIssuer, bool $exactMatch = true): void
     39    public function validateISS(string $originIssuer, string $deliveredIssuer, bool $exactMatch = true)
    4040    {
    4141        if ($exactMatch && ($originIssuer !== $deliveredIssuer)) {
     
    6363        IdToken $idToken,
    6464        array $jwksArray
    65     ): void {
     65    ) {
    6666
    6767        if ($algorithm != 'RS256') {
     
    110110     * @throws InvalidIDTokenException
    111111     */
    112     public function validateAudience($audience, $authorizedParty, string $clientId): void
     112    public function validateAudience($audience, $authorizedParty, string $clientId)
    113113    {
    114114        $isValidAudience = false;
     
    163163     * @throws InvalidIDTokenException
    164164     */
    165     public function validateExpirationTime(string $expirationTime): void
     165    public function validateExpirationTime(string $expirationTime)
    166166    {
    167167        $isValidExpirationTime = false;
  • id4me/trunk/vendor/id4me/id4me-rp/tests/Mock/HttpClientGuzzle.php

    r2082608 r2100367  
    88class HttpClientGuzzle implements HttpClient {
    99
    10     public function get($url, $headers = [])
     10    public function get($url, array $headers = [])
    1111    {
    1212        $httpClient = new Client();
     
    1717    }
    1818
    19     public function post($url, $body, $headers = [])
     19    public function post($url, $body, array $headers = [])
    2020    {
    2121        $httpClient = new Client();
  • id4me/trunk/vendor/id4me/id4me-rp/tests/ValidationTest.php

    r2082608 r2100367  
    2626        IdToken $idToken,
    2727        array $jwksArray,
    28         string $exceptionMessage
    29     ): void {
    30 
    31         if ($exceptionMessage) {
    32             $this->expectException(InvalidIDTokenException::class);
    33             $this->expectExceptionMessage($exceptionMessage);
    34         } else {
    35             $this->expectNotToPerformAssertions();
     28        string $expectedErrorMsg,
     29        string $expectedExceptionType
     30    ) {
     31        $thrownExceptionMsg  = '';
     32        $thrownExceptionType = '';
     33
     34        try {
     35            $validation = new Validation();
     36            $validation->validateIdTokenSignature(
     37                $usedKey,
     38                $algorithm,
     39                $idToken,
     40                $jwksArray
     41            );
     42        } catch (Exception $e) {
     43            $thrownExceptionMsg  = $e->getMessage();
     44            $thrownExceptionType = get_class($e);
    3645        }
    37 
    38         $validation = new Validation();
    39         $validation->validateIdTokenSignature(
    40             $usedKey,
    41             $algorithm,
    42             $idToken,
    43             $jwksArray
    44         );
     46        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     47        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    4548    }
    4649
     
    6164                $idToken,
    6265                $jwks,
     66                '',
    6367                ''
    6468            ],
     
    6872                new IdToken('t.e.s.t'),
    6973                $jwks,
    70                 Validation::INVALID_ID_TOKEN_SIGNATURE_EXCEPTION
     74                Validation::INVALID_ID_TOKEN_SIGNATURE_EXCEPTION,
     75                get_class(new InvalidIDTokenException)
    7176            ],
    7277            [
     
    7580                $idToken,
    7681                $jwks,
    77                 Validation::INVALID_ID_TOKEN_JWS_KEYSET_KEY_NOT_FOUND
     82                Validation::INVALID_ID_TOKEN_JWS_KEYSET_KEY_NOT_FOUND,
     83                get_class(new InvalidIDTokenException)
    7884            ],
    7985            [
     
    8288                $idToken,
    8389                $jwks,
    84                 sprintf(Validation::INVALID_ID_TOKEN_ALGORITHM_EXCEPTION, 'wrong-algo')
     90                sprintf(Validation::INVALID_ID_TOKEN_ALGORITHM_EXCEPTION, 'wrong-algo'),
     91                get_class(new InvalidIDTokenException)
    8592            ]
    8693        ];
     
    103110        string $deliveredIssuer,
    104111        bool $exactMatch,
    105         bool $throwsException
    106     ): void {
    107 
    108         if ($throwsException) {
    109             $this->expectException(InvalidAuthorityIssuerException::class);
    110             $this->expectExceptionMessage(Validation::INVALID_ID_TOKEN_ISSUER_EXCEPTION);
    111         } else {
    112             $this->expectNotToPerformAssertions();
     112        string $expectedErrorMsg,
     113        string $expectedExceptionType
     114    ) {
     115        $thrownExceptionMsg  = '';
     116        $thrownExceptionType = '';
     117
     118        try {
     119            $validation = new Validation();
     120            $validation->validateISS(
     121                $originIssuer,
     122                $deliveredIssuer,
     123                $exactMatch
     124            );
     125        } catch (Exception $e) {
     126            $thrownExceptionMsg  = $e->getMessage();
     127            $thrownExceptionType = get_class($e);
    113128        }
    114 
    115         $validation = new Validation();
    116         $validation->validateISS(
    117             $originIssuer,
    118             $deliveredIssuer,
    119             $exactMatch
    120         );
     129        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     130        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    121131    }
    122132
     
    133143                'https://id.test.denic.de',
    134144                true,
    135                 false
     145                '',
     146                ''
    136147            ],
    137148            [
     
    139150                'https://id.test.denic.de',
    140151                false,
    141                 false
     152                '',
     153                ''
    142154            ],
    143155            [
     
    145157                'id.test.denic.de',
    146158                true,
    147                 true
     159                Validation::INVALID_ID_TOKEN_ISSUER_EXCEPTION,
     160                get_class(new InvalidAuthorityIssuerException)
    148161            ],
    149162            [
     
    151164                'https://id.test.denic.com',
    152165                true,
    153                 true
     166                Validation::INVALID_ID_TOKEN_ISSUER_EXCEPTION,
     167                get_class(new InvalidAuthorityIssuerException)
    154168            ]
    155169        ];
     
    172186        string $authorizedParty,
    173187        string $clientId,
    174         bool $throwsException
    175     ): void {
    176 
    177         if ($throwsException) {
    178             $this->expectException(InvalidIDTokenException::class);
    179             $this->expectExceptionMessage(Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION);
    180         } else {
    181             $this->expectNotToPerformAssertions();
     188        string $expectedErrorMsg,
     189        string $expectedExceptionType
     190    ) {
     191        $thrownExceptionMsg  = '';
     192        $thrownExceptionType = '';
     193        try {
     194            $validation = new Validation();
     195            $validation->validateAudience(
     196                $audience,
     197                $authorizedParty,
     198                $clientId
     199            );
     200        } catch (Exception $e) {
     201            $thrownExceptionMsg  = $e->getMessage();
     202            $thrownExceptionType = get_class($e);
    182203        }
    183 
    184         $validation = new Validation();
    185         $validation->validateAudience(
    186             $audience,
    187             $authorizedParty,
    188             $clientId
    189         );
     204        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     205        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    190206    }
    191207
     
    202218                '',
    203219                '7ftj6vw545suk',
    204                 false
    205             ],
    206             [
    207                 '7ftj6vw545suk',
    208                 '7ftj6vw545suk',
    209                 '7ftj6vw545suk',
    210                 false
     220                '',
     221                ''
     222            ],
     223            [
     224                '7ftj6vw545suk',
     225                '7ftj6vw545suk',
     226                '7ftj6vw545suk',
     227                '',
     228                ''
    211229            ],
    212230            [
     
    214232                '',
    215233                'wrong-client-id',
    216                 true
     234                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     235                get_class(new InvalidIDTokenException)
    217236            ],
    218237            [
     
    220239                '7ftj6vw545suk',
    221240                '7ftj6vw545suk',
    222                 false
     241                '',
     242                ''
    223243            ],
    224244            [
     
    226246                '',
    227247                '7ftj6vw545suk',
    228                 true
    229             ],
    230             [
    231                 '',
    232                 '7ftj6vw545suk',
    233                 '7ftj6vw545suk',
    234                 true
     248                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     249                get_class(new InvalidIDTokenException)
     250            ],
     251            [
     252                '',
     253                '7ftj6vw545suk',
     254                '7ftj6vw545suk',
     255                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     256                get_class(new InvalidIDTokenException)
    235257            ],
    236258            [
     
    238260                'vwsvw5',
    239261                '7ftj6vw545suk',
    240                 true
     262                Validation::INVALID_ID_TOKEN_AUDIENCE_EXCEPTION,
     263                get_class(new InvalidIDTokenException)
    241264            ]
    242265        ];
     
    255278    public function testValidateIDTokenExpirationTime(
    256279        string $expirationTime,
    257         bool $throwsException
    258     ): void {
    259 
    260         if ($throwsException) {
    261             $this->expectException(InvalidIDTokenException::class);
    262             $this->expectExceptionMessage(Validation::INVALID_ID_TOKEN_EXPIRATION_TIME_EXCEPTION);
    263         } else {
    264             $this->expectNotToPerformAssertions();
     280        string $expectedErrorMsg,
     281        string $expectedExceptionType
     282    ) {
     283        $thrownExceptionMsg  = '';
     284        $thrownExceptionType = '';
     285        try {
     286            $validation = new Validation();
     287            $validation->validateExpirationTime(
     288                $expirationTime
     289            );
     290        } catch (Exception $e) {
     291            $thrownExceptionMsg  = $e->getMessage();
     292            $thrownExceptionType = get_class($e);
    265293        }
    266 
    267         $validation = new Validation();
    268         $validation->validateExpirationTime($expirationTime);
     294        $this->assertEquals($thrownExceptionMsg, $expectedErrorMsg);
     295        $this->assertEquals($thrownExceptionType, $expectedExceptionType);
    269296    }
    270297
     
    279306            [
    280307                (string) mktime(10, 30, 30, 1, 1, 2050),
    281                 false
    282             ],
    283             [
    284                 '',
    285                 true
     308                '',
     309                ''
     310            ],
     311            [
     312                '',
     313                Validation::INVALID_ID_TOKEN_EXPIRATION_TIME_EXCEPTION,
     314                get_class(new InvalidIDTokenException)
     315
    286316            ],
    287317            [
    288318                (string) mktime(10, 30, 30, 1, 1, 1950),
    289                 true
     319                Validation::INVALID_ID_TOKEN_EXPIRATION_TIME_EXCEPTION,
     320                get_class(new InvalidIDTokenException)
    290321            ]
    291322        ];
     
    323354
    324355        // Header data value test
    325         $this->assertIsArray($idToken->getDecodedHeader());
     356        $this->assertTrue(is_array($idToken->getDecodedHeader()));
    326357        $this->assertSame(
    327358            $idToken->getDecodedHeader(),
     
    333364
    334365        // Body data value test
    335         $this->assertIsArray($idToken->getDecodedBody());
     366        $this->assertTrue(is_array($idToken->getDecodedBody()));
    336367        $this->assertSame(
    337368            $idToken->getDecodedBody(),
Note: See TracChangeset for help on using the changeset viewer.