feature/1115 execute ucan token (#1177)

- **deps: remove tigerbeetle-go dependency**
- **refactor: remove unused landing page components and models**
- **feat: add pin and publish vault handlers**
- **refactor: move payment and credential services to webui browser
package**
- **refactor: remove unused credentials management components**
- **feat: add landing page components and middleware for credentials and
payments**
- **refactor: remove unused imports in vault config**
- **refactor: remove unused bank, DID, and DWN gRPC clients**
- **refactor: rename client files and improve code structure**
- **feat: add session middleware helpers and landing page components**
- **feat: add user profile registration flow**
- **feat: Implement WebAuthn registration flow**
- **feat: add error view for users without WebAuthn devices**
- **chore: update htmx to include extensions**
- **refactor: rename pin handler to claim handler and update routes**
- **chore: update import paths after moving UI components and styles**
- **fix: address potential server errors by handling and logging them
properly**
- **refactor: move vault config to gateway package and update related
dependencies**
- **style: simplify form styling and remove unnecessary components**
- **feat: improve UI design for registration flow**
- **feat: implement passkey-based authentication**
- **refactor: migrate registration forms to use reusable form
components**
- **refactor: remove tailwindcss setup and use CDN instead**
- **style: update submit button style to use outline variant**
- **refactor: refactor server and IPFS client, remove MPC encryption**
- **refactor: Abstract keyshare functionality and improve message
encoding**
- **refactor: improve keyset JSON marshaling and error handling**
- **feat: add support for digital signatures using MPC keys**
- **fix: Refactor MarshalJSON to use standard json.Marshal for Message
serialization**
- **fix: Encode messages before storing in keyshare structs**
- **style: update form input styles for improved user experience**
- **refactor: improve code structure in registration handlers**
- **refactor: consolidate signer middleware and IPFS interaction**
- **refactor: rename MPC signing and refresh protocol functions**
- **refactor: update hway configuration loading mechanism**
- **feat: integrate database support for sessions and users**
- **refactor: remove devnet infrastructure and simplify build process**
- **docs(guides): add Sonr DID module guide**
- **feat: integrate progress bar into registration form**
- **refactor: migrate WebAuthn dependencies to protocol package**
- **feat: enhance user registration with passkey integration and
improved form styling**
- **refactor: move gateway view handlers to internal pages package**
- **refactor: Move address package to MPC module**
- **feat: integrate turnstile for registration**
- **style: remove unnecessary size attribute from buttons**
- **refactor: rename cookie package to session/cookie**
- **refactor: remove unnecessary types.Session dependency**
- **refactor: rename pkg/core to pkg/chain**
- **refactor: simplify deployment process by removing testnet-specific
Taskfile and devbox configuration**
- **feat: add error redirect functionality and improve routes**
- **feat: implement custom error handling for gateway**
- **chore: update version number to 0.0.7 in template**
- **feat: add IPFS client implementation**
- **feat: Implement full IPFS client interface with comprehensive
methods**
- **refactor: improve IPFS client path handling**
- **refactor: Move UCAN middleware to controller package**
- **feat: add UCAN middleware to motr**
- **refactor: update libp2p dependency**
- **docs: add UCAN specification document**
- **refactor: move UCAN controller logic to common package**
- **refactor: rename exports.go to common.go**
- **feat: add UCAN token support**
- **refactor: migrate UCAN token parsing to dedicated package**
- **refactor: improve CometBFT and app config initialization**
- **refactor: improve deployment scripts and documentation**
- **feat: integrate IPFS and producer middleware**
- **refactor: rename agent directory to aider**
- **fix: correct libp2p import path**
- **refactor: remove redundant dependency**
- **cleanup: remove unnecessary test files**
- **refactor: move attention types to crypto/ucan package**
- **feat: expand capabilities and resource types for UCANs**
- **refactor: rename sonr.go to codec.go and update related imports**
- **feat: add IPFS-based token store**
- **feat: Implement IPFS-based token store with caching and UCAN
integration**
- **feat: Add dynamic attenuation constructor for UCAN presets**
- **fix: Handle missing or invalid attenuation data with
EmptyAttenuation**
- **fix: Update UCAN attenuation tests with correct capability types**
- **feat: integrate UCAN-based authorization into the producer
middleware**
- **refactor: remove unused dependency on go-ucan**
- **refactor: Move address handling logic to DID module**
- **feat: Add support for compressed and uncompressed Secp256k1 public
keys in didkey**
- **test: Add test for generating DID key from MPC keyshares**
- **feat: Add methods for extracting compressed and uncompressed public
keys in share types**
- **feat: Add BaseKeyshare struct with public key conversion methods**
- **refactor: Use compressed and uncompressed public keys in keyshare,
fix public key usage in tests and verification**
- **feat: add support for key generation policy type**
- **fix: correct typo in VaultPermissions constant**
- **refactor: move JWT related code to ucan package**
- **refactor: move UCAN JWT and source code to spec package**
This commit is contained in:
Prad Nukala
2024-12-05 20:36:58 -05:00
committed by GitHub
parent e62ec45e82
commit bd51342fdf
256 changed files with 10823 additions and 7096 deletions
+54 -1
View File
@@ -1,2 +1,55 @@
open module matrix.net.AppService
module matrix.net.AppService
class Config {
/// Unique identifier for the homeserver
id: String
/// Application service token
as_token: String
/// Homeserver token
hs_token: String
/// Namespace configuration for rooms, users, and aliases
namespaces: Namespaces
/// Local part of the sender
sender_localpart: String
/// Bridge URL endpoint
url: String
/// Whether rate limiting is enabled
rate_limited: Boolean
/// MSC2409 push ephemeral setting
deSorunomeMsc2409Push_ephemeral: Boolean
/// Push ephemeral setting
push_ephemeral: Boolean
/// MSC3202 setting
orgMatrixMsc3202: Boolean
}
/// Configuration for Matrix namespaces
class Namespaces {
/// Room namespace configurations
rooms: List<RegexRule> = List()
/// User namespace configurations
users: List<RegexRule>
/// Alias namespace configurations
aliases: List<RegexRule>
}
/// Regex rule configuration for namespaces
class RegexRule {
/// Regular expression pattern
regex: String
/// Whether this rule is exclusive
exclusive: Boolean = false
}
+1 -1
View File
@@ -18,5 +18,5 @@ amends "../basePklProject.pkl"
package {
name = "matrix.net"
version = "0.0.1"
version = "0.0.2"
}
-198
View File
@@ -1,198 +0,0 @@
open module matrix.net.Synapse
version = 2
global = new {
server_name = read("env:MATRIX_SERVER_NAME") ?? ""
private_key = "matrix_key.pem"
old_private_keys = new Listing {}
key_validity_period = "168h0m0s"
}
database = new {
connection_string = read("env:MATRIX_PSQL_CONN") ?? ""
max_open_conns = 90
max_idle_conns = 5
conn_max_lifetime = -1
}
cache = new {
max_size_estimated = "1gb"
max_age = "1h"
}
well_known_server_name = ""
well_known_client_name = read("env:MATRIX_CLIENT_NAME") ?? ""
well_known_sliding_sync_proxy = ""
trusted_third_party_id_servers = new Listing {
"matrix.org"
"vector.im"
}
disable_federation = false
presence = new {
enable_inbound = false
enable_outbound = false
}
report_stats = new {
enabled = false
endpoint = "https://panopticon.matrix.org/push"
}
server_notices = new {
enabled = false
local_part = "_server"
display_name = "Server Alerts"
avatar_url = ""
room_name = "Server Alerts"
}
jetstream = new {
addresses = new Listing {}
disable_tls_validation = false
storage_path = "./"
topic_prefix = "Dendrite"
}
metrics = new {
enabled = false
basic_auth = new {
username = "metrics"
password = "metrics"
}
}
dns_cache = new {
enabled = false
cache_size = 256
cache_lifetime = "5m"
}
app_service_api = new {
disable_tls_validation = false
legacy_auth = false
legacy_paths = false
config_files = new Listing {
"/etc/dendrite/chat-service.yaml"
}
}
client_api = new {
registration_disabled = true
guests_disabled = true
registration_shared_secret = read("env:MATRIX_REGISTRATION_SHARED_SECRET") ?? ""
enable_registration_captcha = (read("env:MATRIX_ENABLE_RECATCHA") ?? "false").toBoolean()
recaptcha_public_key = read("env:MATRIX_RECATCHA_PUBLIC_KEY") ?? ""
recaptcha_private_key = read("env:MATRIX_RECATCHA_PRIVATE_KEY") ?? ""
recaptcha_bypass_secret = read("env:MATRIX_RECATCHA_BYPASS_SECRET") ?? ""
}
turn = new {
turn_user_lifetime = "5m"
turn_uris = new Listing {}
turn_shared_secret = ""
}
rate_limiting = new {
enabled = true
threshold = 20
cooloff_ms = 500
exempt_user_ids = new Listing {}
}
federation_api = new {
send_max_retries = 16
disable_tls_validation = false
disable_http_keepalives = false
key_perspectives = new Listing {
new {
server_name = "matrix.org"
keys = new Listing {
new {
key_id = "ed25519:auto"
public_key = "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
}
new {
key_id = "ed25519:a_RXGa"
public_key = "l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ"
}
}
}
}
prefer_direct_fetch = false
}
media_api = new {
base_path = "./media_store"
max_file_size_bytes = 10485760
dynamic_thumbnails = false
max_thumbnail_generators = 10
thumbnail_sizes = new Listing {
new {
width = 32
height = 32
method = "crop"
}
new {
width = 96
height = 96
method = "crop"
}
new {
width = 640
height = 480
method = "scale"
}
}
}
mscs = new {
mscs = new Listing {}
}
sync_api = new Listing {}
search = new {
enabled = false
index_path = "./searchindex"
language = "en"
}
user_api = new {
bcrypt_cost = 10
auto_join_rooms = new Listing {
// - "#main:matrix.org"
}
}
tracing = new {
enabled = false
jaeger = new {
serviceName = ""
disabled = false
rpc_metrics = false
tags = new Listing {}
sampler = null
reporter = null
headers = null
baggage_restrictions = null
throttler = null
}
}
logging = new Listing {
new {
type = "std"
level = "info"
}
new {
type = "file"
level = "info"
params = new {
path = "./logs"
}
}
}
-35
View File
@@ -1,35 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/pkg/common/types" }
module sonr.hway.Ctx
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
}
}
class Session {
@JsonField
id: String
@JsonField
challenge: String
@JsonField
browserName: String
@JsonField
browserVersion: String
@JsonField
userArchitecture: String
@JsonField
platform: String
@JsonField
platformVersion: String
@JsonField
deviceModel: String
@JsonField
isMobile: Boolean
@JsonField
vaultAddress: String
}
+19
View File
@@ -0,0 +1,19 @@
@go.Package { name = "github.com/onsonr/sonr/pkg/gateway/config" }
open module sonr.hway.Env
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
servePort: Int = 3000
configDir: String = "~/.config/hway"
sqliteFile: String = "hway.db"
chainId: String = "sonr-testnet-1"
ipfsGatewayUrl: String = "http://localhost:8080"
sonrApiUrl: String = "http://localhost:1317"
sonrGrpcUrl: String = "http://localhost:9090"
sonrRpcUrl: String = "http://localhost:26657"
turnstileSiteKey: String = read("env:TURNSTILE_SITE_KEY") ?? ""
-31
View File
@@ -1,31 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/pkg/gateway/types" }
module sonr.hway.Gate
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
}
}
class Config {
@JsonField
chainId: String
@JsonField
ipfsGatewayUrl: String
@JsonField
landingUrl: String
@JsonField
authProxyUrl: String
@JsonField
sonrApiUrl: String
@JsonField
sonrRpcUrl: String
}
+1 -1
View File
@@ -18,5 +18,5 @@ amends "../basePklProject.pkl"
package {
name = "sonr.hway"
version = "0.0.1"
version = "0.0.3"
}
+4 -4
View File
@@ -1,4 +1,4 @@
@go.Package { name = "github.com/onsonr/sonr/x/dwn/types/attns" }
@go.Package { name = "github.com/onsonr/sonr/crypto/ucan/attns" }
module sonr.motr.ATN
@@ -24,10 +24,10 @@ import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
// └─ VAULT
typealias Capability = "CAP_OWNER"|"CAP_OPERATOR"|"CAP_OBSERVER"|"CAP_AUTHENTICATE"|"CAP_AUTHORIZE"|"CAP_DELEGATE"|"CAP_INVOKE"|"CAP_EXECUTE"|"CAP_PROPOSE"|"CAP_SIGN"|"CAP_SET_POLICY"|"CAP_SET_THRESHOLD"|"CAP_RECOVER"|"CAP_SOCIAL"|"CAP_VOTE"
typealias Capability = "CAP_OWNER"|"CAP_OPERATOR"|"CAP_OBSERVER"|"CAP_AUTHENTICATE"|"CAP_AUTHORIZE"|"CAP_DELEGATE"|"CAP_INVOKE"|"CAP_EXECUTE"|"CAP_PROPOSE"|"CAP_SIGN"|"CAP_SET_POLICY"|"CAP_SET_THRESHOLD"|"CAP_RECOVER"|"CAP_SOCIAL"|"CAP_VOTE" | "CAP_RESOLVER" | "CAP_PRODUCER"
typealias ResourceType = "RES_ACCOUNT"|"RES_TRANSACTION"|"RES_POLICY"|"RES_RECOVERY"|"RES_VAULT"
typealias ResourceType = "RES_ACCOUNT"|"RES_TRANSACTION"|"RES_POLICY"|"RES_RECOVERY"|"RES_VAULT" | "RES_IPFS" | "RES_IPNS" | "RES_KEYSHARE"
typealias PolicyType = "POLICY_THRESHOLD"|"POLICY_TIMELOCK"|"POLICY_WHITELIST"
typealias PolicyType = "POLICY_THRESHOLD"|"POLICY_TIMELOCK"|"POLICY_WHITELIST" | "POLICY_KEYGEN"