SiweAuthTests

Git Source

Inherits: SiweAuth

State Variables

_owner

address private _owner;

Functions

constructor

constructor(string memory domain) SiweAuth(domain);

setDomain

function setDomain(string memory inDomain) external;

testVerySecretMessage

function testVerySecretMessage(bytes calldata token) external view returns (string memory);

testLogin

function testLogin(string calldata message, SignatureRSV calldata sig) external view returns (bytes memory);

testAuthMsgSender

function testAuthMsgSender(bytes calldata token) external view returns (address);

testRevokeAuthToken

function testRevokeAuthToken(bytes32 token) external;

testGetStatement

Test function to retrieve the statement from a token

function testGetStatement(bytes calldata token) external view returns (string memory);

Parameters

NameTypeDescription
tokenbytesThe authentication token to extract the statement from

Returns

NameTypeDescription
<none>stringThe statement string from the SIWE message

testGetResources

Test function to retrieve all resources from a token

function testGetResources(bytes calldata token) external view returns (string[] memory);

Parameters

NameTypeDescription
tokenbytesThe authentication token to extract resources from

Returns

NameTypeDescription
<none>string[]Array of resource URIs the token grants access to

testStatementVerification

Test function that requires a specific statement

function testStatementVerification(bytes calldata token, string calldata expectedStatement)
    external
    view
    returns (bool);

Parameters

NameTypeDescription
tokenbytesThe authentication token
expectedStatementstringThe statement that is expected in the token

Returns

NameTypeDescription
<none>boolA success message if the statement matches

testHasResourceAccess

Test function to check if a token grants access to a specific resource

function testHasResourceAccess(bytes calldata token, string calldata resource) external view returns (bool);

Parameters

NameTypeDescription
tokenbytesThe authentication token to check
resourcestringThe resource URI to check access for

Returns

NameTypeDescription
<none>boolTrue if the token grants access to the specified resource

doNothing

function doNothing() external;