Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fido connect extension #13

Merged
merged 82 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
3bf36ad
chore/unit-tests-for-assertion-module
kylebeee Apr 8, 2024
ead0b44
chore/unit-tests-for-attestation-module
kylebeee Apr 8, 2024
02d273a
chore/unit-tests-for-auth-module
kylebeee Apr 8, 2024
a73975c
fix for auth service from removal of base64url dependency
kylebeee Apr 8, 2024
5124ba2
- removed unnecessary await (my mistake, got confused when i mocked a
kylebeee Apr 9, 2024
42d9934
- removed extra dummyOptions declaration & removed assertionService mock
kylebeee Apr 9, 2024
cfee1ba
- removed unnecessary mocks
kylebeee Apr 9, 2024
28534b3
- removed unnecessary JSON.stringify from api endpoint handlers
kylebeee Apr 9, 2024
b868528
added auth service mock
kylebeee Apr 9, 2024
04c128e
fixed a typo in imports and another typo in provider list
kylebeee Apr 9, 2024
e88acd1
removed JSON.stringify from expected unit test results
kylebeee Apr 9, 2024
914e9a7
removed JSON.stringify from expect function results for attestation
kylebeee Apr 10, 2024
43401df
removed JSON.stringify from expect assertion controller results
kylebeee Apr 10, 2024
63f5596
fixed a typo in the auth controller spec
kylebeee Apr 10, 2024
de18cc9
final adjustments
kylebeee Apr 10, 2024
460a180
final adjustments, removed await & spread mocks into useValue
kylebeee Apr 10, 2024
b490dc0
final adjustments, spread mocks for useValue
kylebeee Apr 10, 2024
b7d83c7
Revert "final adjustments"
kylebeee Apr 10, 2024
e012ec8
final adjustment, added spread for mocks with useValue
kylebeee Apr 10, 2024
dd4acce
change toThrowError to ToThrow(HttpException)
kylebeee Apr 11, 2024
cfc54d0
switched toThrowError to toThrow(HttpException) & renamed dummyACJSON…
kylebeee Apr 11, 2024
3bed7e6
- changed mock args & responses to more verbose naming
kylebeee Apr 11, 2024
2b12bfa
changed toThrowError to toThrow(HttpException)
kylebeee Apr 11, 2024
27a7140
broke out mock overrides to hooks instead of inside tests
kylebeee Apr 11, 2024
cd8c436
chore: remove custom tweetnacl and resolve tests
PhearZero Apr 12, 2024
f0c2e73
modified organization of unit tests to be clearer about mocks
kylebeee Apr 12, 2024
760e1f2
moved mock overrides into their own beforeEach hook
kylebeee Apr 12, 2024
a64f4f1
wip: liquid fido extension
PhearZero Apr 12, 2024
d3d4606
changed hardcoded buffer to randomBytes
kylebeee Apr 15, 2024
d77ed4e
checking on whether we get proper http exceptions back or one large i…
kylebeee Apr 15, 2024
28e310e
throw http exception if there is one
kylebeee Apr 15, 2024
95836f0
updated request function to use direct http status exception instead …
kylebeee Apr 15, 2024
d1c8d4a
finished changing generic http exceptions
kylebeee Apr 15, 2024
b38c335
switch from generic http exceptions to with status codes
kylebeee Apr 15, 2024
1f2be8e
fixed imports for a few exceptions
kylebeee Apr 15, 2024
d1c16cb
switched from generic http exceptions to explicit types
kylebeee Apr 15, 2024
2ea887d
added a try catch & fixed the expected exception in a unit test
kylebeee Apr 15, 2024
82adce3
fixed one last test & added one more try catch to another method
kylebeee Apr 15, 2024
d61732b
added a try catch to the /all endpoint
kylebeee Apr 15, 2024
2d8bf8f
cleaned up unit tests / exceptions in endpoint & made fixture more in…
kylebeee Apr 15, 2024
a530ed0
Update services/liquid-auth-api-js/tests/constants.ts
kylebeee Apr 16, 2024
04a0a6a
initial astro/starlight setup
kylebeee Apr 17, 2024
fab761e
initial attempt at setting up the liquid auth hero landing
kylebeee Apr 17, 2024
287df39
wrapped up hero section landing aesthetics
kylebeee Apr 18, 2024
c3111fc
docs: add swagger and endpoint documentation
PhearZero Apr 19, 2024
b4cc82d
feat: add js client
PhearZero Apr 19, 2024
10c5984
Merge remote-tracking branch 'refs/remotes/origin/feat/docs-site' int…
PhearZero Apr 19, 2024
5cb35b8
docs: scaffold guides and integrate openapi
PhearZero Apr 19, 2024
cec82e9
build: add docker release
PhearZero Apr 19, 2024
aa4f7a2
docs: update documentation
PhearZero Apr 19, 2024
8878aa0
Merge branch 'refs/heads/feat/connect-rtc' into feat/documentation-sw…
PhearZero Apr 22, 2024
2921b3f
docs: regenerate reference
PhearZero Apr 22, 2024
6ffdf73
Merge branch 'refs/heads/feat/connect-rtc' into feat/fido-connect-ext…
PhearZero Apr 22, 2024
da5f0cc
fix: resolve issues
PhearZero Apr 22, 2024
8e67b70
Merge remote-tracking branch 'refs/remotes/origin/chore/unit-tests-fo…
PhearZero Apr 22, 2024
cdd280b
Merge remote-tracking branch 'refs/remotes/origin/chore/unit-tests-fo…
PhearZero Apr 22, 2024
066bf13
Merge remote-tracking branch 'refs/remotes/origin/chore/unit-tests-fo…
PhearZero Apr 22, 2024
6e2286a
Merge remote-tracking branch 'refs/remotes/origin/chore/testing-clean…
PhearZero Apr 22, 2024
02defc6
Merge branch 'refs/heads/feat/documentation-swagger' into feat/fido-c…
PhearZero Apr 22, 2024
501fb0c
chore: add android client
PhearZero Apr 22, 2024
967e79b
feat: liquid-fido-extension finalized
PhearZero Apr 22, 2024
000bf32
Merge branch 'refs/heads/feat/connect-rtc' into feat/fido-connect-ext…
PhearZero Apr 22, 2024
a94feb8
chore: cleanup logs
PhearZero Apr 22, 2024
471ad46
chore: add address store
PhearZero Apr 22, 2024
e474ad0
chore: remove codegen client
PhearZero Apr 23, 2024
aff9ea5
chore: lint fixes
PhearZero Apr 23, 2024
aef8726
test: fix tests
PhearZero Apr 23, 2024
b2e10be
refactor: remove connect module
PhearZero Apr 24, 2024
977e48f
docs: add decision
PhearZero Apr 24, 2024
9fe39ae
chore: remove kotlin client
PhearZero Apr 24, 2024
863eb1a
build: copy entire service module
PhearZero Apr 24, 2024
b230d00
chore: update readme verbiage
PhearZero Apr 24, 2024
f72255d
test: increase service coverage
PhearZero Apr 25, 2024
00c65f9
test: attestation full coverage
PhearZero Apr 26, 2024
d433b94
chore: fix lint errors
PhearZero Apr 26, 2024
231a706
build: speed up CI with cache
PhearZero Apr 26, 2024
1990e42
test: increase coverage for service
PhearZero Apr 27, 2024
a72d72d
test: increase coverage for auth service
PhearZero Apr 27, 2024
71d200a
test: increase coverage for signal service
PhearZero Apr 27, 2024
868192e
test: remove skipped tests
PhearZero Apr 27, 2024
52783fa
Merge branch 'refs/heads/develop' into feat/fido-connect-extension
PhearZero Apr 29, 2024
2791d87
chore: remove docs for this pr
PhearZero Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .decisions/4-Fido-Extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Overview

Deprecate ARC-31/Arbitrary Auth Message in favor of custom FIDO2 extension

## Decisions

- Remove connect module and endpoints
- Use FIDO2 Attestation/Assertions for device linking

## Implementation

```mermaid
sequenceDiagram
participant Website
participant Server
participant Wallet
Note over Website, Wallet: Link devices
Website->>Server: Subscribe to 'wss:link'
Website-->>Website: Display QR Connect Request ID
Wallet->>Website: Scan QR Code
Server-->>Wallet: Get Challenge/Options
Wallet->>Server: POST FIDO2 Credential + Liquid Auth Signature
Server-->>Server: Validate Signatures
Server-->>Website: HTTPOnly Session
Server->>Wallet: Ok Response + HTTPOnly Session
Server->>Website: Emit to `wss:link` client
Note over Website, Wallet: Signaling Channels
Website-->>Server: Subscribe to 'wss:offer-description'
Website-->>Server: Subscribe to 'wss:offer-candidate'
Wallet-->>Server: Subscribe to 'wss:answer-description'
Wallet-->>Server: Subscribe to 'wss:answer-candidate'

Note over Website, Wallet: Peer Offer
Wallet-->>Wallet: On answer-description, set Remote SDP
Wallet-->>Wallet: On answer-candidate, add ICE Candidate
Wallet-->>Wallet: Create Peer Offer & DataChannel
Wallet-->>Server: Emit `wss:offer-description`
Wallet-->>Server: Emit `wss:offer-candidate`

Note over Website, Wallet: Peer Answer
Website-->>Website: On offer-description, set Remote SDP and create Answer
Website-->>Website: On offer-candidate, add ICE Candidate
Website-->>Server: Emit `wss:answer-description`
Website-->>Server: Emit `wss:answer-candidate`

Note over Website, Wallet: Data Channel
Website-->>Wallet: On DataChannel, Emit Messages

```

*Note: It may be possible to handle signaling in a fully decentralized manner in the future.
2 changes: 2 additions & 0 deletions .decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

- [1. Service Authentication](1-Service-Authentication.md)
- [2. Bidirectional-Communications](2-Bidirectional-Communication.md)
- [3. Peer-to-Peer-Signaling](3-Peer-to-Peer-Signaling.md)
- [4. Fido-Extension](4-Fido-Extension.md)
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
android
clients/liquid-auth-client-kt
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install Dependencies
run: npm install
- name: Run Build
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# See: https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
name: Docker Image CI

on:
push:
branches: ["main", "develop"]
tags:
- "v*.*.*"
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- # Checkout the repo
name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- # This can be Docker Hub, ECR, or any other registry. Using GHCR for now.
name: Container Registry Login
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- # Tag and name the image
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- # Build and push
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha
21 changes: 19 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Project Files
docker-compose.override.yml
swagger-codegen-cli.jar
ngrok.yml

.data
.idea

# Kotlin
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

# Logs
logs
Expand Down
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ COPY --from=BUILDER ./package-lock.json ./package-lock.json
# Client Files
COPY --from=BUILDER ./clients ./clients
# Service Files
COPY --from=BUILDER ./services/liquid-auth-api-js/assetlinks.json ./services/liquid-auth-api-js/assetlinks.json
COPY --from=BUILDER ./services/liquid-auth-api-js/dist ./services/liquid-auth-api-js/dist
COPY --from=BUILDER ./services/liquid-auth-api-js/bin ./services/liquid-auth-api-js/bin
COPY --from=BUILDER ./services/liquid-auth-api-js/.env.template ./services/liquid-auth-api-js/.env.template
COPY --from=BUILDER ./services/liquid-auth-api-js/package.json ./services/liquid-auth-api-js/package.json
COPY --from=BUILDER ./services/liquid-auth-api-js/ ./services/liquid-auth-api-js/

RUN npm ci --production

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

# Overview

This project holds the standard FIDO2 api endpoints and the Proof of Knowledge for Algorand specific private keys.
The api is a stateful session-based architecture with endpoint guards.
This project holds the standard FIDO2 api endpoints and the Proof of Knowledge for Algorand specific private keys.
The api is a stateful session-based architecture with endpoint guards.
A user must prove ownership of a private key to associate PublicKeyCredentials

## Getting started
Expand Down Expand Up @@ -64,6 +64,8 @@ tunnels:

#### Update the Service's .docker.env file

Update the [.docekr.env](.env.docker) file with the following keys with the values from ngrok:

```bash
HOSTNAME=<NGROK_STATIC_DOMAIN>
ORIGIN=https://<NGROK_STATIC_DOMAIN>
Expand All @@ -82,7 +84,7 @@ Navigate to the ngrok URL in your browser to test the FIDO2 feature.

## Using the app

#### Install the [Android client](https://github.com/awesome-algorand/android-authentication-client) to your device.
#### Install the [Android client](https://github.com/awesome-algorand/android-authentication-client/releases) to your device.

![Step-1.png](.docs%2FStep-1.png)

Expand Down
12 changes: 0 additions & 12 deletions client-gen.sh

This file was deleted.

8 changes: 7 additions & 1 deletion clients/liquid-auth-client-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,36 @@
"scripts": {
"dev": "tsc --watch",
"build": "tsc",
"build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src",
"build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src src/client",
HashMapsData2Value marked this conversation as resolved.
Show resolved Hide resolved
"lint": "eslint --fix src",
"test:ts": "node --import tsx --test ./src/client/*.spec.ts",
HashMapsData2Value marked this conversation as resolved.
Show resolved Hide resolved
"test": "tsc && node --test ./tests/*.spec.js",
"test:cov": "tsc && c8 node --test ./tests/*.spec.js"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@swc/register": "^0.1.10",
"@types/chai": "^4.3.14",
"@types/qrcode": "^1.5.5",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^7.6.0",
"algosdk": "^2.7.0",
"c8": "^9.1.0",
"chai": "^5.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-tsdoc": "^0.2.17",
"tsx": "^4.7.2",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.0-next.55",
"typescript": "^5.4.5"
},
"dependencies": {
"@liquid/core": "^1.0.0",
"eventemitter3": "^5.0.1",
"isomorphic-fetch": "^3.0.0",
"qr-code-styling": "^1.6.0-rc.1",
"tweetnacl": "^1.0.3"
}
Expand Down
Loading
Loading