SiweAuthTests
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
Name | Type | Description |
---|---|---|
token | bytes | The authentication token to extract the statement from |
Returns
Name | Type | Description |
---|---|---|
<none> | string | The 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
Name | Type | Description |
---|---|---|
token | bytes | The authentication token to extract resources from |
Returns
Name | Type | Description |
---|---|---|
<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
Name | Type | Description |
---|---|---|
token | bytes | The authentication token |
expectedStatement | string | The statement that is expected in the token |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | A 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
Name | Type | Description |
---|---|---|
token | bytes | The authentication token to check |
resource | string | The resource URI to check access for |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the token grants access to the specified resource |
doNothing
function doNothing() external;