A library for webauthn credential authentication. The library is under development.
The project consists of several subfolders located in the crates
directory:
- account_sdk - a rust project to export and test functions for interacting with the custom account contract.
- cartidge_account - a cairo project with a custom account contract.
- test_gen_scripts - a python library to programatically generate cryptographic cairo tests.
- webauthn - cairo components to use in contracts.
The project has a global rust workspace.
This is a rust project, that will eventually be compiled to wasm. It's purpose is to export and test functions for interacting with the custom account contract. The testing framework implemented within uses dojo/katana underneath. Each test starts its own katana network, deploys a contract and performs operations on it. Naturally, you must have katana
installed to run the tests. You can specify the path to the katana
executable in the account_sdk/KatanaConfig.toml
file. Note that if you have dojo
installed and in PATH
the path can remain simply as katana
.
To run the tests you first have to compile (to sierra and casm) the contract in the cartidge_account
folder:
make
StarkNet Foundry tests:
snforge test -p cartridge_account
Scarb tests:
scarb test -p webauthn_*
After the contract is compiled run the tests using cargo
:
cargo test
The scarb builds the contract and saves the compiled code in the cartridge_account/target
folder. The tests then fetch (at compile time) the comipled code and deploy it to the local network. Note that obviously the contract needs to be recompiled for any changes to be applied in the compiled code.
This is a cairo project with backend methods that will allow for various authentication methods in the custom contact. Written based on this specification.
Some of the tests are auto-generated using python scripts.
See the test_gen_scripts
for details.
The tests in src/tests/
which end in _gen_test.cairo
are auto-generated and might be changed by the python script. You can write your tests manually, but make sure the name of the test file doesn't end in _gen_test.cairo
, and you place the import "use ...;
" below the auto-generated imports in src/tests.cairo
.
To run the tests:
scarb test
To again generate the tests:
python test_gen_scripts/main.py
This is a python library to programatically generate cryptographic cairo tests.
Use pyenv to have specific version of python easily. We use python3.9
pip install -r requirements.txt
python test_gen_scripts/main.py