feature/dwn sw js (#1103)

- **feat(macaroon): add  and  to macaroon genesis**
- **refactor: move schema definitions to dedicated file**
- **feat: remove Session model**
- **refactor: move session middleware to internal package**
This commit is contained in:
Prad Nukala
2024-10-02 01:40:49 -04:00
committed by GitHub
parent d62fb30eb8
commit edb109b542
55 changed files with 2472 additions and 543 deletions
-26
View File
@@ -1,26 +0,0 @@
// Code generated from Pkl module `orm`. DO NOT EDIT.
package orm
import (
"github.com/onsonr/sonr/pkg/orm/keyalgorithm"
"github.com/onsonr/sonr/pkg/orm/keycurve"
"github.com/onsonr/sonr/pkg/orm/keyencoding"
"github.com/onsonr/sonr/pkg/orm/keyrole"
"github.com/onsonr/sonr/pkg/orm/keytype"
)
type PublicKey struct {
Role keyrole.KeyRole `pkl:"role" json:"role,omitempty" query:"role"`
Algorithm keyalgorithm.KeyAlgorithm `pkl:"algorithm"`
Encoding keyencoding.KeyEncoding `pkl:"encoding"`
Curve keycurve.KeyCurve `pkl:"curve"`
KeyType keytype.KeyType `pkl:"key_type"`
Raw string `pkl:"raw"`
Jwk *JWK `pkl:"jwk"`
}
-16
View File
@@ -1,16 +0,0 @@
// Code generated from Pkl module `orm`. DO NOT EDIT.
package orm
type Session struct {
Id string `pkl:"id" json:"id,omitempty" query:"id"`
Subject string `pkl:"subject" json:"subject,omitempty"`
Controller string `pkl:"controller" json:"controller,omitempty"`
Origin string `pkl:"origin" json:"origin,omitempty"`
CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty"`
UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty"`
}
-1
View File
@@ -14,5 +14,4 @@ func init() {
pkl.RegisterMapping("orm#Grant", Grant{})
pkl.RegisterMapping("orm#Keyshare", Keyshare{})
pkl.RegisterMapping("orm#Profile", Profile{})
pkl.RegisterMapping("orm#Session", Session{})
}
+38
View File
@@ -1 +1,39 @@
package orm
const SCHEMA_VERSION = 1
func AccountSchema() string {
return "++, id, name, address, publicKey, chainCode, index, controller, createdAt"
}
func AssetSchema() string {
return "++, id, name, symbol, decimals, chainCode, createdAt"
}
func ChainSchema() string {
return "++, id, name, networkId, chainCode, createdAt"
}
func CredentialSchema() string {
return "++, id, subject, controller, attestationType, origin, label, deviceId, credentialId, publicKey, transport, signCount, userPresent, userVerified, backupEligible, backupState, cloneWarning, createdAt, updatedAt"
}
func DIDSchema() string {
return "++, id, role, algorithm, encoding, curve, key_type, raw, jwk"
}
func JwkSchema() string {
return "++, kty, crv, x, y, n, e"
}
func GrantSchema() string {
return "++, subject, controller, origin, token, scopes, createdAt, updatedAt"
}
func KeyshareSchema() string {
return "++, id, data, role, createdAt, lastRefreshed"
}
func ProfileSchema() string {
return "++, id, subject, controller, originUri, publicMetadata, privateMetadata, createdAt, updatedAt"
}