PHP Class Trianglman\Sqrl\Tests\SqrlRequestHandlerTest

Author: johnj
Inheritance: extends PHPUnit_Framework_TestCase
Afficher le fichier Open project: trianglman/sqrl

Protected Properties

Свойство Type Description
$config mock Mocked version of \Trianglman\Sqrl\SqrlConfiguration
$generator mock Mocked version of \Trianglman\Sqrl\SqrlGenerate
$handler Trianglman\Sqrl\SqrlRequestHandler The object being tested
$storage mock Mocked version of \Trianglman\Sqrl\SqrlStoreInterface
$validator mock Mocked version of \Trianglman\Sqrl\SqrlValidate

Méthodes publiques

Méthode Description
setup ( )
testHandlesIncompleteRequest ( ) Tests that the server responds with a client failure flag if the client fails to send all the information needed to make a basic request.
testHandlesRequestWhereServerValueDoesntValidate ( ) Tests that the server responds with a client failure flag if the client sends a server value that doesn't match what the server sent
testHandlesRequestWithInvalidClient ( ) Tests that the server responds with a client failure flag if the client fails to send all the information needed to make a basic request.
testHandlesRequestWithInvalidIDS ( ) Tests that the server responds with a client failure flag if the client sends an invalid IDS signature
testHandlesRequestWithInvalidPIDS ( ) Tests that the server responds with a client failure flag if the client sends an invalid pIDS signature
testHandlesRequestWithInvalidURS ( ) Tests that the server responds with a client failure flag if the client sends an invalid URS signature
testHandlesRequestWithInvalidURSDuringIDUpdate ( ) Tests that the server responds with a client failure flag if the client sends an invalid URS signature
testRespondsToIdent ( ) tests the server responding to a cmd=ident with a known idk
testRespondsToIdentDuringIdentityUpdate ( ) tests the server responding to a cmd=setkey when the user is supplying a pidk in order to update their account.
testRespondsToIdentDuringIdentityUpdateMissingNewSUK ( )
testRespondsToIdentIncompleteAccountInformation ( ) Test that the server returns a failure when the user attempts to create an account without all required information (suk and vuk)
testRespondsToIdentNoUnknownAccountAllowed ( ) Test the server will respond with a function not supported error if the user attempts to create an account when it is not allowed.
testRespondsToIdentWhenCreatingAccount ( ) tests the server responding to a cmd=ident with an unknown idk
testRespondsToLock ( ) tests the server responding to a cmd=lock
testRespondsToLockUnknownAccount ( ) tests the server responding to a cmd=lock when the account doesn't exist
testRespondsToQueryBadNutHardFailure ( ) tests the server responding to a cmd=query when the nut has expired, is unknown, or in some other way is invalid, causing a hard failure
testRespondsToQueryDuringIdentityUpdate ( ) tests the server responding to a cmd=query when the user is supplying a pidk in order to update their account.
testRespondsToQueryExpiredNutSoftFailure ( ) tests the server responding to a cmd=query when the nut has expired
testRespondsToQueryKnownIdentityKey ( ) tests the server responding to a cmd=query when the idk is known
testRespondsToQueryKnownIdentityKeyIPMismatch ( ) tests the server responding to a cmd=query when the idk is known and the IPs do not match
testRespondsToQueryNutKeyMismatch ( ) tests the server responding to a cmd=query when the nut has expired, is unknown, or in some other way is invalid, causing a hard failure
testRespondsToQueryUnknownIdentityKeyAuthenticationProceeds ( ) tests the server responding to a cmd=query with the idk is not known
testRespondsToQueryUnknownIdentityKeyHardFailure ( ) tests the server responding to a cmd=query with the idk is not known
testRespondsToQueryWhenAccountLocked ( ) tests the server responding to a cmd=query when the account has previously been locked
testRespondsToUnlockRequest ( ) tests the server responding to a cmd=ident when the account has previously been locked when the user is supplying the Identity Lock credentials
testRespondsToUnlockRequestMismathedVUK ( )

Méthodes protégées

Méthode Description
base64UrlEncode ( $string )

Method Details

base64UrlEncode() protected méthode

protected base64UrlEncode ( $string )

setup() public méthode

public setup ( )

testHandlesIncompleteRequest() public méthode

Tests that the server responds with a client failure flag if the client fails to send all the information needed to make a basic request.

testHandlesRequestWhereServerValueDoesntValidate() public méthode

Tests that the server responds with a client failure flag if the client sends a server value that doesn't match what the server sent

testHandlesRequestWithInvalidClient() public méthode

Tests that the server responds with a client failure flag if the client fails to send all the information needed to make a basic request.

testHandlesRequestWithInvalidIDS() public méthode

Tests that the server responds with a client failure flag if the client sends an invalid IDS signature

testHandlesRequestWithInvalidPIDS() public méthode

Tests that the server responds with a client failure flag if the client sends an invalid pIDS signature

testHandlesRequestWithInvalidURS() public méthode

Tests that the server responds with a client failure flag if the client sends an invalid URS signature

testHandlesRequestWithInvalidURSDuringIDUpdate() public méthode

Tests that the server responds with a client failure flag if the client sends an invalid URS signature

testRespondsToIdent() public méthode

this should connect the session with the identity key, authorizing the transaction (log-in, purchase authentication, etc.)
public testRespondsToIdent ( )

testRespondsToIdentDuringIdentityUpdate() public méthode

This should cause the server to replace the previous idk with the newly supplied idk

testRespondsToIdentDuringIdentityUpdateMissingNewSUK() public méthode

testRespondsToIdentIncompleteAccountInformation() public méthode

Test that the server returns a failure when the user attempts to create an account without all required information (suk and vuk)

testRespondsToIdentNoUnknownAccountAllowed() public méthode

Test the server will respond with a function not supported error if the user attempts to create an account when it is not allowed.

testRespondsToIdentWhenCreatingAccount() public méthode

this should connect the session with the identity key, authorizing the transaction (generally a log in or account creation/association) and that the suk and vuk have been stored

testRespondsToLock() public méthode

this will lock the user's identity key against further authentication
public testRespondsToLock ( )

testRespondsToLockUnknownAccount() public méthode

tests the server responding to a cmd=lock when the account doesn't exist

testRespondsToQueryBadNutHardFailure() public méthode

this will end the authentication transaction

testRespondsToQueryDuringIdentityUpdate() public méthode

This should return the user's suk value in order to do the full identity unlock process and update the records

testRespondsToQueryExpiredNutSoftFailure() public méthode

this should cause the client to sign the response with a new query in order to continue authentication

testRespondsToQueryKnownIdentityKey() public méthode

this will generally be the first step of most authentication, so the server value will be the (s)qrl:// URL

testRespondsToQueryKnownIdentityKeyIPMismatch() public méthode

this will be both a MITM check and a common case when using a separate device to authenticate so no temporary or permantent failure should be returned

testRespondsToQueryNutKeyMismatch() public méthode

this will end the authentication transaction

testRespondsToQueryUnknownIdentityKeyAuthenticationProceeds() public méthode

this is in the instance where the server will allow the authentication to proceed generally this will be on a create account or associate account with SQRL page

testRespondsToQueryUnknownIdentityKeyHardFailure() public méthode

this is in the instance where the server does not allow previously unknown identities to authenticate to the server

testRespondsToQueryWhenAccountLocked() public méthode

this should return the suk value previously supplied by the user in order for the client to complete the identity unlock process

testRespondsToUnlockRequest() public méthode

this will validate both the identity and the vuk/urs process was completed then unlock the idk for future authentication

testRespondsToUnlockRequestMismathedVUK() public méthode

Property Details

$config protected_oe property

Mocked version of \Trianglman\Sqrl\SqrlConfiguration
protected mock $config
Résultat mock

$generator protected_oe property

Mocked version of \Trianglman\Sqrl\SqrlGenerate
protected mock $generator
Résultat mock

$handler protected_oe property

The object being tested
protected SqrlRequestHandler,Trianglman\SQRL $handler
Résultat Trianglman\Sqrl\SqrlRequestHandler

$storage protected_oe property

Mocked version of \Trianglman\Sqrl\SqrlStoreInterface
protected mock $storage
Résultat mock

$validator protected_oe property

Mocked version of \Trianglman\Sqrl\SqrlValidate
protected mock $validator
Résultat mock