Skip to content

Commit

Permalink
Pallet Pass (#22)
Browse files Browse the repository at this point in the history
* feat: template for `pallet-pass`

* change: register pallet-pass

* change(fc-pallet-pass): add storage for Accounts

* change(fc-pallet-pass): success -> register

* feat(fc-pallet-pass): register

* change(pallet-pass): initialize `claim` process.

* change(fc-pallet-pass):

- Limit devices per account
- Handle unreservation of uninitialized accounts
- Handle challenges using Randomness

* Checkpoint. Starting testing.

* feat: add initial tests for claim() call

* feat: first version of claim call
fix: typo in RandomnessFromBlockNumber (added missing `n`)

* change(fc-pallet-pass): implement Registrar for tuples

* fix(fc-pallet-pass): several typing issues

* fix(fc-pallet-pass): several typing issues

* fix(fc-pallet-pass): correctly initialize account

* todo(fc-pallet-pass): first registrars macro commit with issues for review.

* change(pallet-pass): implement Registrar trait as tuple / try claiming on each registrar

* change(fc-pallet-pass): move traits over to fc-traits-authn

* change(fc-pallet-pass): add palletid as random subject

* authenticate and add devices logic, pending to discuss with Pablo

* Fixed compiling issues, working test not working for authenticate. To check

* todo(todo): promised pr

* test(fc-pallet-pass): fixed dispatch call/test to initial working state

* Revert "[Pass] Implement `dispatch` call"

* test(broken branch)

* Authenticate, pending tests

* Solving brackets issue

* fix(fc-pallet-pass): Added missing import that somehow got lost in version control.

* fix(fc-pallet-pass): Added missing import for dispatch that somehow got lost in version control. (#19)

* First draft of authenticate call

* Improved code using randomness instead of blocknumber in a manual way. Removed unnecesary comments. Escaped not used variables with _

* change(pallet-pass): cleanup code / remove duplicated codebase

* change(fc-pallet-pass): tests for `add_device`

* change(fc-pallet-pass): refine logic to enforce account initialization

* fix(fc-pallet-pass): ensure sessions are created to last between given (if any) duration, and up to MaxSessionDuration

* fix(fc-traits-memberships): missing feature runtime-benchmarks in cargo manifest

* Remove Registar abstraction

* Add Authentication method with Authenticator abstraction + several pallet simplifications

* feat: add github ci workflows

* wip(fc-pallet-pass): handle authenticators as instances

* WIP

* change(fc-traits-authn): make compiler/linter happy

* change(fc-traits-authn): remove redundant type

* feat(fc-traits-authn): proc macro for composite authenticators

* fix(fc-pallet-pass): fix compiler issues in pallet + refactor duplicated code

* fix(fc-pallet-pass): revive tests

* feat(fc-pallet-pass): first benchmark

* change(fc-traits-authn): adjust `composite_authenticators` to make more generalistic usage / adjust interface of creation of a composite authenticator to explicitly state the `Authority`.

* change(fc-pallet-pass): adjust mock to changes in `composite_authenticators` / cover macro use cases.

* change(fc-pallet-pass): fail `register` early if the account is already registered.

* change(fc-pallet-pass): add `fail_with_credentials_if_credential_invalid` test case

* wip(fc-pallet-pass): charge register deposit

* feat(fc-pallet-pass): register deposit logic

* change(fc-pallet-pass): remove commented-out authenticators we didn't use.

* change: make clippy happy

---------

Co-authored-by: Daniel Olano <[email protected]>
Co-authored-by: Juan Pablo Gutiérrez Restrepo <[email protected]>
Co-authored-by: Johan Alexis Duque Cadena <[email protected]>
Co-authored-by: Daniel Olano <[email protected]>
  • Loading branch information
5 people authored Oct 7, 2024
1 parent dae50bf commit 24a0a44
Show file tree
Hide file tree
Showing 28 changed files with 3,062 additions and 433 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Lint, check, clippy and test

on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check formatting
run: cargo fmt --all -- --check

check:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/[email protected]
with:
cache-on-failure: true
cache-all-crates: true
key: check

- name: Check Build
run: |
cargo check --release --locked --all-features --workspace
clippy:
needs: lint
runs-on: ubuntu-latest
permissions:
checks: write
env:
SKIP_WASM_BUILD: 1
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/[email protected]
with:
cache-on-failure: true
cache-all-crates: true
key: check

- name: Annotate with Clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --release --locked --all-features --workspace

test:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/[email protected]
with:
cache-on-failure: true
cache-all-crates: true
key: test

- name: Run tests
run: cargo test --release --locked --all-features --workspace
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
lint:
name: Validate PR title for conventional commit compliance
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ target/

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
.vscode
Loading

0 comments on commit 24a0a44

Please sign in to comment.