feature/migrate models (#16)

* feat: add new supported attestation formats to genesis

* feat: refactor keyType to keytype enum

* refactor: remove unused imports and code

* refactor: update main.go to use src package

* refactor: move web-related structs from  to

* refactor: move client middleware package to root

* refactor: remove unused IndexedDB dependency

* feat: update worker implementation to use

* feat: add Caddyfile and Caddy configuration for vault service

* refactor(config): move keyshare and address to Motr config

* fix: validate service origin in AllocateVault

* chore: remove IndexedDB configuration

* feat: add support for IPNS-based vault access
This commit is contained in:
Prad Nukala
2024-09-19 02:04:22 -04:00
committed by GitHub
parent 6d8bd8fc85
commit 96e6486c43
151 changed files with 10997 additions and 21705 deletions
+60 -4
View File
@@ -1,6 +1,6 @@
@go.Package { name = "github.com/onsonr/sonr/internal/vfs/models" }
@go.Package { name = "github.com/onsonr/sonr/internal/orm" }
module models
module orm
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
@@ -15,7 +15,6 @@ typealias ChainCode = UInt
typealias Scope = String
typealias Hex = String
typealias UTF8 = String
class PrimaryKey extends go.Field {
structTags {
@@ -30,6 +29,28 @@ class JsonField extends go.Field {
}
}
// Enums
typealias AssetType = "native"|"wrapped"|"staking"|"pool"|"ibc"|"cw20"
typealias DIDMethod = "ipfs"|"sonr"|"bitcoin"|"ethereum"|"ibc"|"webauthn"|"dwn"|"service"
typealias KeyAlgorithm = "es256"|"es384"|"es512"|"eddsa"|"es256k"|"ecdsa"
typealias KeyCurve = "p256"|"p384"|"p521"|"x25519"|"x448"|"ed25519"|"ed448"|"secp256k1"|"bls12381"|"keccak256"
typealias KeyEncoding = "raw"|"hex"|"multibase"
typealias KeyRole = "authentication"|"assertion"|"delegation"|"invocation"
typealias KeyType = "octet"|"elliptic"|"rsa"|"symmetric"|"hmac"|"mpc"|"zk"|"webauthn"|"bip32"
typealias KeyShareRole = "user"|"validator"
typealias PermissionGrant = "none"|"read"|"write"|"verify"|"broadcast"|"admin"
typealias PermissionScope = "profile"|"metadata"|"permissions"|"wallets"|"transactions"|"user"|"validator"
class Account {
@PrimaryKey
id: DID
@@ -109,6 +130,12 @@ class Credential {
@JsonField
origin: String
@JsonField
label: String?
@JsonField
deviceId: String?
@JsonField
credentialId: Base64
@@ -143,6 +170,26 @@ class Credential {
updatedAt: String?
}
class JWK {
@JsonField
kty: String
@JsonField
crv: String
@JsonField
x: String
@JsonField
y: String
@JsonField
n: String
@JsonField
e: String
}
class Grant {
@PrimaryKey
id: UInt
@@ -188,7 +235,13 @@ class Keyshare {
class PublicKey {
@PrimaryKey
id: DID
role: KeyRole
algorithm: KeyAlgorithm
encoding: KeyEncoding
curve: KeyCurve
key_type: KeyType
raw: Base58
jwk: JWK
}
class Profile {
@@ -218,3 +271,6 @@ class Profile {
}
db_name: String = "vault"
db_version: Int = 1