mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82ec2664f3 | ||
|
|
9372db6279 | ||
|
|
e76c4a5902 | ||
|
|
075b54883b | ||
|
|
99861266c6 | ||
|
|
006f69e0d2 | ||
|
|
de4d62e63e | ||
|
|
dd272bf194 | ||
|
|
388ca462a4 | ||
|
|
5b85868993 | ||
|
|
f70fa75e86 | ||
|
|
bbfd3e5171 | ||
|
|
b1422bc97e | ||
|
|
f14f6ff536 | ||
|
|
c8657022a2 | ||
|
|
7b5ee7b0ed | ||
|
|
bda52d5f3d | ||
|
|
137f0ed7f3 | ||
|
|
cf839c9491 | ||
|
|
0d12487c65 | ||
|
|
dc20befb86 | ||
|
|
6c6b38a2e3 | ||
|
|
1ca706744e | ||
|
|
5e6fc4a82b | ||
|
|
7cbc9e0bb1 | ||
|
|
1ae8a8675e | ||
|
|
d3f5e613ea | ||
|
|
2479bae12e | ||
|
|
fd62b6ec67 | ||
|
|
348555981b | ||
|
|
6faf2e172b | ||
|
|
54953ccb4b | ||
|
|
f84773f1f8 | ||
|
|
603da5560f | ||
|
|
10f5bfef67 | ||
|
|
4613e91a13 | ||
|
|
937b65ae95 | ||
|
|
39ce73284e | ||
|
|
59f59311b4 | ||
|
|
8239bd3fbd | ||
|
|
14aa60891c | ||
|
|
6ca0dc7dfc | ||
|
|
2e7729ce84 | ||
|
|
6c39e1a2ab | ||
|
|
a9caac47d7 | ||
|
|
381a09d87e | ||
|
|
08e28b0a5f |
@@ -2,6 +2,6 @@
|
|||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
tag_format = "v$version"
|
tag_format = "v$version"
|
||||||
version_scheme = "semver"
|
version_scheme = "semver"
|
||||||
version = "0.5.15"
|
version = "0.5.17"
|
||||||
update_changelog_on_bump = true
|
update_changelog_on_bump = true
|
||||||
major_version_zero = true
|
major_version_zero = true
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.22"
|
go-version: "1.23"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.22"
|
go-version: "1.23"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make test
|
run: make test
|
||||||
|
|||||||
@@ -1,3 +1,41 @@
|
|||||||
|
## v0.5.17 (2024-11-05)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- add remote client constructor
|
||||||
|
- add avatar image components
|
||||||
|
- add SVG CDN Illustrations to marketing architecture
|
||||||
|
- **marketing**: refactor marketing page components
|
||||||
|
- Refactor intro video component to use a proper script template
|
||||||
|
- Move Alpine.js script initialization to separate component
|
||||||
|
- Add intro video modal component
|
||||||
|
- add homepage architecture section
|
||||||
|
- add Hero section component with stats and buttons
|
||||||
|
- **css**: add new utility classes for group hover
|
||||||
|
- implement authentication register finish endpoint
|
||||||
|
- add controller creation step to allocate
|
||||||
|
- Update service module README based on protobuf files
|
||||||
|
- Update x/macaroon/README.md with details from protobuf files
|
||||||
|
- update Vault README with details from proto files
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- update file paths in error messages
|
||||||
|
- update intro video modal script
|
||||||
|
- include assets generation in wasm build
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- update marketing section architecture
|
||||||
|
- change verification table id
|
||||||
|
- **proto**: remove macaroon proto
|
||||||
|
- rename ValidateBasic to Validate
|
||||||
|
- rename session cookie key
|
||||||
|
- remove unused sync-initial endpoint
|
||||||
|
- remove formatter.go from service module
|
||||||
|
|
||||||
|
## v0.5.16 (2024-10-21)
|
||||||
|
|
||||||
## v0.5.15 (2024-10-21)
|
## v0.5.15 (2024-10-21)
|
||||||
|
|
||||||
## v0.5.14 (2024-10-21)
|
## v0.5.14 (2024-10-21)
|
||||||
|
|||||||
@@ -591,6 +591,340 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) {
|
|||||||
return controllerTable{table.(ormtable.AutoIncrementTable)}, nil
|
return controllerTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GrantTable interface {
|
||||||
|
Insert(ctx context.Context, grant *Grant) error
|
||||||
|
InsertReturningId(ctx context.Context, grant *Grant) (uint64, error)
|
||||||
|
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||||
|
Update(ctx context.Context, grant *Grant) error
|
||||||
|
Save(ctx context.Context, grant *Grant) error
|
||||||
|
Delete(ctx context.Context, grant *Grant) error
|
||||||
|
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||||
|
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
Get(ctx context.Context, id uint64) (*Grant, error)
|
||||||
|
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||||
|
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error)
|
||||||
|
List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
||||||
|
ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
||||||
|
DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error
|
||||||
|
DeleteRange(ctx context.Context, from, to GrantIndexKey) error
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type GrantIterator struct {
|
||||||
|
ormtable.Iterator
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i GrantIterator) Value() (*Grant, error) {
|
||||||
|
var grant Grant
|
||||||
|
err := i.UnmarshalMessage(&grant)
|
||||||
|
return &grant, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type GrantIndexKey interface {
|
||||||
|
id() uint32
|
||||||
|
values() []interface{}
|
||||||
|
grantIndexKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
// primary key starting index..
|
||||||
|
type GrantPrimaryKey = GrantIdIndexKey
|
||||||
|
|
||||||
|
type GrantIdIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x GrantIdIndexKey) id() uint32 { return 0 }
|
||||||
|
func (x GrantIdIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x GrantIdIndexKey) grantIndexKey() {}
|
||||||
|
|
||||||
|
func (this GrantIdIndexKey) WithId(id uint64) GrantIdIndexKey {
|
||||||
|
this.vs = []interface{}{id}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type GrantSubjectOriginIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x GrantSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||||
|
func (x GrantSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x GrantSubjectOriginIndexKey) grantIndexKey() {}
|
||||||
|
|
||||||
|
func (this GrantSubjectOriginIndexKey) WithSubject(subject string) GrantSubjectOriginIndexKey {
|
||||||
|
this.vs = []interface{}{subject}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this GrantSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) GrantSubjectOriginIndexKey {
|
||||||
|
this.vs = []interface{}{subject, origin}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type grantTable struct {
|
||||||
|
table ormtable.AutoIncrementTable
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) Insert(ctx context.Context, grant *Grant) error {
|
||||||
|
return this.table.Insert(ctx, grant)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) Update(ctx context.Context, grant *Grant) error {
|
||||||
|
return this.table.Update(ctx, grant)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) Save(ctx context.Context, grant *Grant) error {
|
||||||
|
return this.table.Save(ctx, grant)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) Delete(ctx context.Context, grant *Grant) error {
|
||||||
|
return this.table.Delete(ctx, grant)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) InsertReturningId(ctx context.Context, grant *Grant) (uint64, error) {
|
||||||
|
return this.table.InsertReturningPKey(ctx, grant)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||||
|
return this.table.LastInsertedSequence(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||||
|
return this.table.PrimaryKey().Has(ctx, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) Get(ctx context.Context, id uint64) (*Grant, error) {
|
||||||
|
var grant Grant
|
||||||
|
found, err := this.table.PrimaryKey().Get(ctx, &grant, id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &grant, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||||
|
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||||
|
subject,
|
||||||
|
origin,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error) {
|
||||||
|
var grant Grant
|
||||||
|
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &grant,
|
||||||
|
subject,
|
||||||
|
origin,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &grant, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||||
|
return GrantIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||||
|
return GrantIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) DeleteRange(ctx context.Context, from, to GrantIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this grantTable) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ GrantTable = grantTable{}
|
||||||
|
|
||||||
|
func NewGrantTable(db ormtable.Schema) (GrantTable, error) {
|
||||||
|
table := db.GetTable(&Grant{})
|
||||||
|
if table == nil {
|
||||||
|
return nil, ormerrors.TableNotFound.Wrap(string((&Grant{}).ProtoReflect().Descriptor().FullName()))
|
||||||
|
}
|
||||||
|
return grantTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonTable interface {
|
||||||
|
Insert(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error)
|
||||||
|
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||||
|
Update(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
Save(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
Delete(ctx context.Context, macaroon *Macaroon) error
|
||||||
|
Has(ctx context.Context, id uint64) (found bool, err error)
|
||||||
|
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
Get(ctx context.Context, id uint64) (*Macaroon, error)
|
||||||
|
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
||||||
|
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||||
|
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error)
|
||||||
|
List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||||
|
ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
||||||
|
DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error
|
||||||
|
DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error
|
||||||
|
|
||||||
|
doNotImplement()
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonIterator struct {
|
||||||
|
ormtable.Iterator
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i MacaroonIterator) Value() (*Macaroon, error) {
|
||||||
|
var macaroon Macaroon
|
||||||
|
err := i.UnmarshalMessage(&macaroon)
|
||||||
|
return &macaroon, err
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonIndexKey interface {
|
||||||
|
id() uint32
|
||||||
|
values() []interface{}
|
||||||
|
macaroonIndexKey()
|
||||||
|
}
|
||||||
|
|
||||||
|
// primary key starting index..
|
||||||
|
type MacaroonPrimaryKey = MacaroonIdIndexKey
|
||||||
|
|
||||||
|
type MacaroonIdIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x MacaroonIdIndexKey) id() uint32 { return 0 }
|
||||||
|
func (x MacaroonIdIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x MacaroonIdIndexKey) macaroonIndexKey() {}
|
||||||
|
|
||||||
|
func (this MacaroonIdIndexKey) WithId(id uint64) MacaroonIdIndexKey {
|
||||||
|
this.vs = []interface{}{id}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type MacaroonSubjectOriginIndexKey struct {
|
||||||
|
vs []interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x MacaroonSubjectOriginIndexKey) id() uint32 { return 1 }
|
||||||
|
func (x MacaroonSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
||||||
|
func (x MacaroonSubjectOriginIndexKey) macaroonIndexKey() {}
|
||||||
|
|
||||||
|
func (this MacaroonSubjectOriginIndexKey) WithSubject(subject string) MacaroonSubjectOriginIndexKey {
|
||||||
|
this.vs = []interface{}{subject}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this MacaroonSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) MacaroonSubjectOriginIndexKey {
|
||||||
|
this.vs = []interface{}{subject, origin}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type macaroonTable struct {
|
||||||
|
table ormtable.AutoIncrementTable
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Insert(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Insert(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Update(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Update(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Save(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Save(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Delete(ctx context.Context, macaroon *Macaroon) error {
|
||||||
|
return this.table.Delete(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) {
|
||||||
|
return this.table.InsertReturningPKey(ctx, macaroon)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||||
|
return this.table.LastInsertedSequence(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||||
|
return this.table.PrimaryKey().Has(ctx, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) Get(ctx context.Context, id uint64) (*Macaroon, error) {
|
||||||
|
var macaroon Macaroon
|
||||||
|
found, err := this.table.PrimaryKey().Get(ctx, &macaroon, id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &macaroon, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
||||||
|
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
||||||
|
subject,
|
||||||
|
origin,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) {
|
||||||
|
var macaroon Macaroon
|
||||||
|
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &macaroon,
|
||||||
|
subject,
|
||||||
|
origin,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
return nil, ormerrors.NotFound
|
||||||
|
}
|
||||||
|
return &macaroon, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||||
|
return MacaroonIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
||||||
|
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||||
|
return MacaroonIterator{it}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error {
|
||||||
|
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this macaroonTable) doNotImplement() {}
|
||||||
|
|
||||||
|
var _ MacaroonTable = macaroonTable{}
|
||||||
|
|
||||||
|
func NewMacaroonTable(db ormtable.Schema) (MacaroonTable, error) {
|
||||||
|
table := db.GetTable(&Macaroon{})
|
||||||
|
if table == nil {
|
||||||
|
return nil, ormerrors.TableNotFound.Wrap(string((&Macaroon{}).ProtoReflect().Descriptor().FullName()))
|
||||||
|
}
|
||||||
|
return macaroonTable{table.(ormtable.AutoIncrementTable)}, nil
|
||||||
|
}
|
||||||
|
|
||||||
type VerificationTable interface {
|
type VerificationTable interface {
|
||||||
Insert(ctx context.Context, verification *Verification) error
|
Insert(ctx context.Context, verification *Verification) error
|
||||||
Update(ctx context.Context, verification *Verification) error
|
Update(ctx context.Context, verification *Verification) error
|
||||||
@@ -852,6 +1186,8 @@ type StateStore interface {
|
|||||||
AssertionTable() AssertionTable
|
AssertionTable() AssertionTable
|
||||||
AuthenticationTable() AuthenticationTable
|
AuthenticationTable() AuthenticationTable
|
||||||
ControllerTable() ControllerTable
|
ControllerTable() ControllerTable
|
||||||
|
GrantTable() GrantTable
|
||||||
|
MacaroonTable() MacaroonTable
|
||||||
VerificationTable() VerificationTable
|
VerificationTable() VerificationTable
|
||||||
|
|
||||||
doNotImplement()
|
doNotImplement()
|
||||||
@@ -861,6 +1197,8 @@ type stateStore struct {
|
|||||||
assertion AssertionTable
|
assertion AssertionTable
|
||||||
authentication AuthenticationTable
|
authentication AuthenticationTable
|
||||||
controller ControllerTable
|
controller ControllerTable
|
||||||
|
grant GrantTable
|
||||||
|
macaroon MacaroonTable
|
||||||
verification VerificationTable
|
verification VerificationTable
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,6 +1214,14 @@ func (x stateStore) ControllerTable() ControllerTable {
|
|||||||
return x.controller
|
return x.controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x stateStore) GrantTable() GrantTable {
|
||||||
|
return x.grant
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x stateStore) MacaroonTable() MacaroonTable {
|
||||||
|
return x.macaroon
|
||||||
|
}
|
||||||
|
|
||||||
func (x stateStore) VerificationTable() VerificationTable {
|
func (x stateStore) VerificationTable() VerificationTable {
|
||||||
return x.verification
|
return x.verification
|
||||||
}
|
}
|
||||||
@@ -900,6 +1246,16 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grantTable, err := NewGrantTable(db)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
macaroonTable, err := NewMacaroonTable(db)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
verificationTable, err := NewVerificationTable(db)
|
verificationTable, err := NewVerificationTable(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -909,6 +1265,8 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
|||||||
assertionTable,
|
assertionTable,
|
||||||
authenticationTable,
|
authenticationTable,
|
||||||
controllerTable,
|
controllerTable,
|
||||||
|
grantTable,
|
||||||
|
macaroonTable,
|
||||||
verificationTable,
|
verificationTable,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
+1605
-58
File diff suppressed because it is too large
Load Diff
@@ -1,506 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
|
|
||||||
package modulev1
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
|
|
||||||
fmt "fmt"
|
|
||||||
runtime "github.com/cosmos/cosmos-proto/runtime"
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoiface "google.golang.org/protobuf/runtime/protoiface"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
io "io"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
md_Module protoreflect.MessageDescriptor
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
file_macaroon_module_v1_module_proto_init()
|
|
||||||
md_Module = File_macaroon_module_v1_module_proto.Messages().ByName("Module")
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ protoreflect.Message = (*fastReflection_Module)(nil)
|
|
||||||
|
|
||||||
type fastReflection_Module Module
|
|
||||||
|
|
||||||
func (x *Module) ProtoReflect() protoreflect.Message {
|
|
||||||
return (*fastReflection_Module)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Module) slowProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_macaroon_module_v1_module_proto_msgTypes[0]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _fastReflection_Module_messageType fastReflection_Module_messageType
|
|
||||||
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
|
|
||||||
|
|
||||||
type fastReflection_Module_messageType struct{}
|
|
||||||
|
|
||||||
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
|
|
||||||
return (*fastReflection_Module)(nil)
|
|
||||||
}
|
|
||||||
func (x fastReflection_Module_messageType) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_Module)
|
|
||||||
}
|
|
||||||
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_Module
|
|
||||||
}
|
|
||||||
|
|
||||||
// Descriptor returns message descriptor, which contains only the protobuf
|
|
||||||
// type information for the message.
|
|
||||||
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
|
|
||||||
return md_Module
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type returns the message type, which encapsulates both Go and protobuf
|
|
||||||
// type information. If the Go type information is not needed,
|
|
||||||
// it is recommended that the message descriptor be used instead.
|
|
||||||
func (x *fastReflection_Module) Type() protoreflect.MessageType {
|
|
||||||
return _fastReflection_Module_messageType
|
|
||||||
}
|
|
||||||
|
|
||||||
// New returns a newly allocated and mutable empty message.
|
|
||||||
func (x *fastReflection_Module) New() protoreflect.Message {
|
|
||||||
return new(fastReflection_Module)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface unwraps the message reflection interface and
|
|
||||||
// returns the underlying ProtoMessage interface.
|
|
||||||
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
|
|
||||||
return (*Module)(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Range iterates over every populated field in an undefined order,
|
|
||||||
// calling f for each field descriptor and value encountered.
|
|
||||||
// Range returns immediately if f returns false.
|
|
||||||
// While iterating, mutating operations may only be performed
|
|
||||||
// on the current field descriptor.
|
|
||||||
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Has reports whether a field is populated.
|
|
||||||
//
|
|
||||||
// Some fields have the property of nullability where it is possible to
|
|
||||||
// distinguish between the default value of a field and whether the field
|
|
||||||
// was explicitly populated with the default value. Singular message fields,
|
|
||||||
// member fields of a oneof, and proto2 scalar fields are nullable. Such
|
|
||||||
// fields are populated only if explicitly set.
|
|
||||||
//
|
|
||||||
// In other cases (aside from the nullable cases above),
|
|
||||||
// a proto3 scalar field is populated if it contains a non-zero value, and
|
|
||||||
// a repeated field is populated if it is non-empty.
|
|
||||||
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear clears the field such that a subsequent Has call reports false.
|
|
||||||
//
|
|
||||||
// Clearing an extension field clears both the extension type and value
|
|
||||||
// associated with the given field number.
|
|
||||||
//
|
|
||||||
// Clear is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get retrieves the value for a field.
|
|
||||||
//
|
|
||||||
// For unpopulated scalars, it returns the default value, where
|
|
||||||
// the default value of a bytes scalar is guaranteed to be a copy.
|
|
||||||
// For unpopulated composite types, it returns an empty, read-only view
|
|
||||||
// of the value; to obtain a mutable reference, use Mutable.
|
|
||||||
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch descriptor.FullName() {
|
|
||||||
default:
|
|
||||||
if descriptor.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", descriptor.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set stores the value for a field.
|
|
||||||
//
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType.
|
|
||||||
// When setting a composite type, it is unspecified whether the stored value
|
|
||||||
// aliases the source's memory in any way. If the composite value is an
|
|
||||||
// empty, read-only value, then it panics.
|
|
||||||
//
|
|
||||||
// Set is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mutable returns a mutable reference to a composite type.
|
|
||||||
//
|
|
||||||
// If the field is unpopulated, it may allocate a composite value.
|
|
||||||
// For a field belonging to a oneof, it implicitly clears any other field
|
|
||||||
// that may be currently set within the same oneof.
|
|
||||||
// For extension fields, it implicitly stores the provided ExtensionType
|
|
||||||
// if not already stored.
|
|
||||||
// It panics if the field does not contain a composite type.
|
|
||||||
//
|
|
||||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewField returns a new value that is assignable to the field
|
|
||||||
// for the given descriptor. For scalars, this returns the default value.
|
|
||||||
// For lists, maps, and messages, this returns a new, empty, mutable value.
|
|
||||||
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
|
||||||
switch fd.FullName() {
|
|
||||||
default:
|
|
||||||
if fd.IsExtension() {
|
|
||||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.macaroon.module.v1.Module"))
|
|
||||||
}
|
|
||||||
panic(fmt.Errorf("message onsonr.sonr.macaroon.module.v1.Module does not contain field %s", fd.FullName()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WhichOneof reports which field within the oneof is populated,
|
|
||||||
// returning nil if none are populated.
|
|
||||||
// It panics if the oneof descriptor does not belong to this message.
|
|
||||||
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
|
||||||
switch d.FullName() {
|
|
||||||
default:
|
|
||||||
panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.macaroon.module.v1.Module", d.FullName()))
|
|
||||||
}
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUnknown retrieves the entire list of unknown fields.
|
|
||||||
// The caller may only mutate the contents of the RawFields
|
|
||||||
// if the mutated bytes are stored back into the message with SetUnknown.
|
|
||||||
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
|
|
||||||
return x.unknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUnknown stores an entire list of unknown fields.
|
|
||||||
// The raw fields must be syntactically valid according to the wire format.
|
|
||||||
// An implementation may panic if this is not the case.
|
|
||||||
// Once stored, the caller must not mutate the content of the RawFields.
|
|
||||||
// An empty RawFields may be passed to clear the fields.
|
|
||||||
//
|
|
||||||
// SetUnknown is a mutating operation and unsafe for concurrent use.
|
|
||||||
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
|
|
||||||
x.unknownFields = fields
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsValid reports whether the message is valid.
|
|
||||||
//
|
|
||||||
// An invalid message is an empty, read-only value.
|
|
||||||
//
|
|
||||||
// An invalid message often corresponds to a nil pointer of the concrete
|
|
||||||
// message type, but the details are implementation dependent.
|
|
||||||
// Validity is not part of the protobuf data model, and may not
|
|
||||||
// be preserved in marshaling or other operations.
|
|
||||||
func (x *fastReflection_Module) IsValid() bool {
|
|
||||||
return x != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
|
|
||||||
// This method may return nil.
|
|
||||||
//
|
|
||||||
// The returned methods type is identical to
|
|
||||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
|
||||||
// Consult the protoiface package documentation for details.
|
|
||||||
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
|
|
||||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
|
||||||
x := input.Message.Interface().(*Module)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
options := runtime.SizeInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
var n int
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
n += len(x.unknownFields)
|
|
||||||
}
|
|
||||||
return protoiface.SizeOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Size: n,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*Module)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.MarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
size := options.Size(x)
|
|
||||||
dAtA := make([]byte, size)
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if x.unknownFields != nil {
|
|
||||||
i -= len(x.unknownFields)
|
|
||||||
copy(dAtA[i:], x.unknownFields)
|
|
||||||
}
|
|
||||||
if input.Buf != nil {
|
|
||||||
input.Buf = append(input.Buf, dAtA...)
|
|
||||||
} else {
|
|
||||||
input.Buf = dAtA
|
|
||||||
}
|
|
||||||
return protoiface.MarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Buf: input.Buf,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
|
||||||
x := input.Message.Interface().(*Module)
|
|
||||||
if x == nil {
|
|
||||||
return protoiface.UnmarshalOutput{
|
|
||||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
|
||||||
Flags: input.Flags,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
options := runtime.UnmarshalInputToOptions(input)
|
|
||||||
_ = options
|
|
||||||
dAtA := input.Buf
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if !options.DiscardUnknown {
|
|
||||||
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
|
|
||||||
}
|
|
||||||
return &protoiface.Methods{
|
|
||||||
NoUnkeyedLiterals: struct{}{},
|
|
||||||
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
|
|
||||||
Size: size,
|
|
||||||
Marshal: marshal,
|
|
||||||
Unmarshal: unmarshal,
|
|
||||||
Merge: nil,
|
|
||||||
CheckInitialized: nil,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.27.0
|
|
||||||
// protoc (unknown)
|
|
||||||
// source: macaroon/module/v1/module.proto
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Module is the app config object of the module.
|
|
||||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
|
||||||
type Module struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Module) Reset() {
|
|
||||||
*x = Module{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_macaroon_module_v1_module_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Module) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*Module) ProtoMessage() {}
|
|
||||||
|
|
||||||
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
|
|
||||||
func (*Module) Descriptor() ([]byte, []int) {
|
|
||||||
return file_macaroon_module_v1_module_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_macaroon_module_v1_module_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_macaroon_module_v1_module_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x1f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
|
||||||
0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
|
||||||
0x6f, 0x12, 0x1e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x6d,
|
|
||||||
0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76,
|
|
||||||
0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31,
|
|
||||||
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x29, 0xba,
|
|
||||||
0xc0, 0x96, 0xda, 0x01, 0x23, 0x0a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
|
||||||
0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x78, 0x2f,
|
|
||||||
0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x42, 0x86, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d,
|
|
||||||
0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x6d, 0x61, 0x63,
|
|
||||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42,
|
|
||||||
0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36,
|
|
||||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
|
|
||||||
0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72,
|
|
||||||
0x6f, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f,
|
|
||||||
0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x4d, 0x4d, 0xaa, 0x02, 0x1e,
|
|
||||||
0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x4d, 0x61, 0x63, 0x61,
|
|
||||||
0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02,
|
|
||||||
0x1e, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x4d, 0x61, 0x63,
|
|
||||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2,
|
|
||||||
0x02, 0x2a, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x4d, 0x61,
|
|
||||||
0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31,
|
|
||||||
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x4f,
|
|
||||||
0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x4d, 0x61, 0x63,
|
|
||||||
0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56,
|
|
||||||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_macaroon_module_v1_module_proto_rawDescOnce sync.Once
|
|
||||||
file_macaroon_module_v1_module_proto_rawDescData = file_macaroon_module_v1_module_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_macaroon_module_v1_module_proto_rawDescGZIP() []byte {
|
|
||||||
file_macaroon_module_v1_module_proto_rawDescOnce.Do(func() {
|
|
||||||
file_macaroon_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_macaroon_module_v1_module_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_macaroon_module_v1_module_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_macaroon_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
|
||||||
var file_macaroon_module_v1_module_proto_goTypes = []interface{}{
|
|
||||||
(*Module)(nil), // 0: onsonr.sonr.macaroon.module.v1.Module
|
|
||||||
}
|
|
||||||
var file_macaroon_module_v1_module_proto_depIdxs = []int32{
|
|
||||||
0, // [0:0] is the sub-list for method output_type
|
|
||||||
0, // [0:0] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_macaroon_module_v1_module_proto_init() }
|
|
||||||
func file_macaroon_module_v1_module_proto_init() {
|
|
||||||
if File_macaroon_module_v1_module_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_macaroon_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*Module); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_macaroon_module_v1_module_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 1,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 0,
|
|
||||||
},
|
|
||||||
GoTypes: file_macaroon_module_v1_module_proto_goTypes,
|
|
||||||
DependencyIndexes: file_macaroon_module_v1_module_proto_depIdxs,
|
|
||||||
MessageInfos: file_macaroon_module_v1_module_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_macaroon_module_v1_module_proto = out.File
|
|
||||||
file_macaroon_module_v1_module_proto_rawDesc = nil
|
|
||||||
file_macaroon_module_v1_module_proto_goTypes = nil
|
|
||||||
file_macaroon_module_v1_module_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,207 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
|
||||||
// - protoc (unknown)
|
|
||||||
// source: macaroon/v1/query.proto
|
|
||||||
|
|
||||||
package macaroonv1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.64.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion9
|
|
||||||
|
|
||||||
const (
|
|
||||||
Query_Params_FullMethodName = "/macaroon.v1.Query/Params"
|
|
||||||
Query_RefreshToken_FullMethodName = "/macaroon.v1.Query/RefreshToken"
|
|
||||||
Query_ValidateToken_FullMethodName = "/macaroon.v1.Query/ValidateToken"
|
|
||||||
)
|
|
||||||
|
|
||||||
// QueryClient is the client API for Query service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
//
|
|
||||||
// Query provides defines the gRPC querier service.
|
|
||||||
type QueryClient interface {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
|
||||||
// RefreshToken refreshes a macaroon token as post authentication.
|
|
||||||
RefreshToken(ctx context.Context, in *QueryRefreshTokenRequest, opts ...grpc.CallOption) (*QueryRefreshTokenResponse, error)
|
|
||||||
// ValidateToken validates a macaroon token as pre authentication.
|
|
||||||
ValidateToken(ctx context.Context, in *QueryValidateTokenRequest, opts ...grpc.CallOption) (*QueryValidateTokenResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type queryClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
|
||||||
return &queryClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(QueryParamsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *queryClient) RefreshToken(ctx context.Context, in *QueryRefreshTokenRequest, opts ...grpc.CallOption) (*QueryRefreshTokenResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(QueryRefreshTokenResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Query_RefreshToken_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *queryClient) ValidateToken(ctx context.Context, in *QueryValidateTokenRequest, opts ...grpc.CallOption) (*QueryValidateTokenResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(QueryValidateTokenResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Query_ValidateToken_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryServer is the server API for Query service.
|
|
||||||
// All implementations must embed UnimplementedQueryServer
|
|
||||||
// for forward compatibility.
|
|
||||||
//
|
|
||||||
// Query provides defines the gRPC querier service.
|
|
||||||
type QueryServer interface {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
|
||||||
// RefreshToken refreshes a macaroon token as post authentication.
|
|
||||||
RefreshToken(context.Context, *QueryRefreshTokenRequest) (*QueryRefreshTokenResponse, error)
|
|
||||||
// ValidateToken validates a macaroon token as pre authentication.
|
|
||||||
ValidateToken(context.Context, *QueryValidateTokenRequest) (*QueryValidateTokenResponse, error)
|
|
||||||
mustEmbedUnimplementedQueryServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedQueryServer must be embedded to have
|
|
||||||
// forward compatible implementations.
|
|
||||||
//
|
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
||||||
// pointer dereference when methods are called.
|
|
||||||
type UnimplementedQueryServer struct{}
|
|
||||||
|
|
||||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedQueryServer) RefreshToken(context.Context, *QueryRefreshTokenRequest) (*QueryRefreshTokenResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedQueryServer) ValidateToken(context.Context, *QueryValidateTokenRequest) (*QueryValidateTokenResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ValidateToken not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
|
||||||
func (UnimplementedQueryServer) testEmbeddedByValue() {}
|
|
||||||
|
|
||||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to QueryServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeQueryServer interface {
|
|
||||||
mustEmbedUnimplementedQueryServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
|
||||||
// If the following call pancis, it indicates UnimplementedQueryServer was
|
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
||||||
t.testEmbeddedByValue()
|
|
||||||
}
|
|
||||||
s.RegisterService(&Query_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(QueryParamsRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(QueryServer).Params(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Query_Params_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Query_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(QueryRefreshTokenRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(QueryServer).RefreshToken(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Query_RefreshToken_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(QueryServer).RefreshToken(ctx, req.(*QueryRefreshTokenRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Query_ValidateToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(QueryValidateTokenRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(QueryServer).ValidateToken(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Query_ValidateToken_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(QueryServer).ValidateToken(ctx, req.(*QueryValidateTokenRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Query_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "macaroon.v1.Query",
|
|
||||||
HandlerType: (*QueryServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Params",
|
|
||||||
Handler: _Query_Params_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "RefreshToken",
|
|
||||||
Handler: _Query_RefreshToken_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "ValidateToken",
|
|
||||||
Handler: _Query_ValidateToken_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "macaroon/v1/query.proto",
|
|
||||||
}
|
|
||||||
@@ -1,385 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
|
|
||||||
|
|
||||||
package macaroonv1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
ormlist "cosmossdk.io/orm/model/ormlist"
|
|
||||||
ormtable "cosmossdk.io/orm/model/ormtable"
|
|
||||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
|
||||||
)
|
|
||||||
|
|
||||||
type GrantTable interface {
|
|
||||||
Insert(ctx context.Context, grant *Grant) error
|
|
||||||
InsertReturningId(ctx context.Context, grant *Grant) (uint64, error)
|
|
||||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
|
||||||
Update(ctx context.Context, grant *Grant) error
|
|
||||||
Save(ctx context.Context, grant *Grant) error
|
|
||||||
Delete(ctx context.Context, grant *Grant) error
|
|
||||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
|
||||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
Get(ctx context.Context, id uint64) (*Grant, error)
|
|
||||||
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
|
||||||
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error)
|
|
||||||
List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
|
||||||
ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error)
|
|
||||||
DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error
|
|
||||||
DeleteRange(ctx context.Context, from, to GrantIndexKey) error
|
|
||||||
|
|
||||||
doNotImplement()
|
|
||||||
}
|
|
||||||
|
|
||||||
type GrantIterator struct {
|
|
||||||
ormtable.Iterator
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i GrantIterator) Value() (*Grant, error) {
|
|
||||||
var grant Grant
|
|
||||||
err := i.UnmarshalMessage(&grant)
|
|
||||||
return &grant, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type GrantIndexKey interface {
|
|
||||||
id() uint32
|
|
||||||
values() []interface{}
|
|
||||||
grantIndexKey()
|
|
||||||
}
|
|
||||||
|
|
||||||
// primary key starting index..
|
|
||||||
type GrantPrimaryKey = GrantIdIndexKey
|
|
||||||
|
|
||||||
type GrantIdIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x GrantIdIndexKey) id() uint32 { return 0 }
|
|
||||||
func (x GrantIdIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x GrantIdIndexKey) grantIndexKey() {}
|
|
||||||
|
|
||||||
func (this GrantIdIndexKey) WithId(id uint64) GrantIdIndexKey {
|
|
||||||
this.vs = []interface{}{id}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type GrantSubjectOriginIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x GrantSubjectOriginIndexKey) id() uint32 { return 1 }
|
|
||||||
func (x GrantSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x GrantSubjectOriginIndexKey) grantIndexKey() {}
|
|
||||||
|
|
||||||
func (this GrantSubjectOriginIndexKey) WithSubject(subject string) GrantSubjectOriginIndexKey {
|
|
||||||
this.vs = []interface{}{subject}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this GrantSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) GrantSubjectOriginIndexKey {
|
|
||||||
this.vs = []interface{}{subject, origin}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type grantTable struct {
|
|
||||||
table ormtable.AutoIncrementTable
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) Insert(ctx context.Context, grant *Grant) error {
|
|
||||||
return this.table.Insert(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) Update(ctx context.Context, grant *Grant) error {
|
|
||||||
return this.table.Update(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) Save(ctx context.Context, grant *Grant) error {
|
|
||||||
return this.table.Save(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) Delete(ctx context.Context, grant *Grant) error {
|
|
||||||
return this.table.Delete(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) InsertReturningId(ctx context.Context, grant *Grant) (uint64, error) {
|
|
||||||
return this.table.InsertReturningPKey(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
|
||||||
return this.table.LastInsertedSequence(ctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
|
||||||
return this.table.PrimaryKey().Has(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) Get(ctx context.Context, id uint64) (*Grant, error) {
|
|
||||||
var grant Grant
|
|
||||||
found, err := this.table.PrimaryKey().Get(ctx, &grant, id)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &grant, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
|
||||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
|
||||||
subject,
|
|
||||||
origin,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error) {
|
|
||||||
var grant Grant
|
|
||||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &grant,
|
|
||||||
subject,
|
|
||||||
origin,
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &grant, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
|
||||||
return GrantIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
|
||||||
return GrantIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) DeleteRange(ctx context.Context, from, to GrantIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this grantTable) doNotImplement() {}
|
|
||||||
|
|
||||||
var _ GrantTable = grantTable{}
|
|
||||||
|
|
||||||
func NewGrantTable(db ormtable.Schema) (GrantTable, error) {
|
|
||||||
table := db.GetTable(&Grant{})
|
|
||||||
if table == nil {
|
|
||||||
return nil, ormerrors.TableNotFound.Wrap(string((&Grant{}).ProtoReflect().Descriptor().FullName()))
|
|
||||||
}
|
|
||||||
return grantTable{table.(ormtable.AutoIncrementTable)}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type MacaroonTable interface {
|
|
||||||
Insert(ctx context.Context, macaroon *Macaroon) error
|
|
||||||
InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error)
|
|
||||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
|
||||||
Update(ctx context.Context, macaroon *Macaroon) error
|
|
||||||
Save(ctx context.Context, macaroon *Macaroon) error
|
|
||||||
Delete(ctx context.Context, macaroon *Macaroon) error
|
|
||||||
Has(ctx context.Context, id uint64) (found bool, err error)
|
|
||||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
Get(ctx context.Context, id uint64) (*Macaroon, error)
|
|
||||||
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
|
|
||||||
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
|
||||||
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error)
|
|
||||||
List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
|
||||||
ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error)
|
|
||||||
DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error
|
|
||||||
DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error
|
|
||||||
|
|
||||||
doNotImplement()
|
|
||||||
}
|
|
||||||
|
|
||||||
type MacaroonIterator struct {
|
|
||||||
ormtable.Iterator
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i MacaroonIterator) Value() (*Macaroon, error) {
|
|
||||||
var macaroon Macaroon
|
|
||||||
err := i.UnmarshalMessage(&macaroon)
|
|
||||||
return &macaroon, err
|
|
||||||
}
|
|
||||||
|
|
||||||
type MacaroonIndexKey interface {
|
|
||||||
id() uint32
|
|
||||||
values() []interface{}
|
|
||||||
macaroonIndexKey()
|
|
||||||
}
|
|
||||||
|
|
||||||
// primary key starting index..
|
|
||||||
type MacaroonPrimaryKey = MacaroonIdIndexKey
|
|
||||||
|
|
||||||
type MacaroonIdIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x MacaroonIdIndexKey) id() uint32 { return 0 }
|
|
||||||
func (x MacaroonIdIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x MacaroonIdIndexKey) macaroonIndexKey() {}
|
|
||||||
|
|
||||||
func (this MacaroonIdIndexKey) WithId(id uint64) MacaroonIdIndexKey {
|
|
||||||
this.vs = []interface{}{id}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type MacaroonSubjectOriginIndexKey struct {
|
|
||||||
vs []interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x MacaroonSubjectOriginIndexKey) id() uint32 { return 1 }
|
|
||||||
func (x MacaroonSubjectOriginIndexKey) values() []interface{} { return x.vs }
|
|
||||||
func (x MacaroonSubjectOriginIndexKey) macaroonIndexKey() {}
|
|
||||||
|
|
||||||
func (this MacaroonSubjectOriginIndexKey) WithSubject(subject string) MacaroonSubjectOriginIndexKey {
|
|
||||||
this.vs = []interface{}{subject}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this MacaroonSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) MacaroonSubjectOriginIndexKey {
|
|
||||||
this.vs = []interface{}{subject, origin}
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
type macaroonTable struct {
|
|
||||||
table ormtable.AutoIncrementTable
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) Insert(ctx context.Context, macaroon *Macaroon) error {
|
|
||||||
return this.table.Insert(ctx, macaroon)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) Update(ctx context.Context, macaroon *Macaroon) error {
|
|
||||||
return this.table.Update(ctx, macaroon)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) Save(ctx context.Context, macaroon *Macaroon) error {
|
|
||||||
return this.table.Save(ctx, macaroon)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) Delete(ctx context.Context, macaroon *Macaroon) error {
|
|
||||||
return this.table.Delete(ctx, macaroon)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) {
|
|
||||||
return this.table.InsertReturningPKey(ctx, macaroon)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
|
||||||
return this.table.LastInsertedSequence(ctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
|
||||||
return this.table.PrimaryKey().Has(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) Get(ctx context.Context, id uint64) (*Macaroon, error) {
|
|
||||||
var macaroon Macaroon
|
|
||||||
found, err := this.table.PrimaryKey().Get(ctx, &macaroon, id)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &macaroon, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
|
|
||||||
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
|
|
||||||
subject,
|
|
||||||
origin,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) {
|
|
||||||
var macaroon Macaroon
|
|
||||||
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &macaroon,
|
|
||||||
subject,
|
|
||||||
origin,
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return nil, ormerrors.NotFound
|
|
||||||
}
|
|
||||||
return &macaroon, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
|
||||||
return MacaroonIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) {
|
|
||||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
|
||||||
return MacaroonIterator{it}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error {
|
|
||||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this macaroonTable) doNotImplement() {}
|
|
||||||
|
|
||||||
var _ MacaroonTable = macaroonTable{}
|
|
||||||
|
|
||||||
func NewMacaroonTable(db ormtable.Schema) (MacaroonTable, error) {
|
|
||||||
table := db.GetTable(&Macaroon{})
|
|
||||||
if table == nil {
|
|
||||||
return nil, ormerrors.TableNotFound.Wrap(string((&Macaroon{}).ProtoReflect().Descriptor().FullName()))
|
|
||||||
}
|
|
||||||
return macaroonTable{table.(ormtable.AutoIncrementTable)}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type StateStore interface {
|
|
||||||
GrantTable() GrantTable
|
|
||||||
MacaroonTable() MacaroonTable
|
|
||||||
|
|
||||||
doNotImplement()
|
|
||||||
}
|
|
||||||
|
|
||||||
type stateStore struct {
|
|
||||||
grant GrantTable
|
|
||||||
macaroon MacaroonTable
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x stateStore) GrantTable() GrantTable {
|
|
||||||
return x.grant
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x stateStore) MacaroonTable() MacaroonTable {
|
|
||||||
return x.macaroon
|
|
||||||
}
|
|
||||||
|
|
||||||
func (stateStore) doNotImplement() {}
|
|
||||||
|
|
||||||
var _ StateStore = stateStore{}
|
|
||||||
|
|
||||||
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
|
||||||
grantTable, err := NewGrantTable(db)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
macaroonTable, err := NewMacaroonTable(db)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return stateStore{
|
|
||||||
grantTable,
|
|
||||||
macaroonTable,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,173 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
|
||||||
// - protoc (unknown)
|
|
||||||
// source: macaroon/v1/tx.proto
|
|
||||||
|
|
||||||
package macaroonv1
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.64.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion9
|
|
||||||
|
|
||||||
const (
|
|
||||||
Msg_UpdateParams_FullMethodName = "/macaroon.v1.Msg/UpdateParams"
|
|
||||||
Msg_IssueMacaroon_FullMethodName = "/macaroon.v1.Msg/IssueMacaroon"
|
|
||||||
)
|
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
//
|
|
||||||
// Msg defines the Msg service.
|
|
||||||
type MsgClient interface {
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
|
||||||
// IssueMacaroon asserts the given controller is the owner of the given
|
|
||||||
// address.
|
|
||||||
IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type msgClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
|
||||||
return &msgClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(MsgUpdateParamsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(MsgIssueMacaroonResponse)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_IssueMacaroon_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgServer is the server API for Msg service.
|
|
||||||
// All implementations must embed UnimplementedMsgServer
|
|
||||||
// for forward compatibility.
|
|
||||||
//
|
|
||||||
// Msg defines the Msg service.
|
|
||||||
type MsgServer interface {
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
|
||||||
// IssueMacaroon asserts the given controller is the owner of the given
|
|
||||||
// address.
|
|
||||||
IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error)
|
|
||||||
mustEmbedUnimplementedMsgServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedMsgServer must be embedded to have
|
|
||||||
// forward compatible implementations.
|
|
||||||
//
|
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
||||||
// pointer dereference when methods are called.
|
|
||||||
type UnimplementedMsgServer struct{}
|
|
||||||
|
|
||||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method IssueMacaroon not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
|
||||||
func (UnimplementedMsgServer) testEmbeddedByValue() {}
|
|
||||||
|
|
||||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to MsgServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeMsgServer interface {
|
|
||||||
mustEmbedUnimplementedMsgServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
|
||||||
// If the following call pancis, it indicates UnimplementedMsgServer was
|
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
||||||
t.testEmbeddedByValue()
|
|
||||||
}
|
|
||||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MsgUpdateParams)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_IssueMacaroon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MsgIssueMacaroon)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).IssueMacaroon(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_IssueMacaroon_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).IssueMacaroon(ctx, req.(*MsgIssueMacaroon))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Msg_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "macaroon.v1.Msg",
|
|
||||||
HandlerType: (*MsgServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "UpdateParams",
|
|
||||||
Handler: _Msg_UpdateParams_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "IssueMacaroon",
|
|
||||||
Handler: _Msg_IssueMacaroon_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "macaroon/v1/tx.proto",
|
|
||||||
}
|
|
||||||
@@ -4015,7 +4015,7 @@ var file_vault_v1_query_proto_rawDesc = []byte{
|
|||||||
0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68,
|
0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68,
|
||||||
0x61, 0x69, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61,
|
0x61, 0x69, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61,
|
||||||
0x69, 0x6e, 0x49, 0x44, 0x32, 0x93, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5f,
|
0x69, 0x6e, 0x49, 0x44, 0x32, 0x8b, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5f,
|
||||||
0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74,
|
0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74,
|
||||||
0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52,
|
0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76,
|
||||||
@@ -4034,22 +4034,22 @@ var file_vault_v1_query_proto_rawDesc = []byte{
|
|||||||
0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c,
|
0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c,
|
||||||
0x6f, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82,
|
0x6f, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82,
|
||||||
0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31,
|
0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31,
|
||||||
0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x12, 0x5f, 0x0a, 0x04, 0x53, 0x79, 0x6e,
|
0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x04, 0x53, 0x79, 0x6e,
|
||||||
0x63, 0x12, 0x1a, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65,
|
0x63, 0x12, 0x1a, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65,
|
||||||
0x72, 0x79, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e,
|
0x72, 0x79, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e,
|
||||||
0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x79,
|
0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x79,
|
||||||
0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93,
|
0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93,
|
||||||
0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79,
|
0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79,
|
||||||
0x6e, 0x63, 0x2d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63,
|
0x6e, 0x63, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74,
|
||||||
0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65,
|
0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||||
0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e,
|
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61,
|
||||||
0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76,
|
0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, 0x02,
|
||||||
0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56,
|
0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, 0xca,
|
||||||
0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c,
|
0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, 0x75,
|
||||||
0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50,
|
0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c,
|
0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70,
|
||||||
0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+1
-23
@@ -148,9 +148,6 @@ import (
|
|||||||
did "github.com/onsonr/sonr/x/did"
|
did "github.com/onsonr/sonr/x/did"
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
didtypes "github.com/onsonr/sonr/x/did/types"
|
didtypes "github.com/onsonr/sonr/x/did/types"
|
||||||
macaroon "github.com/onsonr/sonr/x/macaroon"
|
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
macaroontypes "github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
service "github.com/onsonr/sonr/x/service"
|
service "github.com/onsonr/sonr/x/service"
|
||||||
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
servicekeeper "github.com/onsonr/sonr/x/service/keeper"
|
||||||
servicetypes "github.com/onsonr/sonr/x/service/types"
|
servicetypes "github.com/onsonr/sonr/x/service/types"
|
||||||
@@ -236,7 +233,6 @@ type SonrApp struct {
|
|||||||
UpgradeKeeper *upgradekeeper.Keeper
|
UpgradeKeeper *upgradekeeper.Keeper
|
||||||
legacyAmino *codec.LegacyAmino
|
legacyAmino *codec.LegacyAmino
|
||||||
VaultKeeper vaultkeeper.Keeper
|
VaultKeeper vaultkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
|
||||||
ServiceKeeper servicekeeper.Keeper
|
ServiceKeeper servicekeeper.Keeper
|
||||||
sm *module.SimulationManager
|
sm *module.SimulationManager
|
||||||
BasicModuleManager module.BasicManager
|
BasicModuleManager module.BasicManager
|
||||||
@@ -371,7 +367,6 @@ func NewChainApp(
|
|||||||
packetforwardtypes.StoreKey,
|
packetforwardtypes.StoreKey,
|
||||||
didtypes.StoreKey,
|
didtypes.StoreKey,
|
||||||
vaulttypes.StoreKey,
|
vaulttypes.StoreKey,
|
||||||
macaroontypes.StoreKey,
|
|
||||||
servicetypes.StoreKey,
|
servicetypes.StoreKey,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -632,16 +627,6 @@ func NewChainApp(
|
|||||||
app.StakingKeeper,
|
app.StakingKeeper,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create the macaroon Keeper
|
|
||||||
app.MacaroonKeeper = macaroonkeeper.NewKeeper(
|
|
||||||
appCodec,
|
|
||||||
sdkruntime.NewKVStoreService(keys[macaroontypes.StoreKey]),
|
|
||||||
logger,
|
|
||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
||||||
app.AccountKeeper,
|
|
||||||
app.DidKeeper,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create the vault Keeper
|
// Create the vault Keeper
|
||||||
app.VaultKeeper = vaultkeeper.NewKeeper(
|
app.VaultKeeper = vaultkeeper.NewKeeper(
|
||||||
appCodec,
|
appCodec,
|
||||||
@@ -650,7 +635,6 @@ func NewChainApp(
|
|||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
app.AccountKeeper,
|
app.AccountKeeper,
|
||||||
app.DidKeeper,
|
app.DidKeeper,
|
||||||
app.MacaroonKeeper,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Create the service Keeper
|
// Create the service Keeper
|
||||||
@@ -661,7 +645,6 @@ func NewChainApp(
|
|||||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||||
app.DidKeeper,
|
app.DidKeeper,
|
||||||
app.GroupKeeper,
|
app.GroupKeeper,
|
||||||
app.MacaroonKeeper,
|
|
||||||
app.NFTKeeper,
|
app.NFTKeeper,
|
||||||
app.VaultKeeper,
|
app.VaultKeeper,
|
||||||
)
|
)
|
||||||
@@ -924,10 +907,9 @@ func NewChainApp(
|
|||||||
|
|
||||||
did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper),
|
did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper),
|
||||||
|
|
||||||
macaroon.NewAppModule(appCodec, app.MacaroonKeeper, app.DidKeeper),
|
|
||||||
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper),
|
||||||
|
|
||||||
service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper, app.MacaroonKeeper),
|
service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper),
|
||||||
)
|
)
|
||||||
|
|
||||||
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
|
||||||
@@ -977,7 +959,6 @@ func NewChainApp(
|
|||||||
packetforwardtypes.ModuleName,
|
packetforwardtypes.ModuleName,
|
||||||
didtypes.ModuleName,
|
didtypes.ModuleName,
|
||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -999,7 +980,6 @@ func NewChainApp(
|
|||||||
packetforwardtypes.ModuleName,
|
packetforwardtypes.ModuleName,
|
||||||
didtypes.ModuleName,
|
didtypes.ModuleName,
|
||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1030,7 +1010,6 @@ func NewChainApp(
|
|||||||
packetforwardtypes.ModuleName,
|
packetforwardtypes.ModuleName,
|
||||||
didtypes.ModuleName,
|
didtypes.ModuleName,
|
||||||
vaulttypes.ModuleName,
|
vaulttypes.ModuleName,
|
||||||
macaroontypes.ModuleName,
|
|
||||||
servicetypes.ModuleName,
|
servicetypes.ModuleName,
|
||||||
}
|
}
|
||||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||||
@@ -1491,7 +1470,6 @@ func initParamsKeeper(
|
|||||||
WithKeyTable(packetforwardtypes.ParamKeyTable())
|
WithKeyTable(packetforwardtypes.ParamKeyTable())
|
||||||
paramsKeeper.Subspace(didtypes.ModuleName)
|
paramsKeeper.Subspace(didtypes.ModuleName)
|
||||||
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
paramsKeeper.Subspace(vaulttypes.ModuleName)
|
||||||
paramsKeeper.Subspace(macaroontypes.ModuleName)
|
|
||||||
paramsKeeper.Subspace(servicetypes.ModuleName)
|
paramsKeeper.Subspace(servicetypes.ModuleName)
|
||||||
|
|
||||||
return paramsKeeper
|
return paramsKeeper
|
||||||
|
|||||||
+42
-4
@@ -1,24 +1,40 @@
|
|||||||
package ctx
|
package ctx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/go-webauthn/webauthn/protocol"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/segmentio/ksuid"
|
"github.com/segmentio/ksuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CookieKey is a type alias for string.
|
||||||
type CookieKey string
|
type CookieKey string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CookieKeySessionID CookieKey = "session.id"
|
// CookieKeySessionID is the key for the session ID cookie.
|
||||||
CookieKeySonrAddr CookieKey = "sonr.addr"
|
CookieKeySessionID CookieKey = "session.id"
|
||||||
CookieKeySonrDID CookieKey = "sonr.did"
|
|
||||||
CookieKeyVaultCID CookieKey = "vault.cid"
|
// CookieKeySessionChal is the key for the session challenge cookie.
|
||||||
|
CookieKeySessionChal CookieKey = "session.chal"
|
||||||
|
|
||||||
|
// CookieKeySonrAddr is the key for the Sonr address cookie.
|
||||||
|
CookieKeySonrAddr CookieKey = "sonr.addr"
|
||||||
|
|
||||||
|
// CookieKeySonrDID is the key for the Sonr DID cookie.
|
||||||
|
CookieKeySonrDID CookieKey = "sonr.did"
|
||||||
|
|
||||||
|
// CookieKeyVaultCID is the key for the Vault CID cookie.
|
||||||
|
CookieKeyVaultCID CookieKey = "vault.cid"
|
||||||
|
|
||||||
|
// CookieKeyVaultSchema is the key for the Vault schema cookie.
|
||||||
CookieKeyVaultSchema CookieKey = "vault.schema"
|
CookieKeyVaultSchema CookieKey = "vault.schema"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// String returns the string representation of the CookieKey.
|
||||||
func (c CookieKey) String() string {
|
func (c CookieKey) String() string {
|
||||||
return string(c)
|
return string(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSessionID returns the session ID from the cookies.
|
||||||
func GetSessionID(c echo.Context) string {
|
func GetSessionID(c echo.Context) string {
|
||||||
// Attempt to read the session ID from the "session" cookie
|
// Attempt to read the session ID from the "session" cookie
|
||||||
sessionID, err := ReadCookie(c, CookieKeySessionID)
|
sessionID, err := ReadCookie(c, CookieKeySessionID)
|
||||||
@@ -28,3 +44,25 @@ func GetSessionID(c echo.Context) string {
|
|||||||
}
|
}
|
||||||
return sessionID
|
return sessionID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSessionChallenge returns the session challenge from the cookies.
|
||||||
|
func GetSessionChallenge(c echo.Context) (*protocol.URLEncodedBase64, error) {
|
||||||
|
// TODO: Implement a way to regenerate the challenge if it is invalid.
|
||||||
|
chal := new(protocol.URLEncodedBase64)
|
||||||
|
// Attempt to read the session challenge from the "session" cookie
|
||||||
|
sessionChal, err := ReadCookie(c, CookieKeySessionChal)
|
||||||
|
if err != nil {
|
||||||
|
// Generate a new challenge if the session cookie is missing or invalid
|
||||||
|
ch, errb := protocol.CreateChallenge()
|
||||||
|
if errb != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
WriteCookie(c, CookieKeySessionChal, ch.String())
|
||||||
|
return &ch, nil
|
||||||
|
}
|
||||||
|
err = chal.UnmarshalJSON([]byte(sessionChal))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return chal, nil
|
||||||
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -5,6 +5,16 @@ type Button struct {
|
|||||||
Href string
|
Href string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Image struct {
|
||||||
|
Src string
|
||||||
|
Width string
|
||||||
|
Height string
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭──────────────────────────────────────────────────────────╮
|
||||||
|
// │ Generic Models │
|
||||||
|
// ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
type Feature struct {
|
type Feature struct {
|
||||||
Title string
|
Title string
|
||||||
Desc string
|
Desc string
|
||||||
@@ -12,12 +22,6 @@ type Feature struct {
|
|||||||
Image *Image
|
Image *Image
|
||||||
}
|
}
|
||||||
|
|
||||||
type Image struct {
|
|
||||||
Src string
|
|
||||||
Width string
|
|
||||||
Height string
|
|
||||||
}
|
|
||||||
|
|
||||||
type Stat struct {
|
type Stat struct {
|
||||||
Value string
|
Value string
|
||||||
Denom string
|
Denom string
|
||||||
@@ -34,7 +38,7 @@ type Technology struct {
|
|||||||
type Testimonial struct {
|
type Testimonial struct {
|
||||||
FullName string
|
FullName string
|
||||||
Username string
|
Username string
|
||||||
Avatar string
|
Avatar *Image
|
||||||
Quote string
|
Quote string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,8 +84,9 @@ type Architecture struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Lowlights struct {
|
type Lowlights struct {
|
||||||
Heading string
|
Heading string
|
||||||
Quotes []*Testimonial
|
UpperQuotes []*Testimonial
|
||||||
|
LowerQuotes []*Testimonial
|
||||||
}
|
}
|
||||||
|
|
||||||
type CallToAction struct {
|
type CallToAction struct {
|
||||||
|
|||||||
@@ -1028,6 +1028,10 @@ select{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.invisible{
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.fixed{
|
.fixed{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
@@ -1108,6 +1112,16 @@ select{
|
|||||||
margin: 0.5rem;
|
margin: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx-0{
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx-3{
|
||||||
|
margin-left: 0.75rem;
|
||||||
|
margin-right: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mx-auto{
|
.mx-auto{
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
@@ -1145,6 +1159,10 @@ select{
|
|||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mr-0\.5{
|
||||||
|
margin-right: 0.125rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mr-1{
|
.mr-1{
|
||||||
margin-right: 0.25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
@@ -1169,6 +1187,10 @@ select{
|
|||||||
margin-right: 1.75rem;
|
margin-right: 1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mt-0\.5{
|
||||||
|
margin-top: 0.125rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mt-1{
|
.mt-1{
|
||||||
margin-top: 0.25rem;
|
margin-top: 0.25rem;
|
||||||
}
|
}
|
||||||
@@ -1221,10 +1243,30 @@ select{
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aspect-video{
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h-1{
|
||||||
|
height: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h-1\.5{
|
||||||
|
height: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h-1\/4{
|
||||||
|
height: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
.h-10{
|
.h-10{
|
||||||
height: 2.5rem;
|
height: 2.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-12{
|
||||||
|
height: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
.h-14{
|
.h-14{
|
||||||
height: 3.5rem;
|
height: 3.5rem;
|
||||||
}
|
}
|
||||||
@@ -1233,6 +1275,10 @@ select{
|
|||||||
height: 5rem;
|
height: 5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-24{
|
||||||
|
height: 6rem;
|
||||||
|
}
|
||||||
|
|
||||||
.h-3{
|
.h-3{
|
||||||
height: 0.75rem;
|
height: 0.75rem;
|
||||||
}
|
}
|
||||||
@@ -1261,10 +1307,18 @@ select{
|
|||||||
height: 2.25rem;
|
height: 2.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-\[18px\]{
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.h-\[280px\]{
|
.h-\[280px\]{
|
||||||
height: 280px;
|
height: 280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-\[360px\]{
|
||||||
|
height: 360px;
|
||||||
|
}
|
||||||
|
|
||||||
.h-auto{
|
.h-auto{
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
@@ -1281,6 +1335,18 @@ select{
|
|||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.w-0{
|
||||||
|
width: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w-10{
|
||||||
|
width: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w-12{
|
||||||
|
width: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
.w-14{
|
.w-14{
|
||||||
width: 3.5rem;
|
width: 3.5rem;
|
||||||
}
|
}
|
||||||
@@ -1293,6 +1359,10 @@ select{
|
|||||||
width: 5rem;
|
width: 5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.w-24{
|
||||||
|
width: 6rem;
|
||||||
|
}
|
||||||
|
|
||||||
.w-3{
|
.w-3{
|
||||||
width: 0.75rem;
|
width: 0.75rem;
|
||||||
}
|
}
|
||||||
@@ -1313,6 +1383,10 @@ select{
|
|||||||
width: 2rem;
|
width: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.w-\[18px\]{
|
||||||
|
width: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.w-\[22rem\]{
|
.w-\[22rem\]{
|
||||||
width: 22rem;
|
width: 22rem;
|
||||||
}
|
}
|
||||||
@@ -1346,6 +1420,10 @@ select{
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.min-w-\[640px\]{
|
||||||
|
min-width: 640px;
|
||||||
|
}
|
||||||
|
|
||||||
.max-w-2xl{
|
.max-w-2xl{
|
||||||
max-width: 42rem;
|
max-width: 42rem;
|
||||||
}
|
}
|
||||||
@@ -1437,16 +1515,36 @@ select{
|
|||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.-translate-y-8{
|
||||||
|
--tw-translate-y: -2rem;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
|
.-translate-y-full{
|
||||||
|
--tw-translate-y: -100%;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.translate-x-0{
|
.translate-x-0{
|
||||||
--tw-translate-x: 0px;
|
--tw-translate-x: 0px;
|
||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.translate-x-0\.5{
|
||||||
|
--tw-translate-x: 0.125rem;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.translate-x-8{
|
.translate-x-8{
|
||||||
--tw-translate-x: 2rem;
|
--tw-translate-x: 2rem;
|
||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.translate-x-px{
|
||||||
|
--tw-translate-x: 1px;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.translate-y-0{
|
.translate-y-0{
|
||||||
--tw-translate-y: 0px;
|
--tw-translate-y: 0px;
|
||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
@@ -1472,6 +1570,11 @@ select{
|
|||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.translate-y-full{
|
||||||
|
--tw-translate-y: 100%;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.rotate-1{
|
.rotate-1{
|
||||||
--tw-rotate: 1deg;
|
--tw-rotate: 1deg;
|
||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
@@ -1483,6 +1586,18 @@ select{
|
|||||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scale-50{
|
||||||
|
--tw-scale-x: .5;
|
||||||
|
--tw-scale-y: .5;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
|
.scale-75{
|
||||||
|
--tw-scale-x: .75;
|
||||||
|
--tw-scale-y: .75;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.scale-90{
|
.scale-90{
|
||||||
--tw-scale-x: .9;
|
--tw-scale-x: .9;
|
||||||
--tw-scale-y: .9;
|
--tw-scale-y: .9;
|
||||||
@@ -1529,6 +1644,12 @@ select{
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.appearance-none{
|
||||||
|
-webkit-appearance: none;
|
||||||
|
-moz-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
.grid-cols-2{
|
.grid-cols-2{
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
@@ -1763,6 +1884,11 @@ select{
|
|||||||
border-color: rgb(82 82 91 / var(--tw-border-opacity));
|
border-color: rgb(82 82 91 / var(--tw-border-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-black{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
.bg-blue-50{
|
.bg-blue-50{
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(239 246 255 / var(--tw-bg-opacity));
|
background-color: rgb(239 246 255 / var(--tw-bg-opacity));
|
||||||
@@ -1847,14 +1973,42 @@ select{
|
|||||||
background-color: rgb(24 24 27 / var(--tw-bg-opacity));
|
background-color: rgb(24 24 27 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-opacity-0{
|
||||||
|
--tw-bg-opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-opacity-20{
|
||||||
|
--tw-bg-opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-opacity-80{
|
||||||
|
--tw-bg-opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
.bg-opacity-90{
|
.bg-opacity-90{
|
||||||
--tw-bg-opacity: 0.9;
|
--tw-bg-opacity: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-gradient-to-b{
|
||||||
|
background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
|
||||||
|
}
|
||||||
|
|
||||||
.bg-gradient-to-r{
|
.bg-gradient-to-r{
|
||||||
background-image: linear-gradient(to right, var(--tw-gradient-stops));
|
background-image: linear-gradient(to right, var(--tw-gradient-stops));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.from-black{
|
||||||
|
--tw-gradient-from: #000 var(--tw-gradient-from-position);
|
||||||
|
--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);
|
||||||
|
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
|
||||||
|
}
|
||||||
|
|
||||||
|
.from-transparent{
|
||||||
|
--tw-gradient-from: transparent var(--tw-gradient-from-position);
|
||||||
|
--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);
|
||||||
|
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
|
||||||
|
}
|
||||||
|
|
||||||
.from-zinc-100{
|
.from-zinc-100{
|
||||||
--tw-gradient-from: #f4f4f5 var(--tw-gradient-from-position);
|
--tw-gradient-from: #f4f4f5 var(--tw-gradient-from-position);
|
||||||
--tw-gradient-to: rgb(244 244 245 / 0) var(--tw-gradient-to-position);
|
--tw-gradient-to: rgb(244 244 245 / 0) var(--tw-gradient-to-position);
|
||||||
@@ -1872,6 +2026,14 @@ select{
|
|||||||
--tw-gradient-stops: var(--tw-gradient-from), #18181b var(--tw-gradient-via-position), var(--tw-gradient-to);
|
--tw-gradient-stops: var(--tw-gradient-from), #18181b var(--tw-gradient-via-position), var(--tw-gradient-to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.to-black{
|
||||||
|
--tw-gradient-to: #000 var(--tw-gradient-to-position);
|
||||||
|
}
|
||||||
|
|
||||||
|
.to-transparent{
|
||||||
|
--tw-gradient-to: transparent var(--tw-gradient-to-position);
|
||||||
|
}
|
||||||
|
|
||||||
.to-white{
|
.to-white{
|
||||||
--tw-gradient-to: #fff var(--tw-gradient-to-position);
|
--tw-gradient-to: #fff var(--tw-gradient-to-position);
|
||||||
}
|
}
|
||||||
@@ -2087,6 +2249,10 @@ select{
|
|||||||
font-family: Inter Tight, sans-serif;
|
font-family: Inter Tight, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.font-mono{
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||||
|
}
|
||||||
|
|
||||||
.text-2xl{
|
.text-2xl{
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
line-height: 1.415;
|
line-height: 1.415;
|
||||||
@@ -2310,10 +2476,18 @@ select{
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.opacity-20{
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
.opacity-60{
|
.opacity-60{
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.opacity-80{
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
.mix-blend-exclusion{
|
.mix-blend-exclusion{
|
||||||
mix-blend-mode: exclusion;
|
mix-blend-mode: exclusion;
|
||||||
}
|
}
|
||||||
@@ -2372,10 +2546,22 @@ select{
|
|||||||
transition-duration: 150ms;
|
transition-duration: 150ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.delay-200{
|
||||||
|
transition-delay: 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
.duration-100{
|
.duration-100{
|
||||||
transition-duration: 100ms;
|
transition-duration: 100ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.duration-1000{
|
||||||
|
transition-duration: 1000ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.duration-150{
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
|
|
||||||
.duration-200{
|
.duration-200{
|
||||||
transition-duration: 200ms;
|
transition-duration: 200ms;
|
||||||
}
|
}
|
||||||
@@ -3019,6 +3205,12 @@ input[type="search"]::-webkit-search-results-decoration {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hover\:scale-100:hover{
|
||||||
|
--tw-scale-x: 1;
|
||||||
|
--tw-scale-y: 1;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.hover\:bg-blue-100:hover{
|
.hover\:bg-blue-100:hover{
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
|
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
|
||||||
@@ -3283,6 +3475,25 @@ input[type="search"]::-webkit-search-results-decoration {
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.group:hover .group-hover\:visible{
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group:hover .group-hover\:mx-1{
|
||||||
|
margin-left: 0.25rem;
|
||||||
|
margin-right: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group:hover .group-hover\:w-12{
|
||||||
|
width: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group:hover .group-hover\:scale-110{
|
||||||
|
--tw-scale-x: 1.1;
|
||||||
|
--tw-scale-y: 1.1;
|
||||||
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||||
|
}
|
||||||
|
|
||||||
.group:hover .group-hover\:\[animation-play-state\:paused\]{
|
.group:hover .group-hover\:\[animation-play-state\:paused\]{
|
||||||
animation-play-state: paused;
|
animation-play-state: paused;
|
||||||
}
|
}
|
||||||
@@ -3594,6 +3805,190 @@ input[type="search"]::-webkit-search-results-decoration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-progress\]\:rounded-full::-moz-range-progress{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-progress\]\:bg-blue-600::-moz-range-progress{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(37 99 235 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-progress\]\:bg-white::-moz-range-progress{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-progress\]\:bg-opacity-80::-moz-range-progress{
|
||||||
|
--tw-bg-opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:h-1\.5::-moz-range-thumb{
|
||||||
|
height: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:h-2::-moz-range-thumb{
|
||||||
|
height: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:w-1\.5::-moz-range-thumb{
|
||||||
|
width: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:w-2::-moz-range-thumb{
|
||||||
|
width: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:appearance-none::-moz-range-thumb{
|
||||||
|
-moz-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:rounded-full::-moz-range-thumb{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:border-0::-moz-range-thumb{
|
||||||
|
border-width: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-thumb\]\:bg-white::-moz-range-thumb{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-track\]\:rounded-full::-moz-range-track{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-moz-range-track\]\:bg-neutral-200::-moz-range-track{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-fill-lower\]\:rounded-full::-ms-fill-lower{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-fill-lower\]\:bg-blue-600::-ms-fill-lower{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(37 99 235 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-fill-lower\]\:bg-white::-ms-fill-lower{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-fill-lower\]\:bg-opacity-80::-ms-fill-lower{
|
||||||
|
--tw-bg-opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:h-1\.5::-ms-thumb{
|
||||||
|
height: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:h-2::-ms-thumb{
|
||||||
|
height: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:w-1\.5::-ms-thumb{
|
||||||
|
width: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:w-2::-ms-thumb{
|
||||||
|
width: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:appearance-none::-ms-thumb{
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:rounded-full::-ms-thumb{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:border-0::-ms-thumb{
|
||||||
|
border-width: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-thumb\]\:bg-white::-ms-thumb{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-track\]\:rounded-full::-ms-track{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-ms-track\]\:bg-neutral-200::-ms-track{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-runnable-track\]\:overflow-hidden::-webkit-slider-runnable-track{
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-runnable-track\]\:rounded-full::-webkit-slider-runnable-track{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-runnable-track\]\:bg-white::-webkit-slider-runnable-track{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-runnable-track\]\:bg-opacity-30::-webkit-slider-runnable-track{
|
||||||
|
--tw-bg-opacity: 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:h-1\.5::-webkit-slider-thumb{
|
||||||
|
height: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:h-2::-webkit-slider-thumb{
|
||||||
|
height: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:w-1\.5::-webkit-slider-thumb{
|
||||||
|
width: 0.375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:w-2::-webkit-slider-thumb{
|
||||||
|
width: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:border-0::-webkit-slider-thumb{
|
||||||
|
border-width: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:bg-white::-webkit-slider-thumb{
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:shadow-\[-995px_0px_0px_990px_\#2463eb\]::-webkit-slider-thumb{
|
||||||
|
--tw-shadow: -995px 0px 0px 990px #2463eb;
|
||||||
|
--tw-shadow-colored: -995px 0px 0px 990px var(--tw-shadow-color);
|
||||||
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.\[\&\:\:-webkit-slider-thumb\]\:shadow-\[-995px_0px_0px_990px_rgba\(255\2c _255\2c _255\2c _0\.8\)\]::-webkit-slider-thumb{
|
||||||
|
--tw-shadow: -995px 0px 0px 990px rgba(255, 255, 255, 0.8);
|
||||||
|
--tw-shadow-colored: -995px 0px 0px 990px var(--tw-shadow-color);
|
||||||
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
.\[\&\>div\]\:mx-3>div{
|
.\[\&\>div\]\:mx-3>div{
|
||||||
margin-left: 0.75rem;
|
margin-left: 0.75rem;
|
||||||
margin-right: 0.75rem;
|
margin-right: 0.75rem;
|
||||||
|
|||||||
@@ -6,20 +6,24 @@ import (
|
|||||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// RegisterModal returns the Register Modal.
|
||||||
templ RegisterModal(c echo.Context) {
|
templ RegisterModal(c echo.Context) {
|
||||||
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
|
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
|
||||||
@sections.RegisterStart()
|
@sections.RegisterStart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoginModal returns the Login Modal.
|
||||||
templ LoginModal(c echo.Context) {
|
templ LoginModal(c echo.Context) {
|
||||||
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
|
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
|
||||||
@sections.LoginStart()
|
@sections.LoginStart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AuthorizeModal returns the Authorize Modal.
|
||||||
templ AuthorizeModal(c echo.Context) {
|
templ AuthorizeModal(c echo.Context) {
|
||||||
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
|
@styles.OpenModal("Account Registration", "Enter your account information below to create your account.") {
|
||||||
@sections.AuthorizeStart()
|
@sections.AuthorizeStart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// RegisterModal returns the Register Modal.
|
||||||
func RegisterModal(c echo.Context) templ.Component {
|
func RegisterModal(c echo.Context) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
@@ -61,6 +62,7 @@ func RegisterModal(c echo.Context) templ.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoginModal returns the Login Modal.
|
||||||
func LoginModal(c echo.Context) templ.Component {
|
func LoginModal(c echo.Context) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
@@ -108,6 +110,7 @@ func LoginModal(c echo.Context) templ.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AuthorizeModal returns the Authorize Modal.
|
||||||
func AuthorizeModal(c echo.Context) templ.Component {
|
func AuthorizeModal(c echo.Context) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
// │ DWN Routes - Authentication │
|
// │ DWN Routes - Authentication │
|
||||||
// ╰───────────────────────────────────────────────────────────╯
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// CurrentViewRoute returns the current view route.
|
||||||
func CurrentViewRoute(c echo.Context) error {
|
func CurrentViewRoute(c echo.Context) error {
|
||||||
s, err := ctx.GetDWNContext(c)
|
s, err := ctx.GetDWNContext(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -24,14 +25,17 @@ func CurrentViewRoute(c echo.Context) error {
|
|||||||
// │ Hway Routes - Authentication │
|
// │ Hway Routes - Authentication │
|
||||||
// ╰───────────────────────────────────────────────────────────╯
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// AuthorizeModalRoute returns the Authorize Modal route.
|
||||||
func AuthorizeModalRoute(c echo.Context) error {
|
func AuthorizeModalRoute(c echo.Context) error {
|
||||||
return ctx.RenderTempl(c, AuthorizeModal(c))
|
return ctx.RenderTempl(c, AuthorizeModal(c))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoginModalRoute returns the Login Modal route.
|
||||||
func LoginModalRoute(c echo.Context) error {
|
func LoginModalRoute(c echo.Context) error {
|
||||||
return ctx.RenderTempl(c, LoginModal(c))
|
return ctx.RenderTempl(c, LoginModal(c))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RegisterModalRoute returns the Register Modal route.
|
||||||
func RegisterModalRoute(c echo.Context) error {
|
func RegisterModalRoute(c echo.Context) error {
|
||||||
return ctx.RenderTempl(c, RegisterModal(c))
|
return ctx.RenderTempl(c, RegisterModal(c))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ package authentication
|
|||||||
|
|
||||||
import echo "github.com/labstack/echo/v4"
|
import echo "github.com/labstack/echo/v4"
|
||||||
|
|
||||||
|
// CurrentView checks if the user is logged in.
|
||||||
templ CurrentView(c echo.Context) {
|
templ CurrentView(c echo.Context) {
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title">Current Account</h3>
|
<h3 class="card-title">Current Account</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<a href="/logout">Logout</a>
|
<a href="/logout">Logout</a>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
|
|||||||
|
|
||||||
import echo "github.com/labstack/echo/v4"
|
import echo "github.com/labstack/echo/v4"
|
||||||
|
|
||||||
|
// CurrentView checks if the user is logged in.
|
||||||
func CurrentView(c echo.Context) templ.Component {
|
func CurrentView(c echo.Context) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
|
|||||||
@@ -0,0 +1,283 @@
|
|||||||
|
package modals
|
||||||
|
|
||||||
|
templ IntroVideo() {
|
||||||
|
<div
|
||||||
|
x-data="{
|
||||||
|
sources: {
|
||||||
|
mp4: 'https://cdn.devdojo.com/pines/videos/coast.mp4',
|
||||||
|
webm: 'https://cdn.devdojo.com/pines/videos/coast.webm',
|
||||||
|
ogg: 'https://cdn.devdojo.com/pines/videos/coast.ogg'
|
||||||
|
},
|
||||||
|
playing: false,
|
||||||
|
controls: true,
|
||||||
|
muted: false,
|
||||||
|
muteForced: false,
|
||||||
|
fullscreen: false,
|
||||||
|
ended: false,
|
||||||
|
mouseleave: false,
|
||||||
|
autoHideControlsDelay: 3000,
|
||||||
|
controlsHideTimeout: null,
|
||||||
|
poster: null,
|
||||||
|
videoDuration: 0,
|
||||||
|
timeDurationString: '00:00',
|
||||||
|
timeElapsedString: '00:00',
|
||||||
|
showTime: false,
|
||||||
|
volume: 1,
|
||||||
|
volumeBeforeMute: 1,
|
||||||
|
videoPlayerReady: false,
|
||||||
|
timelineSeek(e) {
|
||||||
|
time = this.formatTime(Math.round(e.target.value));
|
||||||
|
this.timeElapsedString = `${time.minutes}:${time.seconds}`;
|
||||||
|
},
|
||||||
|
metaDataLoaded(event) {
|
||||||
|
this.videoDuration = event.target.duration;
|
||||||
|
this.$refs.videoProgress.setAttribute('max', this.videoDuration);
|
||||||
|
time = this.formatTime(Math.round(this.videoDuration));
|
||||||
|
this.timeDurationString = `${time.minutes}:${time.seconds}`;
|
||||||
|
this.showTime = true;
|
||||||
|
this.videoPlayerReady = true;
|
||||||
|
},
|
||||||
|
togglePlay(e) {
|
||||||
|
if (this.$refs.player.paused || this.$refs.player.ended) {
|
||||||
|
this.playing = true;
|
||||||
|
this.$refs.player.play();
|
||||||
|
} else {
|
||||||
|
this.$refs.player.pause();
|
||||||
|
this.playing = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toggleMute(){
|
||||||
|
this.muted = !this.muted;
|
||||||
|
this.$refs.player.muted = this.muted;
|
||||||
|
if(this.muted){
|
||||||
|
this.volumeBeforeMute = this.volume;
|
||||||
|
this.volume = 0;
|
||||||
|
} else {
|
||||||
|
this.volume = this.volumeBeforeMute;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
timeUpdatedInterval() {
|
||||||
|
if (!this.$refs.videoProgress.getAttribute('max'))
|
||||||
|
this.$refs.videoProgress.setAttribute('max', $refs.player.duration);
|
||||||
|
this.$refs.videoProgress.value = this.$refs.player.currentTime;
|
||||||
|
time = this.formatTime(Math.round(this.$refs.player.currentTime));
|
||||||
|
this.timeElapsedString = `${time.minutes}:${time.seconds}`;
|
||||||
|
},
|
||||||
|
updateVolume(e) {
|
||||||
|
this.volume = e.target.value;
|
||||||
|
this.$refs.player.volume = this.volume;
|
||||||
|
if(this.volume == 0){
|
||||||
|
this.muted = true;
|
||||||
|
}
|
||||||
|
if(this.muted && this.volume > 0){
|
||||||
|
this.muted = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
timelineClicked(e) {
|
||||||
|
rect = this.$refs.videoProgress.getBoundingClientRect();
|
||||||
|
pos = (e.pageX - rect.left) / this.$refs.videoProgress.offsetWidth;
|
||||||
|
this.$refs.player.currentTime = pos * this.$refs.player.duration;
|
||||||
|
},
|
||||||
|
handleFullscreen() {
|
||||||
|
if (document.fullscreenElement !== null) {
|
||||||
|
// The document is in fullscreen mode
|
||||||
|
document.exitFullscreen();
|
||||||
|
} else {
|
||||||
|
// The document is not in fullscreen mode
|
||||||
|
this.$refs.videoContainer.requestFullscreen();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mousemoveVideo() {
|
||||||
|
if(this.playing){
|
||||||
|
this.resetControlsTimeout();
|
||||||
|
} else {
|
||||||
|
this.controls=true;
|
||||||
|
clearTimeout(this.controlsHideTimeout);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
videoEnded() {
|
||||||
|
this.ended = true;
|
||||||
|
this.playing = false;
|
||||||
|
this.$refs.player.currentTime = 0;
|
||||||
|
},
|
||||||
|
resetControlsTimeout() {
|
||||||
|
this.controls = true;
|
||||||
|
clearTimeout(this.controlsHideTimeout);
|
||||||
|
let that = this;
|
||||||
|
this.controlsHideTimeout = setTimeout(function(){
|
||||||
|
that.controls=false
|
||||||
|
}, this.autoHideControlsDelay);
|
||||||
|
},
|
||||||
|
formatTime(timeInSeconds) {
|
||||||
|
result = new Date(timeInSeconds * 1000).toISOString().substring(11, 19);
|
||||||
|
return {
|
||||||
|
minutes: result.substring(3, 5),
|
||||||
|
seconds: result.substring(6, 8),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
x-data="introVideo"
|
||||||
|
x-ref="videoContainer"
|
||||||
|
@mouseleave="mouseleave=true"
|
||||||
|
@mousemove="mousemoveVideo"
|
||||||
|
class="relative h-[360px] min-w-[640px] overflow-hidden rounded-md aspect-video"
|
||||||
|
>
|
||||||
|
<video
|
||||||
|
x-ref="player"
|
||||||
|
@loadedmetadata="metaDataLoaded"
|
||||||
|
@timeupdate="timeUpdatedInterval"
|
||||||
|
@ended="videoEnded"
|
||||||
|
preload="metadata"
|
||||||
|
:poster="poster"
|
||||||
|
class="relative z-10 object-cover w-full h-full bg-black"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
>
|
||||||
|
<source :src="sources.mp4" type="video/mp4"/>
|
||||||
|
<source :src="sources.webm" type="video/webm"/>
|
||||||
|
<source :src="sources.ogg" type="video/ogg"/>
|
||||||
|
</video>
|
||||||
|
<div x-show="videoPlayerReady" class="absolute inset-0 w-full h-full">
|
||||||
|
<div x-ref="videoBackground" @click="togglePlay()" class="absolute inset-0 z-30 flex items-center justify-center w-full h-full bg-black bg-opacity-0 cursor-pointer group">
|
||||||
|
<div
|
||||||
|
x-show="playing"
|
||||||
|
x-transition:enter="transition ease-out duration-1000"
|
||||||
|
x-transition:enter-start="scale-50 opacity-100"
|
||||||
|
x-transition:enter-end="scale-100 opacity-0"
|
||||||
|
class="absolute z-20 flex items-center justify-center w-24 h-24 bg-blue-600 rounded-full opacity-0 bg-opacity-20"
|
||||||
|
x-cloak
|
||||||
|
>
|
||||||
|
<svg class="w-10 h-10 translate-x-0.5 text-white" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.42737 3.41611C6.46665 2.24586 4.00008 3.67188 4.00007 5.9427L4 18.0572C3.99999 20.329 6.46837 21.7549 8.42907 20.5828L18.5698 14.5207C20.4775 13.3802 20.4766 10.6076 18.568 9.46853L8.42737 3.41611Z" fill="currentColor"></path></svg>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
x-show="!playing && !ended"
|
||||||
|
x-transition:enter="transition ease-out duration-1000"
|
||||||
|
x-transition:enter-start="scale-50 opacity-100"
|
||||||
|
x-transition:enter-end="scale-100 opacity-0"
|
||||||
|
class="absolute z-20 flex items-center justify-center w-24 h-24 bg-blue-600 rounded-full opacity-0 bg-opacity-20"
|
||||||
|
x-cloak
|
||||||
|
>
|
||||||
|
<svg class="w-10 h-10 text-white" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 3C8.55228 3 9 3.44772 9 4L9 20C9 20.5523 8.55228 21 8 21C7.44772 21 7 20.5523 7 20L7 4C7 3.44772 7.44772 3 8 3ZM16 3C16.5523 3 17 3.44772 17 4V20C17 20.5523 16.5523 21 16 21C15.4477 21 15 20.5523 15 20V4C15 3.44772 15.4477 3 16 3Z" fill="currentColor"></path></svg>
|
||||||
|
</div>
|
||||||
|
<div class="absolute z-10 duration-300 ease-out group-hover:scale-110">
|
||||||
|
<button
|
||||||
|
x-show="!playing"
|
||||||
|
x-transition:enter="transition ease-in delay-200 duration-300"
|
||||||
|
x-transition:enter-start="opacity-0 scale-75"
|
||||||
|
x-transition:enter-end="opacity-100 scale-100"
|
||||||
|
x-transition:leave="transition ease-out duration-300"
|
||||||
|
x-transition:leave-start="opacity-100"
|
||||||
|
x-transition:leave-end="opacity-0"
|
||||||
|
class="flex items-center justify-center w-12 h-12 text-white duration-150 ease-out bg-blue-600 rounded-full cursor-pointer bg-opacity-80"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<svg class="w-5 h-5 translate-x-px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.42737 3.41611C6.46665 2.24586 4.00008 3.67188 4.00007 5.9427L4 18.0572C3.99999 20.329 6.46837 21.7549 8.42907 20.5828L18.5698 14.5207C20.4775 13.3802 20.4766 10.6076 18.568 9.46853L8.42737 3.41611Z" fill="currentColor" x-cloak></path></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
x-show="controls"
|
||||||
|
x-transition:enter="transition ease-out duration-300"
|
||||||
|
x-transition:enter-start="-translate-y-full"
|
||||||
|
x-transition:enter-end="translate-y-0"
|
||||||
|
x-transition:leave="transition ease-in duration-300"
|
||||||
|
x-transition:leave-start="translate-y-0"
|
||||||
|
x-transition:leave-end="-translate-y-full"
|
||||||
|
class="absolute top-0 left-0 z-20 w-full h-1/4 opacity-20 bg-gradient-to-b from-black to-transparent"
|
||||||
|
x-cloak
|
||||||
|
></div>
|
||||||
|
<div
|
||||||
|
x-show="controls"
|
||||||
|
x-transition:enter="transition ease-out duration-300"
|
||||||
|
x-transition:enter-start="translate-y-full"
|
||||||
|
x-transition:enter-end="translate-y-0"
|
||||||
|
x-transition:leave="transition ease-in duration-300"
|
||||||
|
x-transition:leave-start="translate-y-0"
|
||||||
|
x-transition:leave-end="translate-y-full"
|
||||||
|
class="absolute bottom-0 left-0 z-20 w-full h-1/4 opacity-20 bg-gradient-to-b from-transparent to-black"
|
||||||
|
x-cloak
|
||||||
|
></div>
|
||||||
|
<div
|
||||||
|
x-show="controls"
|
||||||
|
@click="resetControlsTimeout"
|
||||||
|
x-transition:enter="transition ease-out duration-300"
|
||||||
|
x-transition:enter-start="-translate-y-full"
|
||||||
|
x-transition:enter-end="translate-y-0"
|
||||||
|
x-transition:leave="transition ease-in duration-300"
|
||||||
|
x-transition:leave-start="translate-y-0"
|
||||||
|
x-transition:leave-end="-translate-y-full"
|
||||||
|
class="absolute top-0 left-0 z-40 flex items-center w-full h-12 text-white"
|
||||||
|
x-cloak
|
||||||
|
>
|
||||||
|
<div class="absolute right-0 top-0 mr-0.5 mt-0.5 flex items-center">
|
||||||
|
<div class="flex items-center h-auto group">
|
||||||
|
<button @click="toggleMute()" type="button" class="flex items-center justify-center w-6 h-auto duration-150 ease-out opacity-80 hover:opacity-100">
|
||||||
|
<svg x-show="!muted" class="w-[18px] h-[18px]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" x-cloak><path d="M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 001.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06zM18.584 5.106a.75.75 0 011.06 0c3.808 3.807 3.808 9.98 0 13.788a.75.75 0 11-1.06-1.06 8.25 8.25 0 000-11.668.75.75 0 010-1.06z"></path><path d="M15.932 7.757a.75.75 0 011.061 0 6 6 0 010 8.486.75.75 0 01-1.06-1.061 4.5 4.5 0 000-6.364.75.75 0 010-1.06z"></path></svg>
|
||||||
|
<svg x-show="muted" class="w-[18px] h-[18px]" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" x-cloak><path d="M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 001.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06zM17.78 9.22a.75.75 0 10-1.06 1.06L18.44 12l-1.72 1.72a.75.75 0 001.06 1.06l1.72-1.72 1.72 1.72a.75.75 0 101.06-1.06L20.56 12l1.72-1.72a.75.75 0 00-1.06-1.06l-1.72 1.72-1.72-1.72z"></path></svg>
|
||||||
|
</button>
|
||||||
|
<div class="relative h-1.5 mx-0 group-hover:mx-1 rounded-full group-hover:w-12 invisible group-hover:visible w-0 ease-out duration-300">
|
||||||
|
<input
|
||||||
|
x-ref="volume"
|
||||||
|
@input="updateVolume(event)"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="1"
|
||||||
|
:value="volume"
|
||||||
|
step="0.01"
|
||||||
|
class="w-full h-full appearance-none flex items-center cursor-pointer bg-transparent z-30
|
||||||
|
[&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:w-2 [&::-webkit-slider-thumb]:h-2 [&::-webkit-slider-thumb]:appearance-none
|
||||||
|
[&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:w-2 [&::-moz-range-thumb]:h-2 [&::-moz-range-thumb]:appearance-none
|
||||||
|
[&::-ms-thumb]:bg-white [&::-ms-thumb]:rounded-full [&::-ms-thumb]:border-0 [&::-ms-thumb]:w-2 [&::-ms-thumb]:h-2 [&::-ms-thumb]:appearance-none
|
||||||
|
[&::-webkit-slider-runnable-track]:bg-white [&::-webkit-slider-runnable-track]:bg-opacity-30 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:overflow-hidden [&::-moz-range-track]:bg-neutral-200 [&::-moz-range-track]:rounded-full [&::-ms-track]:bg-neutral-200 [&::-ms-track]:rounded-full
|
||||||
|
[&::-moz-range-progress]:bg-white [&::-moz-range-progress]:bg-opacity-80 [&::-moz-range-progress]:rounded-full [&::-ms-fill-lower]:bg-white [&::-ms-fill-lower]:bg-opacity-80 [&::-ms-fill-lower]:rounded-full [&::-webkit-slider-thumb]:shadow-[-995px_0px_0px_990px_rgba(255,_255,_255,_0.8)]
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button x-ref="fullscreenButton" @click="handleFullscreen" class="flex items-center justify-center w-10 h-10 duration-150 ease-out scale-90 opacity-80 hover:opacity-100 hover:scale-100" type="button">
|
||||||
|
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.72685 5C5.77328 5 5 5.77318 5 6.72727V9C5 9.55228 4.55228 10 4 10C3.44772 10 3 9.55228 3 9V6.72727C3 4.6689 4.66842 3 6.72685 3H9C9.55228 3 10 3.44772 10 4C10 4.55228 9.55228 5 9 5H6.72685ZM14 4C14 3.44772 14.4477 3 15 3H17.2727C19.3312 3 21 4.66876 21 6.72727V9C21 9.55228 20.5523 10 20 10C19.4477 10 19 9.55228 19 9V6.72727C19 5.77333 18.2267 5 17.2727 5H15C14.4477 5 14 4.55228 14 4ZM4 14C4.55228 14 5 14.4477 5 15V17.2727C5 18.2268 5.77328 19 6.72685 19H9C9.55228 19 10 19.4477 10 20C10 20.5523 9.55228 21 9 21H6.72685C4.66842 21 3 19.3311 3 17.2727V15C3 14.4477 3.44772 14 4 14ZM20 14C20.5523 14 21 14.4477 21 15V17.2727C21 19.3312 19.3312 21 17.2727 21H15C14.4477 21 14 20.5523 14 20C14 19.4477 14.4477 19 15 19H17.2727C18.2267 19 19 18.2267 19 17.2727V15C19 14.4477 19.4477 14 20 14Z" fill="currentColor"></path></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
x-show="controls"
|
||||||
|
@click="resetControlsTimeout"
|
||||||
|
x-transition:enter="transition ease-out duration-300"
|
||||||
|
x-transition:enter-start="translate-y-full"
|
||||||
|
x-transition:enter-end="translate-y-0"
|
||||||
|
x-transition:leave="transition ease-in duration-300"
|
||||||
|
x-transition:leave-start="translate-y-0"
|
||||||
|
x-transition:leave-end="translate-y-full"
|
||||||
|
class="absolute bottom-0 left-0 z-40 w-full h-12"
|
||||||
|
x-cloak
|
||||||
|
>
|
||||||
|
<div class="absolute bottom-0 z-30 w-full px-2.5 -translate-y-8">
|
||||||
|
<div class="relative w-full h-1 rounded-full">
|
||||||
|
<input
|
||||||
|
x-ref="videoProgress"
|
||||||
|
@click="timelineClicked"
|
||||||
|
@input="timelineSeek(event)"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
value="0"
|
||||||
|
step="any"
|
||||||
|
class="w-full h-full appearance-none flex items-center cursor-pointer bg-transparent z-30
|
||||||
|
[&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:w-1.5 [&::-webkit-slider-thumb]:h-1.5 [&::-webkit-slider-thumb]:appearance-none
|
||||||
|
[&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:w-1.5 [&::-moz-range-thumb]:h-1.5 [&::-moz-range-thumb]:appearance-none
|
||||||
|
[&::-ms-thumb]:bg-white [&::-ms-thumb]:rounded-full [&::-ms-thumb]:border-0 [&::-ms-thumb]:w-1.5 [&::-ms-thumb]:h-1.5 [&::-ms-thumb]:appearance-none
|
||||||
|
[&::-webkit-slider-runnable-track]:bg-white [&::-webkit-slider-runnable-track]:bg-opacity-30 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:overflow-hidden [&::-moz-range-track]:bg-neutral-200 [&::-moz-range-track]:rounded-full [&::-ms-track]:bg-neutral-200 [&::-ms-track]:rounded-full
|
||||||
|
[&::-moz-range-progress]:bg-blue-600 [&::-moz-range-progress]:rounded-full [&::-ms-fill-lower]:bg-blue-600 [&::-ms-fill-lower]:rounded-full [&::-webkit-slider-thumb]:shadow-[-995px_0px_0px_990px_#2463eb]
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="absolute bottom-0 left-0 z-20 flex items-center w-full h-8 text-white">
|
||||||
|
<div x-show="showTime" class="flex items-center justify-between w-full mx-3 font-mono text-xs opacity-80 hover:opacity-100" x-cloak>
|
||||||
|
<time x-ref="timeElapsed" x-text="timeElapsedString">00:00</time>
|
||||||
|
<time x-ref="timeDuration" x-text="timeDurationString">00:00</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,15 +1,40 @@
|
|||||||
package marketing
|
package marketing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/onsonr/sonr/internal/ctx"
|
||||||
"github.com/onsonr/sonr/pkg/nebula/components/marketing/sections"
|
"github.com/onsonr/sonr/pkg/nebula/components/marketing/sections"
|
||||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Home Routes - Marketing │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
func HomeRoute(c echo.Context) error {
|
||||||
|
s, err := ctx.GetHWAYContext(c)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Printf("Session ID: %s", s.ID())
|
||||||
|
return ctx.RenderTempl(c, View())
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Static Content Values │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// ╭─────────────────────────────────────────────────────────╮
|
||||||
|
// │ Final Rendering │
|
||||||
|
// ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// View renders the home page
|
||||||
templ View() {
|
templ View() {
|
||||||
@styles.LayoutNoBody("Sonr.ID", true) {
|
@styles.LayoutNoBody("Sonr.ID", true) {
|
||||||
@sections.Header()
|
@sections.Header()
|
||||||
@sections.Hero(hero)
|
@sections.Hero()
|
||||||
@sections.Highlights(highlights)
|
@sections.Highlights()
|
||||||
@sections.Mission()
|
@sections.Mission()
|
||||||
@sections.Architecture()
|
@sections.Architecture()
|
||||||
@sections.Lowlights()
|
@sections.Lowlights()
|
||||||
|
|||||||
@@ -9,10 +9,35 @@ import "github.com/a-h/templ"
|
|||||||
import templruntime "github.com/a-h/templ/runtime"
|
import templruntime "github.com/a-h/templ/runtime"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/onsonr/sonr/internal/ctx"
|
||||||
"github.com/onsonr/sonr/pkg/nebula/components/marketing/sections"
|
"github.com/onsonr/sonr/pkg/nebula/components/marketing/sections"
|
||||||
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
"github.com/onsonr/sonr/pkg/nebula/global/styles"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Home Routes - Marketing │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
func HomeRoute(c echo.Context) error {
|
||||||
|
s, err := ctx.GetHWAYContext(c)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Printf("Session ID: %s", s.ID())
|
||||||
|
return ctx.RenderTempl(c, View())
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Static Content Values │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// ╭─────────────────────────────────────────────────────────╮
|
||||||
|
// │ Final Rendering │
|
||||||
|
// ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// View renders the home page
|
||||||
func View() templ.Component {
|
func View() templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
@@ -54,7 +79,7 @@ func View() templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = sections.Hero(hero).Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = sections.Hero().Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -62,7 +87,7 @@ func View() templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = sections.Highlights(highlights).Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = sections.Highlights().Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package marketing
|
|
||||||
|
|
||||||
import (
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/internal/ctx"
|
|
||||||
)
|
|
||||||
|
|
||||||
func HomeRoute(c echo.Context) error {
|
|
||||||
s, err := ctx.GetHWAYContext(c)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
log.Printf("Session ID: %s", s.ID())
|
|
||||||
return ctx.RenderTempl(c, View())
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,67 @@
|
|||||||
package sections
|
package sections
|
||||||
|
|
||||||
|
import models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// architecture is the (4th) home page architecture section
|
||||||
|
var arch = &models.Architecture{
|
||||||
|
Heading: "Onchain Security with Offchain Privacy",
|
||||||
|
Subtitle: "Whenever you are ready, just hit publish to turn your site sketches into an actual designs. No creating, no skills, no reshaping.",
|
||||||
|
Primary: &models.Technology{
|
||||||
|
Title: "Decentralized Identity",
|
||||||
|
Desc: "Sonr leverages the latest specifications from W3C, DIF, and ICF to essentially have an Interchain-Connected, Smart Account System - seamlessly authenticated with PassKeys.",
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: HardwareWallet.Src(),
|
||||||
|
Width: "721",
|
||||||
|
Height: "280",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Secondary: &models.Technology{
|
||||||
|
Title: "IPFS Vaults",
|
||||||
|
Desc: "Completely distributed, encrypted, and decentralized storage for your data.",
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: DecentralizedNetwork.Src(),
|
||||||
|
Width: "342",
|
||||||
|
Height: "280",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Tertiary: &models.Technology{
|
||||||
|
Title: "Service Records",
|
||||||
|
Desc: "On-chain validated services created by Developers for secure transmission of user data.",
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: DefiDashboard.Src(),
|
||||||
|
Width: "342",
|
||||||
|
Height: "280",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Quaternary: &models.Technology{
|
||||||
|
Title: "Authentication & Authorization",
|
||||||
|
Desc: "Sonr leverages decentralized Macaroons and Multi-Party Computation to provide a secure and decentralized authentication and authorization system.",
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: PrivateKey.Src(),
|
||||||
|
Width: "342",
|
||||||
|
Height: "280",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Quinary: &models.Technology{
|
||||||
|
Title: "First-Class Exchange",
|
||||||
|
Desc: "Sonr integrates with the IBC protocol allowing for seamless integration with popular exchanges such as OKX, Binance, and Osmosis.",
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: CrossChainBridge.Src(),
|
||||||
|
Width: "342",
|
||||||
|
Height: "280",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// Architecture is the (4th) home page architecture section
|
||||||
templ Architecture() {
|
templ Architecture() {
|
||||||
<!-- Features #2 -->
|
<!-- Features #2 -->
|
||||||
<section>
|
<section>
|
||||||
@@ -11,12 +73,10 @@ templ Architecture() {
|
|||||||
<h2
|
<h2
|
||||||
class="font-inter-tight text-3xl md:text-4xl font-bold text-zinc-900 mb-4"
|
class="font-inter-tight text-3xl md:text-4xl font-bold text-zinc-900 mb-4"
|
||||||
>
|
>
|
||||||
Onchain Security with Offchain Privacy
|
{ arch.Heading }
|
||||||
</h2>
|
</h2>
|
||||||
<p class="text-lg text-zinc-500">
|
<p class="text-lg text-zinc-500">
|
||||||
Whenever you are ready, just hit publish to turn your site
|
{ arch.Subtitle }
|
||||||
sketches into an actual designs. No creating, no skills, no
|
|
||||||
reshaping.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -38,18 +98,17 @@ templ Architecture() {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
||||||
Decentralized Identity
|
{ arch.Primary.Title }
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="grow max-w-md text-sm text-zinc-500">
|
<p class="grow max-w-md text-sm text-zinc-500">
|
||||||
Create teams and organize your designs into folders using
|
{ arch.Primary.Desc }
|
||||||
project specs and insights.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<img
|
||||||
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
||||||
src="./images/feature-post-01.png"
|
src={ arch.Primary.Image.Src }
|
||||||
width="721"
|
width="721"
|
||||||
height="280"
|
height="280"
|
||||||
alt="Feature Post 01"
|
alt="Feature Post 01"
|
||||||
@@ -72,18 +131,17 @@ templ Architecture() {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
||||||
IPFS Vaults
|
{ arch.Secondary.Title }
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="grow max-w-md text-sm text-zinc-500">
|
<p class="grow max-w-md text-sm text-zinc-500">
|
||||||
Generate images and explore new ways of presenting your
|
{ arch.Secondary.Desc }
|
||||||
designs with AI.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<img
|
||||||
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
||||||
src="./images/feature-post-02.png"
|
src={ arch.Secondary.Image.Src }
|
||||||
width="342"
|
width="342"
|
||||||
height="280"
|
height="280"
|
||||||
alt="Feature Post 02"
|
alt="Feature Post 02"
|
||||||
@@ -106,18 +164,17 @@ templ Architecture() {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
||||||
Service Records
|
{ arch.Tertiary.Title }
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="grow max-w-md text-sm text-zinc-500">
|
<p class="grow max-w-md text-sm text-zinc-500">
|
||||||
Get your scenes inside your projects using simple embed
|
{ arch.Tertiary.Desc }
|
||||||
code/snippets.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<img
|
||||||
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
||||||
src="./images/feature-post-03.png"
|
src={ arch.Tertiary.Image.Src }
|
||||||
width="342"
|
width="342"
|
||||||
height="280"
|
height="280"
|
||||||
alt="Feature Post 03"
|
alt="Feature Post 03"
|
||||||
@@ -140,17 +197,17 @@ templ Architecture() {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
||||||
Authentication & Authorization
|
{ arch.Quaternary.Title }
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="grow max-w-md text-sm text-zinc-500">
|
<p class="grow max-w-md text-sm text-zinc-500">
|
||||||
Easily make drag and drop interactions without coding.
|
{ arch.Quaternary.Desc }
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<img
|
||||||
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
||||||
src="./images/feature-post-04.png"
|
src={ arch.Quaternary.Image.Src }
|
||||||
width="342"
|
width="342"
|
||||||
height="280"
|
height="280"
|
||||||
alt="Feature Post 04"
|
alt="Feature Post 04"
|
||||||
@@ -173,17 +230,17 @@ templ Architecture() {
|
|||||||
></path>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
<h3 class="font-inter-tight font-semibold text-zinc-900">
|
||||||
Decentralized Exchange
|
{ arch.Quinary.Title }
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="grow max-w-md text-sm text-zinc-500">
|
<p class="grow max-w-md text-sm text-zinc-500">
|
||||||
Create tasks, projects, issues and more in just seconds.
|
{ arch.Quinary.Desc }
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<img
|
||||||
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
class="h-[280px] object-cover object-left mx-auto sm:object-contain sm:h-auto"
|
||||||
src="./images/feature-post-05.png"
|
src={ arch.Quinary.Image.Src }
|
||||||
width="342"
|
width="342"
|
||||||
height="280"
|
height="280"
|
||||||
alt="Feature Post 05"
|
alt="Feature Post 05"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,32 @@
|
|||||||
package sections
|
package sections
|
||||||
|
|
||||||
|
import models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
var cta = &models.CallToAction{
|
||||||
|
Logo: &models.Image{
|
||||||
|
Src: "https://cdn.sonr.id/logo-zinc.svg",
|
||||||
|
Width: "60",
|
||||||
|
Height: "60",
|
||||||
|
},
|
||||||
|
Heading: "Take control of your Identity",
|
||||||
|
Subtitle: "Sonr is a decentralized, permissionless, and censorship-resistant identity network.",
|
||||||
|
Primary: &models.Button{
|
||||||
|
Href: "request-demo.html",
|
||||||
|
Text: "Register",
|
||||||
|
},
|
||||||
|
Secondary: &models.Button{
|
||||||
|
Href: "#0",
|
||||||
|
Text: "Learn More",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
templ CallToAction() {
|
templ CallToAction() {
|
||||||
<section>
|
<section>
|
||||||
<div class="py-12 md:py-20">
|
<div class="py-12 md:py-20">
|
||||||
|
|||||||
@@ -8,6 +8,33 @@ package sections
|
|||||||
import "github.com/a-h/templ"
|
import "github.com/a-h/templ"
|
||||||
import templruntime "github.com/a-h/templ/runtime"
|
import templruntime "github.com/a-h/templ/runtime"
|
||||||
|
|
||||||
|
import models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
var cta = &models.CallToAction{
|
||||||
|
Logo: &models.Image{
|
||||||
|
Src: "https://cdn.sonr.id/logo-zinc.svg",
|
||||||
|
Width: "60",
|
||||||
|
Height: "60",
|
||||||
|
},
|
||||||
|
Heading: "Take control of your Identity",
|
||||||
|
Subtitle: "Sonr is a decentralized, permissionless, and censorship-resistant identity network.",
|
||||||
|
Primary: &models.Button{
|
||||||
|
Href: "request-demo.html",
|
||||||
|
Text: "Register",
|
||||||
|
},
|
||||||
|
Secondary: &models.Button{
|
||||||
|
Href: "#0",
|
||||||
|
Text: "Learn More",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
func CallToAction() templ.Component {
|
func CallToAction() templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
|
|||||||
@@ -6,7 +6,37 @@ import (
|
|||||||
"github.com/onsonr/sonr/pkg/nebula/global/ui"
|
"github.com/onsonr/sonr/pkg/nebula/global/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
templ Hero(hero *models.Hero) {
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// hero is the (1st) home page hero section
|
||||||
|
var hero = &models.Hero{
|
||||||
|
TitleFirst: "Simplified",
|
||||||
|
TitleEmphasis: "self-custody",
|
||||||
|
TitleSecond: "for everyone",
|
||||||
|
Subtitle: "Sonr is a modern re-imagination of online user identity, empowering users to take ownership of their digital footprint and unlocking a new era of self-sovereignty.",
|
||||||
|
PrimaryButton: &models.Button{Text: "Get Started", Href: "/register"},
|
||||||
|
SecondaryButton: &models.Button{Text: "Learn More", Href: "/about"},
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: "https://cdn.sonr.id/img/hero-clipped.svg",
|
||||||
|
Width: "500",
|
||||||
|
Height: "500",
|
||||||
|
},
|
||||||
|
Stats: []*models.Stat{
|
||||||
|
{Value: "476", Label: "Tradeable Crypto Assets", Denom: "+"},
|
||||||
|
{Value: "1.44", Label: "Verified Identities", Denom: "K"},
|
||||||
|
{Value: "1.5", Label: "Encrypted Messages Sent", Denom: "M+"},
|
||||||
|
{Value: "50", Label: "Decentralized Global Nodes", Denom: "+"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// Hero Section
|
||||||
|
templ Hero() {
|
||||||
<!-- Hero -->
|
<!-- Hero -->
|
||||||
<section class="relative before:absolute before:inset-0 before:h-80 before:pointer-events-none before:bg-gradient-to-b before:from-zinc-100 before:-z-10">
|
<section class="relative before:absolute before:inset-0 before:h-80 before:pointer-events-none before:bg-gradient-to-b before:from-zinc-100 before:-z-10">
|
||||||
<div class="pt-32 pb-12 md:pt-40 md:pb-20">
|
<div class="pt-32 pb-12 md:pt-40 md:pb-20">
|
||||||
@@ -14,16 +44,7 @@ templ Hero(hero *models.Hero) {
|
|||||||
<div class="px-4 sm:px-6">
|
<div class="px-4 sm:px-6">
|
||||||
<div class="max-w-3xl mx-auto">
|
<div class="max-w-3xl mx-auto">
|
||||||
<div class="text-center pb-12 md:pb-16">
|
<div class="text-center pb-12 md:pb-16">
|
||||||
<h1 class="font-inter-tight text-4xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-zinc-500 via-zinc-900 to-zinc-900 pb-4">
|
@heroTitle(hero.TitleFirst, hero.TitleEmphasis, hero.TitleSecond)
|
||||||
{ hero.TitleFirst }
|
|
||||||
<em class="italic relative inline-flex justify-center items-center text-zinc-900">
|
|
||||||
{ hero.TitleEmphasis }
|
|
||||||
<svg class="absolute fill-zinc-300 w-[calc(100%+1rem)] -z-10" xmlns="http://www.w3.org/2000/svg" width="223" height="62" viewBox="0 0 223 62" aria-hidden="true" preserveAspectRatio="none">
|
|
||||||
<path d="M45.654 53.62c17.666 3.154 35.622 4.512 53.558 4.837 17.94.288 35.91-.468 53.702-2.54 8.89-1.062 17.742-2.442 26.455-4.352 8.684-1.945 17.338-4.3 25.303-7.905 3.94-1.81 7.79-3.962 10.634-6.777 1.38-1.41 2.424-2.994 2.758-4.561.358-1.563-.078-3.143-1.046-4.677-.986-1.524-2.43-2.96-4.114-4.175a37.926 37.926 0 0 0-5.422-3.32c-3.84-1.977-7.958-3.563-12.156-4.933-8.42-2.707-17.148-4.653-25.95-6.145-8.802-1.52-17.702-2.56-26.622-3.333-17.852-1.49-35.826-1.776-53.739-.978-8.953.433-17.898 1.125-26.79 2.22-8.887 1.095-17.738 2.541-26.428 4.616-4.342 1.037-8.648 2.226-12.853 3.676-4.197 1.455-8.314 3.16-12.104 5.363-1.862 1.13-3.706 2.333-5.218 3.829-1.52 1.47-2.79 3.193-3.285 5.113-.528 1.912-.127 3.965.951 5.743 1.07 1.785 2.632 3.335 4.348 4.68 2.135 1.652 3.2 2.672 2.986 3.083-.18.362-1.674.114-4.08-1.638-1.863-1.387-3.63-3.014-4.95-5.09C.94 35.316.424 34.148.171 32.89c-.275-1.253-.198-2.579.069-3.822.588-2.515 2.098-4.582 3.76-6.276 1.673-1.724 3.612-3.053 5.57-4.303 3.96-2.426 8.177-4.278 12.457-5.868 4.287-1.584 8.654-2.89 13.054-4.036 8.801-2.292 17.74-3.925 26.716-5.19C70.777 2.131 79.805 1.286 88.846.723c18.087-1.065 36.236-.974 54.325.397 9.041.717 18.07 1.714 27.042 3.225 8.972 1.485 17.895 3.444 26.649 6.253 4.37 1.426 8.697 3.083 12.878 5.243a42.11 42.11 0 0 1 6.094 3.762c1.954 1.44 3.823 3.2 5.283 5.485a12.515 12.515 0 0 1 1.63 3.88c.164.706.184 1.463.253 2.193-.063.73-.094 1.485-.247 2.195-.652 2.886-2.325 5.141-4.09 6.934-3.635 3.533-7.853 5.751-12.083 7.688-8.519 3.778-17.394 6.09-26.296 7.998-8.917 1.86-17.913 3.152-26.928 4.104-18.039 1.851-36.17 2.295-54.239 1.622-18.062-.713-36.112-2.535-53.824-6.23-5.941-1.31-5.217-2.91.361-1.852"></path>
|
|
||||||
</svg>
|
|
||||||
</em>
|
|
||||||
{ hero.TitleSecond }
|
|
||||||
</h1>
|
|
||||||
<p class="text-lg text-zinc-500 mb-8">
|
<p class="text-lg text-zinc-500 mb-8">
|
||||||
{ hero.Subtitle }
|
{ hero.Subtitle }
|
||||||
</p>
|
</p>
|
||||||
@@ -40,6 +61,19 @@ templ Hero(hero *models.Hero) {
|
|||||||
</section>
|
</section>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
templ heroTitle(first string, emphasis string, second string) {
|
||||||
|
<h1 class="font-inter-tight text-4xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-zinc-500 via-zinc-900 to-zinc-900 pb-4">
|
||||||
|
{ first }
|
||||||
|
<em class="italic relative inline-flex justify-center items-center text-zinc-900">
|
||||||
|
{ emphasis }
|
||||||
|
<svg class="absolute fill-zinc-300 w-[calc(100%+1rem)] -z-10" xmlns="http://www.w3.org/2000/svg" width="223" height="62" viewBox="0 0 223 62" aria-hidden="true" preserveAspectRatio="none">
|
||||||
|
<path d="M45.654 53.62c17.666 3.154 35.622 4.512 53.558 4.837 17.94.288 35.91-.468 53.702-2.54 8.89-1.062 17.742-2.442 26.455-4.352 8.684-1.945 17.338-4.3 25.303-7.905 3.94-1.81 7.79-3.962 10.634-6.777 1.38-1.41 2.424-2.994 2.758-4.561.358-1.563-.078-3.143-1.046-4.677-.986-1.524-2.43-2.96-4.114-4.175a37.926 37.926 0 0 0-5.422-3.32c-3.84-1.977-7.958-3.563-12.156-4.933-8.42-2.707-17.148-4.653-25.95-6.145-8.802-1.52-17.702-2.56-26.622-3.333-17.852-1.49-35.826-1.776-53.739-.978-8.953.433-17.898 1.125-26.79 2.22-8.887 1.095-17.738 2.541-26.428 4.616-4.342 1.037-8.648 2.226-12.853 3.676-4.197 1.455-8.314 3.16-12.104 5.363-1.862 1.13-3.706 2.333-5.218 3.829-1.52 1.47-2.79 3.193-3.285 5.113-.528 1.912-.127 3.965.951 5.743 1.07 1.785 2.632 3.335 4.348 4.68 2.135 1.652 3.2 2.672 2.986 3.083-.18.362-1.674.114-4.08-1.638-1.863-1.387-3.63-3.014-4.95-5.09C.94 35.316.424 34.148.171 32.89c-.275-1.253-.198-2.579.069-3.822.588-2.515 2.098-4.582 3.76-6.276 1.673-1.724 3.612-3.053 5.57-4.303 3.96-2.426 8.177-4.278 12.457-5.868 4.287-1.584 8.654-2.89 13.054-4.036 8.801-2.292 17.74-3.925 26.716-5.19C70.777 2.131 79.805 1.286 88.846.723c18.087-1.065 36.236-.974 54.325.397 9.041.717 18.07 1.714 27.042 3.225 8.972 1.485 17.895 3.444 26.649 6.253 4.37 1.426 8.697 3.083 12.878 5.243a42.11 42.11 0 0 1 6.094 3.762c1.954 1.44 3.823 3.2 5.283 5.485a12.515 12.515 0 0 1 1.63 3.88c.164.706.184 1.463.253 2.193-.063.73-.094 1.485-.247 2.195-.652 2.886-2.325 5.141-4.09 6.934-3.635 3.533-7.853 5.751-12.083 7.688-8.519 3.778-17.394 6.09-26.296 7.998-8.917 1.86-17.913 3.152-26.928 4.104-18.039 1.851-36.17 2.295-54.239 1.622-18.062-.713-36.112-2.535-53.824-6.23-5.941-1.31-5.217-2.91.361-1.852"></path>
|
||||||
|
</svg>
|
||||||
|
</em>
|
||||||
|
{ second }
|
||||||
|
</h1>
|
||||||
|
}
|
||||||
|
|
||||||
templ heroImage(hero *models.Hero) {
|
templ heroImage(hero *models.Hero) {
|
||||||
<!-- Image -->
|
<!-- Image -->
|
||||||
<div class="max-w-5xl motion-preset-slide-up motion-opacity-in-0 motion-scale-in-50 mx-auto px-4 sm:px-6 flex justify-center pb-12 md:pb-20 relative before:absolute before:-top-12 before:w-96 before:h-96 before:bg-zinc-900 before:opacity-[.15] before:rounded-full before:blur-3xl before:-z-10 from-zinc-100 to-white">
|
<div class="max-w-5xl motion-preset-slide-up motion-opacity-in-0 motion-scale-in-50 mx-auto px-4 sm:px-6 flex justify-center pb-12 md:pb-20 relative before:absolute before:-top-12 before:w-96 before:h-96 before:bg-zinc-900 before:opacity-[.15] before:rounded-full before:blur-3xl before:-z-10 from-zinc-100 to-white">
|
||||||
|
|||||||
@@ -14,7 +14,37 @@ import (
|
|||||||
"github.com/onsonr/sonr/pkg/nebula/global/ui"
|
"github.com/onsonr/sonr/pkg/nebula/global/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Hero(hero *models.Hero) templ.Component {
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// hero is the (1st) home page hero section
|
||||||
|
var hero = &models.Hero{
|
||||||
|
TitleFirst: "Simplified",
|
||||||
|
TitleEmphasis: "self-custody",
|
||||||
|
TitleSecond: "for everyone",
|
||||||
|
Subtitle: "Sonr is a modern re-imagination of online user identity, empowering users to take ownership of their digital footprint and unlocking a new era of self-sovereignty.",
|
||||||
|
PrimaryButton: &models.Button{Text: "Get Started", Href: "/register"},
|
||||||
|
SecondaryButton: &models.Button{Text: "Learn More", Href: "/about"},
|
||||||
|
Image: &models.Image{
|
||||||
|
Src: "https://cdn.sonr.id/img/hero-clipped.svg",
|
||||||
|
Width: "500",
|
||||||
|
Height: "500",
|
||||||
|
},
|
||||||
|
Stats: []*models.Stat{
|
||||||
|
{Value: "476", Label: "Tradeable Crypto Assets", Denom: "+"},
|
||||||
|
{Value: "1.44", Label: "Verified Identities", Denom: "K"},
|
||||||
|
{Value: "1.5", Label: "Encrypted Messages Sent", Denom: "M+"},
|
||||||
|
{Value: "50", Label: "Decentralized Global Nodes", Denom: "+"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// Hero Section
|
||||||
|
func Hero() templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||||
@@ -35,58 +65,27 @@ func Hero(hero *models.Hero) templ.Component {
|
|||||||
templ_7745c5c3_Var1 = templ.NopComponent
|
templ_7745c5c3_Var1 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Hero --><section class=\"relative before:absolute before:inset-0 before:h-80 before:pointer-events-none before:bg-gradient-to-b before:from-zinc-100 before:-z-10\"><div class=\"pt-32 pb-12 md:pt-40 md:pb-20\"><!-- Section content --><div class=\"px-4 sm:px-6\"><div class=\"max-w-3xl mx-auto\"><div class=\"text-center pb-12 md:pb-16\"><h1 class=\"font-inter-tight text-4xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-zinc-500 via-zinc-900 to-zinc-900 pb-4\">")
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Hero --><section class=\"relative before:absolute before:inset-0 before:h-80 before:pointer-events-none before:bg-gradient-to-b before:from-zinc-100 before:-z-10\"><div class=\"pt-32 pb-12 md:pt-40 md:pb-20\"><!-- Section content --><div class=\"px-4 sm:px-6\"><div class=\"max-w-3xl mx-auto\"><div class=\"text-center pb-12 md:pb-16\">")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
templ_7745c5c3_Err = heroTitle(hero.TitleFirst, hero.TitleEmphasis, hero.TitleSecond).Render(ctx, templ_7745c5c3_Buffer)
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p class=\"text-lg text-zinc-500 mb-8\">")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var2 string
|
var templ_7745c5c3_Var2 string
|
||||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleFirst)
|
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Subtitle)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 18, Col: 24}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 49, Col: 22}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <em class=\"italic relative inline-flex justify-center items-center text-zinc-900\">")
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
var templ_7745c5c3_Var3 string
|
|
||||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleEmphasis)
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 20, Col: 28}
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <svg class=\"absolute fill-zinc-300 w-[calc(100%+1rem)] -z-10\" xmlns=\"http://www.w3.org/2000/svg\" width=\"223\" height=\"62\" viewBox=\"0 0 223 62\" aria-hidden=\"true\" preserveAspectRatio=\"none\"><path d=\"M45.654 53.62c17.666 3.154 35.622 4.512 53.558 4.837 17.94.288 35.91-.468 53.702-2.54 8.89-1.062 17.742-2.442 26.455-4.352 8.684-1.945 17.338-4.3 25.303-7.905 3.94-1.81 7.79-3.962 10.634-6.777 1.38-1.41 2.424-2.994 2.758-4.561.358-1.563-.078-3.143-1.046-4.677-.986-1.524-2.43-2.96-4.114-4.175a37.926 37.926 0 0 0-5.422-3.32c-3.84-1.977-7.958-3.563-12.156-4.933-8.42-2.707-17.148-4.653-25.95-6.145-8.802-1.52-17.702-2.56-26.622-3.333-17.852-1.49-35.826-1.776-53.739-.978-8.953.433-17.898 1.125-26.79 2.22-8.887 1.095-17.738 2.541-26.428 4.616-4.342 1.037-8.648 2.226-12.853 3.676-4.197 1.455-8.314 3.16-12.104 5.363-1.862 1.13-3.706 2.333-5.218 3.829-1.52 1.47-2.79 3.193-3.285 5.113-.528 1.912-.127 3.965.951 5.743 1.07 1.785 2.632 3.335 4.348 4.68 2.135 1.652 3.2 2.672 2.986 3.083-.18.362-1.674.114-4.08-1.638-1.863-1.387-3.63-3.014-4.95-5.09C.94 35.316.424 34.148.171 32.89c-.275-1.253-.198-2.579.069-3.822.588-2.515 2.098-4.582 3.76-6.276 1.673-1.724 3.612-3.053 5.57-4.303 3.96-2.426 8.177-4.278 12.457-5.868 4.287-1.584 8.654-2.89 13.054-4.036 8.801-2.292 17.74-3.925 26.716-5.19C70.777 2.131 79.805 1.286 88.846.723c18.087-1.065 36.236-.974 54.325.397 9.041.717 18.07 1.714 27.042 3.225 8.972 1.485 17.895 3.444 26.649 6.253 4.37 1.426 8.697 3.083 12.878 5.243a42.11 42.11 0 0 1 6.094 3.762c1.954 1.44 3.823 3.2 5.283 5.485a12.515 12.515 0 0 1 1.63 3.88c.164.706.184 1.463.253 2.193-.063.73-.094 1.485-.247 2.195-.652 2.886-2.325 5.141-4.09 6.934-3.635 3.533-7.853 5.751-12.083 7.688-8.519 3.778-17.394 6.09-26.296 7.998-8.917 1.86-17.913 3.152-26.928 4.104-18.039 1.851-36.17 2.295-54.239 1.622-18.062-.713-36.112-2.535-53.824-6.23-5.941-1.31-5.217-2.91.361-1.852\"></path></svg></em> ")
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
var templ_7745c5c3_Var4 string
|
|
||||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleSecond)
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 25, Col: 25}
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h1><p class=\"text-lg text-zinc-500 mb-8\">")
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
var templ_7745c5c3_Var5 string
|
|
||||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Subtitle)
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 28, Col: 22}
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"max-w-xs mx-auto sm:max-w-none sm:inline-flex sm:justify-center space-y-4 sm:space-y-0 sm:space-x-4\">")
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"max-w-xs mx-auto sm:max-w-none sm:inline-flex sm:justify-center space-y-4 sm:space-y-0 sm:space-x-4\">")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
@@ -119,6 +118,74 @@ func Hero(hero *models.Hero) templ.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func heroTitle(first string, emphasis string, second string) templ.Component {
|
||||||
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||||
|
return templ_7745c5c3_CtxErr
|
||||||
|
}
|
||||||
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||||
|
if !templ_7745c5c3_IsBuffer {
|
||||||
|
defer func() {
|
||||||
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||||
|
if templ_7745c5c3_Err == nil {
|
||||||
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
ctx = templ.InitializeContext(ctx)
|
||||||
|
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||||
|
if templ_7745c5c3_Var3 == nil {
|
||||||
|
templ_7745c5c3_Var3 = templ.NopComponent
|
||||||
|
}
|
||||||
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h1 class=\"font-inter-tight text-4xl md:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-zinc-500 via-zinc-900 to-zinc-900 pb-4\">")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
var templ_7745c5c3_Var4 string
|
||||||
|
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(first)
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 66, Col: 9}
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <em class=\"italic relative inline-flex justify-center items-center text-zinc-900\">")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
var templ_7745c5c3_Var5 string
|
||||||
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(emphasis)
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 68, Col: 13}
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <svg class=\"absolute fill-zinc-300 w-[calc(100%+1rem)] -z-10\" xmlns=\"http://www.w3.org/2000/svg\" width=\"223\" height=\"62\" viewBox=\"0 0 223 62\" aria-hidden=\"true\" preserveAspectRatio=\"none\"><path d=\"M45.654 53.62c17.666 3.154 35.622 4.512 53.558 4.837 17.94.288 35.91-.468 53.702-2.54 8.89-1.062 17.742-2.442 26.455-4.352 8.684-1.945 17.338-4.3 25.303-7.905 3.94-1.81 7.79-3.962 10.634-6.777 1.38-1.41 2.424-2.994 2.758-4.561.358-1.563-.078-3.143-1.046-4.677-.986-1.524-2.43-2.96-4.114-4.175a37.926 37.926 0 0 0-5.422-3.32c-3.84-1.977-7.958-3.563-12.156-4.933-8.42-2.707-17.148-4.653-25.95-6.145-8.802-1.52-17.702-2.56-26.622-3.333-17.852-1.49-35.826-1.776-53.739-.978-8.953.433-17.898 1.125-26.79 2.22-8.887 1.095-17.738 2.541-26.428 4.616-4.342 1.037-8.648 2.226-12.853 3.676-4.197 1.455-8.314 3.16-12.104 5.363-1.862 1.13-3.706 2.333-5.218 3.829-1.52 1.47-2.79 3.193-3.285 5.113-.528 1.912-.127 3.965.951 5.743 1.07 1.785 2.632 3.335 4.348 4.68 2.135 1.652 3.2 2.672 2.986 3.083-.18.362-1.674.114-4.08-1.638-1.863-1.387-3.63-3.014-4.95-5.09C.94 35.316.424 34.148.171 32.89c-.275-1.253-.198-2.579.069-3.822.588-2.515 2.098-4.582 3.76-6.276 1.673-1.724 3.612-3.053 5.57-4.303 3.96-2.426 8.177-4.278 12.457-5.868 4.287-1.584 8.654-2.89 13.054-4.036 8.801-2.292 17.74-3.925 26.716-5.19C70.777 2.131 79.805 1.286 88.846.723c18.087-1.065 36.236-.974 54.325.397 9.041.717 18.07 1.714 27.042 3.225 8.972 1.485 17.895 3.444 26.649 6.253 4.37 1.426 8.697 3.083 12.878 5.243a42.11 42.11 0 0 1 6.094 3.762c1.954 1.44 3.823 3.2 5.283 5.485a12.515 12.515 0 0 1 1.63 3.88c.164.706.184 1.463.253 2.193-.063.73-.094 1.485-.247 2.195-.652 2.886-2.325 5.141-4.09 6.934-3.635 3.533-7.853 5.751-12.083 7.688-8.519 3.778-17.394 6.09-26.296 7.998-8.917 1.86-17.913 3.152-26.928 4.104-18.039 1.851-36.17 2.295-54.239 1.622-18.062-.713-36.112-2.535-53.824-6.23-5.941-1.31-5.217-2.91.361-1.852\"></path></svg></em> ")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
var templ_7745c5c3_Var6 string
|
||||||
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(second)
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 73, Col: 10}
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h1>")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func heroImage(hero *models.Hero) templ.Component {
|
func heroImage(hero *models.Hero) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
@@ -135,21 +202,21 @@ func heroImage(hero *models.Hero) templ.Component {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
ctx = templ.InitializeContext(ctx)
|
ctx = templ.InitializeContext(ctx)
|
||||||
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
|
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
|
||||||
if templ_7745c5c3_Var6 == nil {
|
if templ_7745c5c3_Var7 == nil {
|
||||||
templ_7745c5c3_Var6 = templ.NopComponent
|
templ_7745c5c3_Var7 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Image --><div class=\"max-w-5xl motion-preset-slide-up motion-opacity-in-0 motion-scale-in-50 mx-auto px-4 sm:px-6 flex justify-center pb-12 md:pb-20 relative before:absolute before:-top-12 before:w-96 before:h-96 before:bg-zinc-900 before:opacity-[.15] before:rounded-full before:blur-3xl before:-z-10 from-zinc-100 to-white\"><img class=\"rounded-lg \" src=\"")
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Image --><div class=\"max-w-5xl motion-preset-slide-up motion-opacity-in-0 motion-scale-in-50 mx-auto px-4 sm:px-6 flex justify-center pb-12 md:pb-20 relative before:absolute before:-top-12 before:w-96 before:h-96 before:bg-zinc-900 before:opacity-[.15] before:rounded-full before:blur-3xl before:-z-10 from-zinc-100 to-white\"><img class=\"rounded-lg \" src=\"")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var7 string
|
var templ_7745c5c3_Var8 string
|
||||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Src)
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Src)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 48, Col: 23}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 82, Col: 23}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -157,12 +224,12 @@ func heroImage(hero *models.Hero) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var8 string
|
var templ_7745c5c3_Var9 string
|
||||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Width)
|
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Width)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 49, Col: 27}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 83, Col: 27}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -170,12 +237,12 @@ func heroImage(hero *models.Hero) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var9 string
|
var templ_7745c5c3_Var10 string
|
||||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Height)
|
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Image.Height)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 50, Col: 29}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 84, Col: 29}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -203,9 +270,9 @@ func stats(stats []*models.Stat) templ.Component {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
ctx = templ.InitializeContext(ctx)
|
ctx = templ.InitializeContext(ctx)
|
||||||
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
|
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
|
||||||
if templ_7745c5c3_Var10 == nil {
|
if templ_7745c5c3_Var11 == nil {
|
||||||
templ_7745c5c3_Var10 = templ.NopComponent
|
templ_7745c5c3_Var11 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Stats --><div class=\"max-w-4xl mx-auto px-4 sm:px-6 justify-center items-center\"><div class=\"max-w-sm mx-auto grid gap-12 sm:grid-cols-2 md:grid-cols-4 md:-mx-5 md:gap-0 items-end md:max-w-none\">")
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Stats --><div class=\"max-w-4xl mx-auto px-4 sm:px-6 justify-center items-center\"><div class=\"max-w-sm mx-auto grid gap-12 sm:grid-cols-2 md:grid-cols-4 md:-mx-5 md:gap-0 items-end md:max-w-none\">")
|
||||||
@@ -217,12 +284,12 @@ func stats(stats []*models.Stat) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var11 string
|
var templ_7745c5c3_Var12 string
|
||||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(counterXData(item.Value))
|
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(counterXData(item.Value))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 62, Col: 122}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 96, Col: 122}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -230,12 +297,12 @@ func stats(stats []*models.Stat) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var12 string
|
var templ_7745c5c3_Var13 string
|
||||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(item.Value)
|
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(item.Value)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 62, Col: 159}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 96, Col: 159}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -243,12 +310,12 @@ func stats(stats []*models.Stat) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var13 string
|
var templ_7745c5c3_Var14 string
|
||||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(item.Denom)
|
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(item.Denom)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 62, Col: 180}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 96, Col: 180}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -256,12 +323,12 @@ func stats(stats []*models.Stat) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var14 string
|
var templ_7745c5c3_Var15 string
|
||||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label)
|
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 63, Col: 50}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/hero.templ`, Line: 97, Col: 50}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,42 @@ import (
|
|||||||
models "github.com/onsonr/sonr/internal/orm/marketing"
|
models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
)
|
)
|
||||||
|
|
||||||
templ Highlights(highlights *models.Highlights) {
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// highlights is the (2nd) home page highlights section
|
||||||
|
var highlights = &models.Highlights{
|
||||||
|
Heading: "The Internet Rebuilt for You",
|
||||||
|
Subtitle: "Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while providing Developers a cost-effective solution for decentralized authentication.",
|
||||||
|
Features: []*models.Feature{
|
||||||
|
{
|
||||||
|
Title: "∞ Factor Auth",
|
||||||
|
Desc: "Sonr is designed to work across all platforms and devices, building a encrypted and anonymous identity layer for each user on the internet.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Control Your Data",
|
||||||
|
Desc: "Sonr leverages advanced cryptography to permit facilitating Wallet Operations directly on-chain, without the need for a centralized server.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Crypto Enabled",
|
||||||
|
Desc: "Sonr follows the latest specifications from W3C, DIF, and ICF to essentially have an Interchain-Connected, Smart Account System - seamlessly authenticated with PassKeys.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Works Everywhere",
|
||||||
|
Desc: "Sonr anonymously associates your online identities with a Quantum-Resistant Vault which only you can access.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
templ Highlights() {
|
||||||
<!-- Features -->
|
<!-- Features -->
|
||||||
<section class="relative bg-zinc-50">
|
<section class="relative bg-zinc-50">
|
||||||
<div class="py-12 md:py-20">
|
<div class="py-12 md:py-20">
|
||||||
|
|||||||
@@ -13,7 +13,42 @@ import (
|
|||||||
models "github.com/onsonr/sonr/internal/orm/marketing"
|
models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Highlights(highlights *models.Highlights) templ.Component {
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// highlights is the (2nd) home page highlights section
|
||||||
|
var highlights = &models.Highlights{
|
||||||
|
Heading: "The Internet Rebuilt for You",
|
||||||
|
Subtitle: "Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while providing Developers a cost-effective solution for decentralized authentication.",
|
||||||
|
Features: []*models.Feature{
|
||||||
|
{
|
||||||
|
Title: "∞ Factor Auth",
|
||||||
|
Desc: "Sonr is designed to work across all platforms and devices, building a encrypted and anonymous identity layer for each user on the internet.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Control Your Data",
|
||||||
|
Desc: "Sonr leverages advanced cryptography to permit facilitating Wallet Operations directly on-chain, without the need for a centralized server.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Crypto Enabled",
|
||||||
|
Desc: "Sonr follows the latest specifications from W3C, DIF, and ICF to essentially have an Interchain-Connected, Smart Account System - seamlessly authenticated with PassKeys.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Works Everywhere",
|
||||||
|
Desc: "Sonr anonymously associates your online identities with a Quantum-Resistant Vault which only you can access.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
func Highlights() templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||||
@@ -41,7 +76,7 @@ func Highlights(highlights *models.Highlights) templ.Component {
|
|||||||
var templ_7745c5c3_Var2 string
|
var templ_7745c5c3_Var2 string
|
||||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(highlights.Heading)
|
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(highlights.Heading)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 17, Col: 26}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 52, Col: 26}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -54,7 +89,7 @@ func Highlights(highlights *models.Highlights) templ.Component {
|
|||||||
var templ_7745c5c3_Var3 string
|
var templ_7745c5c3_Var3 string
|
||||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(highlights.Subtitle)
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(highlights.Subtitle)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 20, Col: 27}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 55, Col: 27}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -116,7 +151,7 @@ func highlightTab(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var5 string
|
var templ_7745c5c3_Var5 string
|
||||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(getSelectedClass(index))
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(getSelectedClass(index))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 39, Col: 34}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 74, Col: 34}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -129,7 +164,7 @@ func highlightTab(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var6 string
|
var templ_7745c5c3_Var6 string
|
||||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(getClickPrevent(index))
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(getClickPrevent(index))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 41, Col: 41}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 76, Col: 41}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -142,7 +177,7 @@ func highlightTab(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var7 string
|
var templ_7745c5c3_Var7 string
|
||||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Title)
|
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Title)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 45, Col: 21}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 80, Col: 21}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -155,7 +190,7 @@ func highlightTab(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var8 string
|
var templ_7745c5c3_Var8 string
|
||||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(getShowBorder(index))
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(getShowBorder(index))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 48, Col: 33}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 83, Col: 33}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -168,7 +203,7 @@ func highlightTab(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var9 string
|
var templ_7745c5c3_Var9 string
|
||||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Desc)
|
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Desc)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 60, Col: 19}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 95, Col: 19}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -210,7 +245,7 @@ func highlightCard(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var11 string
|
var templ_7745c5c3_Var11 string
|
||||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(getXShow(index))
|
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(getXShow(index))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 68, Col: 26}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 103, Col: 26}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -223,7 +258,7 @@ func highlightCard(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var12 string
|
var templ_7745c5c3_Var12 string
|
||||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Image.Src)
|
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Image.Src)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 79, Col: 29}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 114, Col: 29}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -236,7 +271,7 @@ func highlightCard(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var13 string
|
var templ_7745c5c3_Var13 string
|
||||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Image.Width)
|
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Image.Width)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 80, Col: 33}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 115, Col: 33}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -249,7 +284,7 @@ func highlightCard(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var14 string
|
var templ_7745c5c3_Var14 string
|
||||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Image.Height)
|
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Image.Height)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 81, Col: 35}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 116, Col: 35}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -262,7 +297,7 @@ func highlightCard(index int, highlight *models.Feature) templ.Component {
|
|||||||
var templ_7745c5c3_Var15 string
|
var templ_7745c5c3_Var15 string
|
||||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Title)
|
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(highlight.Title)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 82, Col: 25}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/marketing/sections/highlights.templ`, Line: 117, Col: 25}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
|
|||||||
@@ -1,11 +1,114 @@
|
|||||||
package sections
|
package sections
|
||||||
|
|
||||||
|
import (
|
||||||
|
models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Data Model │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
var lowlights = &models.Lowlights{
|
||||||
|
Heading: "The Fragmentation Problem in the Existing Web is seeping into Crypto",
|
||||||
|
UpperQuotes: []*models.Testimonial{
|
||||||
|
{
|
||||||
|
FullName: "0xDesigner",
|
||||||
|
Username: "@0xDesigner",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: Avatar0xDesigner.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "what if the wallet ui appeared next to the click instead of in a new browser window?",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
FullName: "Alex Recouso",
|
||||||
|
Username: "@alexrecouso",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarAlexRecouso.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "2024 resembles 1984, but it doesn't have to be that way for you",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
FullName: "Chjango Unchained",
|
||||||
|
Username: "@chjango",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarChjango.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "IBC is the inter-blockchain highway of @cosmos. While not very cypherpunk, charging a 1.5 basis pt fee would go a long way if priced in $ATOM.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
FullName: "Gwart",
|
||||||
|
Username: "@GwartyGwart",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarGwart.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: " Base is incredible. Most centralized l2. Least details about their plans to decentralize. Keeps OP cabal quiet by pretending to care about quadratic voting and giving 10% tithe. Pays Ethereum mainnet virtually nothing. Runs yuppie granola ad campaigns.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
LowerQuotes: []*models.Testimonial{
|
||||||
|
{
|
||||||
|
FullName: "winnie",
|
||||||
|
Username: "@winnielaux_",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarWinnieLaux.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "the ability to download apps directly from the web or from “crypto-only” app stores will be a massive unlock for web3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
FullName: "Jelena",
|
||||||
|
Username: "@jelena_noble",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarJelenaNoble.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "Excited for all the @cosmos nerds to be vindicated in the next bull run",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
FullName: "accountless",
|
||||||
|
Username: "@alexanderchopan",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarAccountless.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "sounds like webThree. Single key pair Requires the same signer At risk of infinite approvals Public history of all transactions different account on each chain different addresses for each account",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
FullName: "Unusual Whales",
|
||||||
|
Username: "@unusual_whales",
|
||||||
|
Avatar: &models.Image{
|
||||||
|
Src: AvatarUnusualWhales.Src(),
|
||||||
|
Width: "44",
|
||||||
|
Height: "44",
|
||||||
|
},
|
||||||
|
Quote: "BREAKING: Fidelity & Fidelity Investments has confirmed that over 77,000 customers had personal information compromised, including Social Security numbers and driver’s licenses.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Render Section View │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// Lowlights is the (4th) home page lowlights section
|
||||||
templ Lowlights() {
|
templ Lowlights() {
|
||||||
<section class="bg-zinc-800">
|
<section class="bg-zinc-800">
|
||||||
<div class="py-12 md:py-20">
|
<div class="py-12 md:py-20">
|
||||||
<div class="max-w-5xl mx-auto px-4 sm:px-6">
|
<div class="max-w-5xl mx-auto px-4 sm:px-6">
|
||||||
<div class="max-w-3xl mx-auto text-center pb-12 md:pb-20">
|
<div class="max-w-3xl mx-auto text-center pb-12 md:pb-20">
|
||||||
<h2 class="font-inter-tight text-3xl md:text-4xl font-bold text-zinc-200">The Fragmentation Problem in the Existing Web is seeping into Crypto</h2>
|
<h2 class="font-inter-tight text-3xl md:text-4xl font-bold text-zinc-200">
|
||||||
|
{ lowlights.Heading }
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="max-w-[94rem] mx-auto space-y-6">
|
<div class="max-w-[94rem] mx-auto space-y-6">
|
||||||
@@ -20,66 +123,9 @@ templ Lowlights() {
|
|||||||
class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_28%,_black_calc(100%-28%),transparent_100%)] group"
|
class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_28%,_black_calc(100%-28%),transparent_100%)] group"
|
||||||
>
|
>
|
||||||
<div x-ref="testimonials" class="flex items-start justify-center md:justify-start [&>div]:mx-3 animate-infinite-scroll group-hover:[animation-play-state:paused]">
|
<div x-ref="testimonials" class="flex items-start justify-center md:justify-start [&>div]:mx-3 animate-infinite-scroll group-hover:[animation-play-state:paused]">
|
||||||
<!-- Item #1 -->
|
for _,quote := range lowlights.UpperQuotes {
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
@quoteItem(quote)
|
||||||
<div class="flex items-center mb-4">
|
}
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-01.jpg" width="44" height="44" alt="Testimonial 01"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Lina James</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">linaj87</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Item #2 -->
|
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
|
||||||
<div class="flex items-center mb-4">
|
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-02.jpg" width="44" height="44" alt="Testimonial 02"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Sarah Mendes</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">saramendes</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Item #3 -->
|
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
|
||||||
<div class="flex items-center mb-4">
|
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-03.jpg" width="44" height="44" alt="Testimonial 03"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Michał Rutt</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">michrutt</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Item #4 -->
|
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
|
||||||
<div class="flex items-center mb-4">
|
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-04.jpg" width="44" height="44" alt="Testimonial 04"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Mary Kahl</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">marykahl</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Row #2 -->
|
<!-- Row #2 -->
|
||||||
@@ -93,69 +139,29 @@ templ Lowlights() {
|
|||||||
class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_28%,_black_calc(100%-28%),transparent_100%)] group"
|
class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_28%,_black_calc(100%-28%),transparent_100%)] group"
|
||||||
>
|
>
|
||||||
<div x-ref="testimonials" class="flex items-start justify-center md:justify-start [&>div]:mx-3 animate-infinite-scroll-inverse group-hover:[animation-play-state:paused] [animation-delay:-7.5s]">
|
<div x-ref="testimonials" class="flex items-start justify-center md:justify-start [&>div]:mx-3 animate-infinite-scroll-inverse group-hover:[animation-play-state:paused] [animation-delay:-7.5s]">
|
||||||
<!-- Item #5 -->
|
for _,quote := range lowlights.LowerQuotes {
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
@quoteItem(quote)
|
||||||
<div class="flex items-center mb-4">
|
}
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-05.jpg" width="44" height="44" alt="Testimonial 05"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Katy Dragán</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">katyd</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Item #6 -->
|
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
|
||||||
<div class="flex items-center mb-4">
|
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-06.jpg" width="44" height="44" alt="Testimonial 06"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Karl Ahmed</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">karl87</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Item #7 -->
|
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
|
||||||
<div class="flex items-center mb-4">
|
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-07.jpg" width="44" height="44" alt="Testimonial 07"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Carlotta Grech</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">carlagrech</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Item #8 -->
|
|
||||||
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
|
||||||
<div class="flex items-center mb-4">
|
|
||||||
<img class="shrink-0 rounded-full mr-3" src="./images/testimonial-08.jpg" width="44" height="44" alt="Testimonial 08"/>
|
|
||||||
<div>
|
|
||||||
<div class="font-inter-tight font-bold text-zinc-200">Alejandra Gok</div>
|
|
||||||
<div>
|
|
||||||
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">alejandraIT</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
|
||||||
Extremely thoughtful approaches to business. I highly recommend this product to anyone wanting to jump into something new.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
templ quoteItem(quote *models.Testimonial) {
|
||||||
|
<div class="rounded h-full w-[22rem] border border-transparent [background:linear-gradient(#323237,#323237)_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] p-5">
|
||||||
|
<div class="flex items-center mb-4">
|
||||||
|
<img class="shrink-0 rounded-full mr-3" src={ quote.Avatar.Src } width={ quote.Avatar.Width } height={ quote.Avatar.Height } alt="Testimonial 01"/>
|
||||||
|
<div>
|
||||||
|
<div class="font-inter-tight font-bold text-zinc-200">{ quote.FullName }</div>
|
||||||
|
<div>
|
||||||
|
<a class="text-sm font-medium text-zinc-500 hover:text-zinc-300 transition" href="#0">{ quote.Username }</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-zinc-500 before:content-['\0022'] after:content-['\0022']">
|
||||||
|
{ quote.Quote }
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,29 @@
|
|||||||
package sections
|
package sections
|
||||||
|
|
||||||
|
import models "github.com/onsonr/sonr/internal/orm/marketing"
|
||||||
|
|
||||||
|
// mission is the (3rd) home page mission section
|
||||||
|
var mission = &models.Mission{
|
||||||
|
Eyebrow: "L1 Blockchain",
|
||||||
|
Heading: "The Protocol for Decentralized Identity & Authentication",
|
||||||
|
Subtitle: "We're creating the Global Standard for Decentralized Identity. Authenticate users with PassKeys, Issue Crypto Wallets, Build Payment flows, Send Encrypted Messages - all on a single platform.",
|
||||||
|
Experience: &models.Feature{
|
||||||
|
Title: "UX First Approach",
|
||||||
|
Desc: "Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while providing Developers a cost-effective solution for decentralized authentication.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
Compliance: &models.Feature{
|
||||||
|
Title: "Universal Interoperability",
|
||||||
|
Desc: "Sonr is designed to work across all platforms and devices, building a encrypted and anonymous identity layer for each user on the internet.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
Interoperability: &models.Feature{
|
||||||
|
Title: "Made in the USA",
|
||||||
|
Desc: "Sonr follows the latest specifications from W3C, DIF, and ICF to essentially have an Interchain-Connected, Smart Account System - seamlessly authenticated with PassKeys.",
|
||||||
|
Icon: nil,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
templ Mission() {
|
templ Mission() {
|
||||||
<!-- Features #3 -->
|
<!-- Features #3 -->
|
||||||
<section
|
<section
|
||||||
@@ -18,17 +42,15 @@ templ Mission() {
|
|||||||
<div
|
<div
|
||||||
class="inline-flex text-sm font-medium text-zinc-400 px-4 py-0.5 border border-transparent [background:linear-gradient(theme(colors.zinc.800),theme(colors.zinc.800))_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] rounded-full mb-4"
|
class="inline-flex text-sm font-medium text-zinc-400 px-4 py-0.5 border border-transparent [background:linear-gradient(theme(colors.zinc.800),theme(colors.zinc.800))_padding-box,linear-gradient(120deg,theme(colors.zinc.700),theme(colors.zinc.700/0),theme(colors.zinc.700))_border-box] rounded-full mb-4"
|
||||||
>
|
>
|
||||||
L1 Blockchain
|
{ mission.Eyebrow }
|
||||||
</div>
|
</div>
|
||||||
<h3
|
<h3
|
||||||
class="font-inter-tight text-3xl font-bold text-zinc-200 mb-4"
|
class="font-inter-tight text-3xl font-bold text-zinc-200 mb-4"
|
||||||
>
|
>
|
||||||
The Protocol for Decentralized Identity & Authentication
|
{ mission.Heading }
|
||||||
</h3>
|
</h3>
|
||||||
<p class="text-lg text-zinc-500">
|
<p class="text-lg text-zinc-500">
|
||||||
We're creating the Global Standard for Decentralized Identity.
|
{ mission.Subtitle }
|
||||||
Authenticate users with PassKeys, Issue Crypto Wallets, Build
|
|
||||||
Payment flows, Send Encrypted Messages - all on a single platform.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- Tabs buttons -->
|
<!-- Tabs buttons -->
|
||||||
@@ -52,11 +74,10 @@ templ Mission() {
|
|||||||
<div
|
<div
|
||||||
class="font-inter-tight text-lg font-semibold text-zinc-200 mb-1"
|
class="font-inter-tight text-lg font-semibold text-zinc-200 mb-1"
|
||||||
>
|
>
|
||||||
Make designs feel real
|
{ mission.Experience.Title }
|
||||||
</div>
|
</div>
|
||||||
<div class="text-zinc-500">
|
<div class="text-zinc-500">
|
||||||
Save time and keep things consistent with reusable
|
{ mission.Experience.Desc }
|
||||||
images, and 3D assets in shared libraries.
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -79,11 +100,10 @@ templ Mission() {
|
|||||||
<div
|
<div
|
||||||
class="font-inter-tight text-lg font-semibold text-zinc-200 mb-1"
|
class="font-inter-tight text-lg font-semibold text-zinc-200 mb-1"
|
||||||
>
|
>
|
||||||
Bring creatives closer
|
{ mission.Compliance.Title }
|
||||||
</div>
|
</div>
|
||||||
<div class="text-zinc-500">
|
<div class="text-zinc-500">
|
||||||
Save time and keep things consistent with reusable
|
{ mission.Compliance.Desc }
|
||||||
images, and 3D assets in shared libraries.
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -106,11 +126,10 @@ templ Mission() {
|
|||||||
<div
|
<div
|
||||||
class="font-inter-tight text-lg font-semibold text-zinc-200 mb-1"
|
class="font-inter-tight text-lg font-semibold text-zinc-200 mb-1"
|
||||||
>
|
>
|
||||||
Scale and align your design team
|
{ mission.Interoperability.Title }
|
||||||
</div>
|
</div>
|
||||||
<div class="text-zinc-500">
|
<div class="text-zinc-500">
|
||||||
Save time and keep things consistent with reusable
|
{ mission.Interoperability.Desc }
|
||||||
images, and 3D assets in shared libraries.
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -131,13 +150,14 @@ templ Mission() {
|
|||||||
x-transition:leave-end="opacity-0 -translate-x-8"
|
x-transition:leave-end="opacity-0 -translate-x-8"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<img
|
<iframe
|
||||||
class="lg:max-w-none mx-auto rounded-lg shadow-2xl"
|
class="lg:max-w-none mx-auto rounded-lg shadow-2xl"
|
||||||
src="./images/carousel-illustration-01.jpg"
|
src="https://customer-rexp70scd8jht8wt.cloudflarestream.com/cc55547777cec7e044cedda239a89aaa/iframe?muted=true&preload=true&loop=true&autoplay=true&poster=https%3A%2F%2Fcustomer-rexp70scd8jht8wt.cloudflarestream.com%2Fcc55547777cec7e044cedda239a89aaa%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600&controls=false"
|
||||||
width="800"
|
loading="lazy"
|
||||||
height="620"
|
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
|
||||||
alt="Carousel 01"
|
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
|
||||||
/>
|
allowfullscreen="true"
|
||||||
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Item 2 -->
|
<!-- Item 2 -->
|
||||||
@@ -152,13 +172,14 @@ templ Mission() {
|
|||||||
x-transition:leave-end="opacity-0 -translate-x-8"
|
x-transition:leave-end="opacity-0 -translate-x-8"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<img
|
<iframe
|
||||||
class="lg:max-w-none mx-auto rounded-lg shadow-2xl"
|
class="lg:max-w-none mx-auto rounded-lg shadow-2xl"
|
||||||
src="./images/carousel-illustration-01.jpg"
|
src="https://customer-rexp70scd8jht8wt.cloudflarestream.com/c1b8fc6a34e9cf0541c13751ab26c1fa/iframe?muted=true&preload=true&loop=true&autoplay=true&poster=https%3A%2F%2Fcustomer-rexp70scd8jht8wt.cloudflarestream.com%2Fc1b8fc6a34e9cf0541c13751ab26c1fa%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600&controls=false"
|
||||||
width="800"
|
loading="lazy"
|
||||||
height="620"
|
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
|
||||||
alt="Carousel 02"
|
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
|
||||||
/>
|
allowfullscreen="true"
|
||||||
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Item 3 -->
|
<!-- Item 3 -->
|
||||||
@@ -173,13 +194,14 @@ templ Mission() {
|
|||||||
x-transition:leave-end="opacity-0 -translate-x-8"
|
x-transition:leave-end="opacity-0 -translate-x-8"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<img
|
<iframe
|
||||||
class="lg:max-w-none mx-auto rounded-lg shadow-2xl"
|
class="lg:max-w-none mx-auto rounded-lg shadow-2xl"
|
||||||
src="./images/carousel-illustration-01.jpg"
|
src="https://customer-rexp70scd8jht8wt.cloudflarestream.com/ff33ff3ee922f5826a0392bb3cda66ca/iframe?muted=true&preload=true&loop=true&autoplay=true&poster=https%3A%2F%2Fcustomer-rexp70scd8jht8wt.cloudflarestream.com%2Fff33ff3ee922f5826a0392bb3cda66ca%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600&controls=false"
|
||||||
width="800"
|
loading="lazy"
|
||||||
height="620"
|
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
|
||||||
alt="Carousel 03"
|
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
|
||||||
/>
|
allowfullscreen="true"
|
||||||
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,70 @@
|
|||||||
|
package sections
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Avatar Image Components │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
type Avatar string
|
||||||
|
|
||||||
|
const (
|
||||||
|
Avatar0xDesigner Avatar = "0xdesigner.jpg"
|
||||||
|
AvatarAccountless Avatar = "accountless.jpg"
|
||||||
|
AvatarAlexRecouso Avatar = "alexrecouso.jpg"
|
||||||
|
AvatarChjango Avatar = "chjango.jpg"
|
||||||
|
AvatarGwart Avatar = "gwart.jpg"
|
||||||
|
AvatarHTMXOrg Avatar = "htmx_org.jpg"
|
||||||
|
AvatarJelenaNoble Avatar = "jelena_noble.jpg"
|
||||||
|
AvatarSonr Avatar = "sonr.svg"
|
||||||
|
AvatarTanishqXYZ Avatar = "tanishqxyz.jpg"
|
||||||
|
AvatarUnusualWhales Avatar = "unusual_whales.png"
|
||||||
|
AvatarWinnieLaux Avatar = "winnielaux_.jpg"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (a Avatar) Src() string {
|
||||||
|
return fmt.Sprintf("https://cdn.sonr.id/img/avatars/%s", string(a))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ SVG CDN Illustrations │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
type Illustration string
|
||||||
|
|
||||||
|
const (
|
||||||
|
BlockchainExplorer Illustration = "blockchain-explorer"
|
||||||
|
BlockchainStructure Illustration = "blockchain-structure"
|
||||||
|
CrossChainBridge Illustration = "cross-chain-bridge"
|
||||||
|
CrossChainTransfer Illustration = "cross-chain-transfer"
|
||||||
|
CryptoAirdrop Illustration = "crypto-airdrop"
|
||||||
|
CryptoCard Illustration = "crypto-card"
|
||||||
|
CryptoExchange Illustration = "crypto-exchange"
|
||||||
|
CryptoMining Illustration = "crypto-mining"
|
||||||
|
CryptoPayments Illustration = "crypto-payments"
|
||||||
|
CryptoSecurity Illustration = "crypto-security"
|
||||||
|
CryptoStaking Illustration = "crypto-staking"
|
||||||
|
CryptoYield Illustration = "crypto-yield"
|
||||||
|
CurrencyConversion Illustration = "currency-conversion"
|
||||||
|
DecentralizedNetwork Illustration = "decentralized-network"
|
||||||
|
DecentralizedWebNode Illustration = "decentralized-web-node"
|
||||||
|
DefiDashboard Illustration = "defi-dashboard"
|
||||||
|
GovernanceToken Illustration = "governance-token"
|
||||||
|
HardwareWallet Illustration = "hardware-wallet"
|
||||||
|
InitialCoinOffering Illustration = "initial-coin-offering"
|
||||||
|
LiquidityPool Illustration = "liquidity-pool"
|
||||||
|
MarketAnalysis Illustration = "market-analysis"
|
||||||
|
MarketVolatility Illustration = "market-volatility"
|
||||||
|
MultiCoinWallet Illustration = "multi-coin-wallet"
|
||||||
|
NetworkLatency Illustration = "network-latency"
|
||||||
|
PortfolioBalance Illustration = "portfolio-balance"
|
||||||
|
PrivateKey Illustration = "private-key"
|
||||||
|
ProofOfStake Illustration = "proof-of-stake"
|
||||||
|
TokenFractioning Illustration = "token-fractioning"
|
||||||
|
TokenMinting Illustration = "token-minting"
|
||||||
|
TokenSwap Illustration = "token-swap"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (i Illustration) Src() string {
|
||||||
|
return fmt.Sprintf("https://cdn.sonr.id/img/illustrations/%s.svg", string(i))
|
||||||
|
}
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
package marketing
|
|
||||||
|
|
||||||
import models "github.com/onsonr/sonr/internal/orm/marketing"
|
|
||||||
|
|
||||||
var hero = &models.Hero{
|
|
||||||
TitleFirst: "Simplified",
|
|
||||||
TitleEmphasis: "self-custody",
|
|
||||||
TitleSecond: "for everyone",
|
|
||||||
Subtitle: "Sonr is a modern re-imagination of online user identity, empowering users to take ownership of their digital footprint and unlocking a new era of self-sovereignty.",
|
|
||||||
PrimaryButton: &models.Button{Text: "Get Started", Href: "/register"},
|
|
||||||
SecondaryButton: &models.Button{Text: "Learn More", Href: "/about"},
|
|
||||||
Image: &models.Image{
|
|
||||||
Src: "https://cdn.sonr.id/img/hero-clipped.svg",
|
|
||||||
Width: "500",
|
|
||||||
Height: "500",
|
|
||||||
},
|
|
||||||
Stats: []*models.Stat{
|
|
||||||
{Value: "476", Label: "Assets packed with power beyond your imagination.", Denom: "K"},
|
|
||||||
{Value: "1.44", Label: "Assets packed with power beyond your imagination.", Denom: "K"},
|
|
||||||
{Value: "1.5", Label: "Assets packed with power beyond your imagination.", Denom: "M+"},
|
|
||||||
{Value: "750", Label: "Assets packed with power beyond your imagination.", Denom: "K"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var highlights = &models.Highlights{
|
|
||||||
Heading: "The Internet Rebuilt for You",
|
|
||||||
Subtitle: "Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while providing Developers a cost-effective solution for decentralized authentication.",
|
|
||||||
Features: []*models.Feature{
|
|
||||||
{
|
|
||||||
Title: "∞-Factor Auth",
|
|
||||||
Desc: "Sonr is designed to work across all platforms and devices, building a encrypted and anonymous identity layer for each user on the internet.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Title: "Data Ownership",
|
|
||||||
Desc: "Sonr leverages advanced cryptography to permit facilitating Wallet Operations directly on-chain, without the need for a centralized server.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Title: "Everyday Transactions",
|
|
||||||
Desc: "Sonr follows the latest specifications from W3C, DIF, and ICF to essentially have an Interchain-Connected, Smart Account System - seamlessly authenticated with PassKeys.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Title: "Limitless Possibilities",
|
|
||||||
Desc: "Sonr is a proudly American Project which operates under the new Wyoming DUNA Legal Framework, ensuring the protection of your digital rights.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var mission = &models.Mission{
|
|
||||||
Eyebrow: "L1 Blockchain",
|
|
||||||
Heading: "The Protocol for Decentralized Identity & Authentication",
|
|
||||||
Subtitle: "We're creating the Global Standard for Decentralized Identity. Authenticate users with PassKeys, Issue Crypto Wallets, Build Payment flows, Send Encrypted Messages - all on a single platform.",
|
|
||||||
Experience: &models.Feature{
|
|
||||||
Title: "Less is More",
|
|
||||||
Desc: "Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while providing Developers a cost-effective solution for decentralized authentication.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
Compliance: &models.Feature{
|
|
||||||
Title: "Works where there's Internet",
|
|
||||||
Desc: "Sonr is designed to work across all platforms and devices, building a encrypted and anonymous identity layer for each user on the internet.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
Interoperability: &models.Feature{
|
|
||||||
Title: "American Made DUNA",
|
|
||||||
Desc: "Sonr follows the latest specifications from W3C, DIF, and ICF to essentially have an Interchain-Connected, Smart Account System - seamlessly authenticated with PassKeys.",
|
|
||||||
Icon: nil,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# Workers
|
||||||
@@ -28,6 +28,20 @@ func NewLocal() (*SonrClient, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewRemote creates a new SonrClient for remote production.
|
// NewRemote creates a new SonrClient for remote production.
|
||||||
func NewRemote() (*SonrClient, error) {
|
func NewRemote(url string) (*SonrClient, error) {
|
||||||
return &SonrClient{}, nil
|
// create http client
|
||||||
|
client := &SonrClient{
|
||||||
|
apiURL: url,
|
||||||
|
}
|
||||||
|
// Issue ping to check if server is up
|
||||||
|
resp, err := http.Get(client.apiURL + "/genesis")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
// Check if server is up
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return client, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,20 @@ import (
|
|||||||
"github.com/onsonr/sonr/internal/orm"
|
"github.com/onsonr/sonr/internal/orm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type authAPI struct{}
|
||||||
|
|
||||||
|
var Auth = new(authAPI)
|
||||||
|
|
||||||
// ╭───────────────────────────────────────────────────────────╮
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
// │ Login Handlers │
|
// │ Login Handlers │
|
||||||
// ╰───────────────────────────────────────────────────────────╯
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// LoginSubjectCheck handles the login subject check.
|
||||||
func (a *authAPI) LoginSubjectCheck(e echo.Context) error {
|
func (a *authAPI) LoginSubjectCheck(e echo.Context) error {
|
||||||
return e.JSON(200, "HandleCredentialAssertion")
|
return e.JSON(200, "HandleCredentialAssertion")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoginSubjectStart handles the login subject start.
|
||||||
func (a *authAPI) LoginSubjectStart(e echo.Context) error {
|
func (a *authAPI) LoginSubjectStart(e echo.Context) error {
|
||||||
opts := &protocol.PublicKeyCredentialRequestOptions{
|
opts := &protocol.PublicKeyCredentialRequestOptions{
|
||||||
UserVerification: "preferred",
|
UserVerification: "preferred",
|
||||||
@@ -23,6 +29,7 @@ func (a *authAPI) LoginSubjectStart(e echo.Context) error {
|
|||||||
return e.JSON(200, opts)
|
return e.JSON(200, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoginSubjectFinish handles the login subject finish.
|
||||||
func (a *authAPI) LoginSubjectFinish(e echo.Context) error {
|
func (a *authAPI) LoginSubjectFinish(e echo.Context) error {
|
||||||
var crr protocol.CredentialAssertionResponse
|
var crr protocol.CredentialAssertionResponse
|
||||||
if err := e.Bind(&crr); err != nil {
|
if err := e.Bind(&crr); err != nil {
|
||||||
@@ -35,11 +42,13 @@ func (a *authAPI) LoginSubjectFinish(e echo.Context) error {
|
|||||||
// │ Register Handlers │
|
// │ Register Handlers │
|
||||||
// ╰───────────────────────────────────────────────────────────╯
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
// RegisterSubjectCheck handles the register subject check.
|
||||||
func (a *authAPI) RegisterSubjectCheck(e echo.Context) error {
|
func (a *authAPI) RegisterSubjectCheck(e echo.Context) error {
|
||||||
subject := e.FormValue("subject")
|
subject := e.FormValue("subject")
|
||||||
return e.JSON(200, subject)
|
return e.JSON(200, subject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RegisterSubjectStart handles the register subject start.
|
||||||
func (a *authAPI) RegisterSubjectStart(e echo.Context) error {
|
func (a *authAPI) RegisterSubjectStart(e echo.Context) error {
|
||||||
// Get subject and address
|
// Get subject and address
|
||||||
subject := e.FormValue("subject")
|
subject := e.FormValue("subject")
|
||||||
@@ -53,6 +62,7 @@ func (a *authAPI) RegisterSubjectStart(e echo.Context) error {
|
|||||||
return e.JSON(201, orm.NewCredentialCreationOptions(subject, address, chal))
|
return e.JSON(201, orm.NewCredentialCreationOptions(subject, address, chal))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RegisterSubjectFinish handles the register subject finish.
|
||||||
func (a *authAPI) RegisterSubjectFinish(e echo.Context) error {
|
func (a *authAPI) RegisterSubjectFinish(e echo.Context) error {
|
||||||
// Deserialize the JSON into a temporary struct
|
// Deserialize the JSON into a temporary struct
|
||||||
var ccr protocol.CredentialCreationResponse
|
var ccr protocol.CredentialCreationResponse
|
||||||
@@ -70,11 +80,3 @@ func (a *authAPI) RegisterSubjectFinish(e echo.Context) error {
|
|||||||
// // credential := orm.NewCredential(parsedData, e.Request().Host, "")
|
// // credential := orm.NewCredential(parsedData, e.Request().Host, "")
|
||||||
return e.JSON(201, ccr)
|
return e.JSON(201, ccr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ╭───────────────────────────────────────────────────────────╮
|
|
||||||
// │ Group Structures │
|
|
||||||
// ╰───────────────────────────────────────────────────────────╯
|
|
||||||
|
|
||||||
type authAPI struct{}
|
|
||||||
|
|
||||||
var Auth = new(authAPI)
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Sonr Protobuf
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
This directory contains the protobuf definitions for the Sonr blockchain.
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
|
||||||
|
### `did`
|
||||||
|
|
||||||
|
The `did` directory contains the protobuf definitions for the DID module.
|
||||||
|
|
||||||
|
### `macaroon`
|
||||||
|
|
||||||
|
The `macaroon` directory contains the protobuf definitions for the Macaroon module.
|
||||||
|
|
||||||
|
### `service`
|
||||||
|
|
||||||
|
The `service` directory contains the protobuf definitions for the Service module.
|
||||||
|
|
||||||
|
### `vault`
|
||||||
|
|
||||||
|
The `vault` directory contains the protobuf definitions for the Vault module.
|
||||||
|
|
||||||
|
### `buf.gen.gogo.yaml`
|
||||||
|
|||||||
@@ -104,10 +104,41 @@ message Controller {
|
|||||||
int64 creation_block = 9;
|
int64 creation_block = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grant is a Grant message type.
|
||||||
|
message Grant {
|
||||||
|
option (cosmos.orm.v1.table) = {
|
||||||
|
id : 4
|
||||||
|
primary_key : {fields : "id" auto_increment : true}
|
||||||
|
index : {id : 1 fields : "subject,origin" unique : true}
|
||||||
|
};
|
||||||
|
|
||||||
|
uint64 id = 1;
|
||||||
|
string controller = 2;
|
||||||
|
string subject = 3;
|
||||||
|
string origin = 4;
|
||||||
|
int64 expiry_height = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Macaroon is a Macaroon message type.
|
||||||
|
message Macaroon {
|
||||||
|
option (cosmos.orm.v1.table) = {
|
||||||
|
id : 5
|
||||||
|
primary_key : {fields : "id" auto_increment : true}
|
||||||
|
index : {id : 1 fields : "subject,origin" unique : true}
|
||||||
|
};
|
||||||
|
|
||||||
|
uint64 id = 1;
|
||||||
|
string controller = 2;
|
||||||
|
string subject = 3;
|
||||||
|
string origin = 4;
|
||||||
|
int64 expiry_height = 5;
|
||||||
|
string macaroon = 6;
|
||||||
|
}
|
||||||
|
|
||||||
// Verification represents a verification method
|
// Verification represents a verification method
|
||||||
message Verification {
|
message Verification {
|
||||||
option (cosmos.orm.v1.table) = {
|
option (cosmos.orm.v1.table) = {
|
||||||
id : 4
|
id : 6
|
||||||
primary_key : {fields : "did"}
|
primary_key : {fields : "did"}
|
||||||
index : {id : 1 fields : "issuer,subject" unique : true}
|
index : {id : 1 fields : "issuer,subject" unique : true}
|
||||||
index : {id : 2 fields : "controller,did_method,issuer" unique : true}
|
index : {id : 2 fields : "controller,did_method,issuer" unique : true}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package onsonr.sonr.macaroon.module.v1;
|
|
||||||
|
|
||||||
import "cosmos/app/v1alpha1/module.proto";
|
|
||||||
|
|
||||||
// Module is the app config object of the module.
|
|
||||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
|
||||||
message Module {
|
|
||||||
option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr/x/macaroon"};
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package macaroon.v1;
|
|
||||||
|
|
||||||
import "amino/amino.proto";
|
|
||||||
import "did/v1/tx.proto";
|
|
||||||
import "gogoproto/gogo.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
|
||||||
|
|
||||||
// GenesisState defines the module genesis state
|
|
||||||
message GenesisState {
|
|
||||||
// Params defines all the parameters of the module.
|
|
||||||
Params params = 1 [(gogoproto.nullable) = false];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Params defines the set of module parameters.
|
|
||||||
message Params {
|
|
||||||
option (amino.name) = "macaroon/params";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
option (gogoproto.goproto_stringer) = false;
|
|
||||||
|
|
||||||
// The list of methods
|
|
||||||
Methods methods = 1;
|
|
||||||
|
|
||||||
// The list of scopes
|
|
||||||
Scopes scopes = 2;
|
|
||||||
|
|
||||||
// The list of caveats
|
|
||||||
Caveats caveats = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods defines the available DID methods
|
|
||||||
message Methods {
|
|
||||||
option (amino.name) = "macaroon/methods";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
string default = 1;
|
|
||||||
repeated string supported = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scopes defines the set of scopes
|
|
||||||
message Scopes {
|
|
||||||
option (amino.name) = "macaroon/scopes";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
string base = 1;
|
|
||||||
repeated string supported = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Caveats defines the available caveats
|
|
||||||
message Caveats {
|
|
||||||
option (amino.name) = "macaroon/caveats";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
|
|
||||||
repeated Caveat supported_first_party = 1;
|
|
||||||
repeated Caveat supported_third_party = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transactions defines the allowlist,denylist for transactions which can be
|
|
||||||
// broadcasted to the network with the Sonr DWN Signed macaroon.
|
|
||||||
message Transactions {
|
|
||||||
option (amino.name) = "macaroon/transactions";
|
|
||||||
option (gogoproto.equal) = true;
|
|
||||||
|
|
||||||
repeated string allowlist = 1;
|
|
||||||
repeated string denylist = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Caveat {
|
|
||||||
repeated string scopes = 1;
|
|
||||||
string caveat = 2;
|
|
||||||
string description = 3;
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package macaroon.v1;
|
|
||||||
|
|
||||||
import "google/api/annotations.proto";
|
|
||||||
import "macaroon/v1/genesis.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
|
||||||
|
|
||||||
// Query provides defines the gRPC querier service.
|
|
||||||
service Query {
|
|
||||||
// Params queries all parameters of the module.
|
|
||||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
|
||||||
option (google.api.http).get = "/macaroon/v1/params";
|
|
||||||
}
|
|
||||||
|
|
||||||
// RefreshToken refreshes a macaroon token as post authentication.
|
|
||||||
rpc RefreshToken(QueryRefreshTokenRequest)
|
|
||||||
returns (QueryRefreshTokenResponse) {
|
|
||||||
option (google.api.http).post = "/macaroon/v1/refresh";
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateToken validates a macaroon token as pre authentication.
|
|
||||||
rpc ValidateToken(QueryValidateTokenRequest)
|
|
||||||
returns (QueryValidateTokenResponse) {
|
|
||||||
option (google.api.http).post = "/macaroon/v1/validate";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
|
||||||
message QueryParamsRequest {}
|
|
||||||
|
|
||||||
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
|
||||||
message QueryParamsResponse {
|
|
||||||
// params defines the parameters of the module.
|
|
||||||
Params params = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryRefreshTokenRequest is the request type for the Query/RefreshToken RPC
|
|
||||||
// method.
|
|
||||||
message QueryRefreshTokenRequest {
|
|
||||||
// The macaroon token to refresh
|
|
||||||
string token = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryRefreshTokenResponse is the response type for the Query/RefreshToken
|
|
||||||
// RPC method.
|
|
||||||
message QueryRefreshTokenResponse {
|
|
||||||
// The macaroon token
|
|
||||||
string token = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryValidateTokenRequest is the request type for the Query/ValidateToken
|
|
||||||
// RPC method.
|
|
||||||
message QueryValidateTokenRequest {
|
|
||||||
// The macaroon token to validate
|
|
||||||
string token = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// QueryValidateTokenResponse is the response type for the Query/ValidateToken
|
|
||||||
// RPC method.
|
|
||||||
message QueryValidateTokenResponse {
|
|
||||||
// The macaroon token
|
|
||||||
bool valid = 1;
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package macaroon.v1;
|
|
||||||
|
|
||||||
import "cosmos/orm/v1/orm.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
|
||||||
|
|
||||||
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
|
|
||||||
|
|
||||||
message Grant {
|
|
||||||
option (cosmos.orm.v1.table) = {
|
|
||||||
id : 1
|
|
||||||
primary_key : {fields : "id" auto_increment : true}
|
|
||||||
index : {id : 1 fields : "subject,origin" unique : true}
|
|
||||||
};
|
|
||||||
|
|
||||||
uint64 id = 1;
|
|
||||||
string controller = 2;
|
|
||||||
string subject = 3;
|
|
||||||
string origin = 4;
|
|
||||||
int64 expiry_height = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Macaroon {
|
|
||||||
option (cosmos.orm.v1.table) = {
|
|
||||||
id : 2
|
|
||||||
primary_key : {fields : "id" auto_increment : true}
|
|
||||||
index : {id : 1 fields : "subject,origin" unique : true}
|
|
||||||
};
|
|
||||||
|
|
||||||
uint64 id = 1;
|
|
||||||
string controller = 2;
|
|
||||||
string subject = 3;
|
|
||||||
string origin = 4;
|
|
||||||
int64 expiry_height = 5;
|
|
||||||
string macaroon = 6;
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package macaroon.v1;
|
|
||||||
|
|
||||||
import "cosmos/msg/v1/msg.proto";
|
|
||||||
import "cosmos_proto/cosmos.proto";
|
|
||||||
import "gogoproto/gogo.proto";
|
|
||||||
import "macaroon/v1/genesis.proto";
|
|
||||||
|
|
||||||
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
|
|
||||||
|
|
||||||
// Msg defines the Msg service.
|
|
||||||
service Msg {
|
|
||||||
option (cosmos.msg.v1.service) = true;
|
|
||||||
|
|
||||||
// UpdateParams defines a governance operation for updating the parameters.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
|
|
||||||
|
|
||||||
// IssueMacaroon asserts the given controller is the owner of the given
|
|
||||||
// address.
|
|
||||||
rpc IssueMacaroon(MsgIssueMacaroon) returns (MsgIssueMacaroonResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
message MsgUpdateParams {
|
|
||||||
option (cosmos.msg.v1.signer) = "authority";
|
|
||||||
|
|
||||||
// authority is the address of the governance account.
|
|
||||||
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
|
|
||||||
|
|
||||||
// params defines the parameters to update.
|
|
||||||
//
|
|
||||||
// NOTE: All parameters must be supplied.
|
|
||||||
Params params = 2 [ (gogoproto.nullable) = false ];
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
|
||||||
// MsgUpdateParams message.
|
|
||||||
//
|
|
||||||
// Since: cosmos-sdk 0.47
|
|
||||||
message MsgUpdateParamsResponse {}
|
|
||||||
|
|
||||||
// MsgIssueMacaroon is the message type for the IssueMacaroon RPC.
|
|
||||||
message MsgIssueMacaroon {
|
|
||||||
option (cosmos.msg.v1.signer) = "controller";
|
|
||||||
|
|
||||||
// Controller is the address of the controller to authenticate.
|
|
||||||
string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
|
|
||||||
|
|
||||||
// Origin is the origin of the request in wildcard form.
|
|
||||||
string origin = 2;
|
|
||||||
|
|
||||||
// Permissions is the scope of the service.
|
|
||||||
map<string, string> permissions = 3;
|
|
||||||
|
|
||||||
// token is the macron token to authenticate the operation.
|
|
||||||
string token = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgIssueMacaroonResponse is the response type for the IssueMacaroon
|
|
||||||
// RPC.
|
|
||||||
message MsgIssueMacaroonResponse {
|
|
||||||
bool success = 1;
|
|
||||||
string token = 2;
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,7 @@ service Query {
|
|||||||
// Sync queries the DID document by its id. And returns the required PKL
|
// Sync queries the DID document by its id. And returns the required PKL
|
||||||
// information
|
// information
|
||||||
rpc Sync(QuerySyncRequest) returns (QuerySyncResponse) {
|
rpc Sync(QuerySyncRequest) returns (QuerySyncResponse) {
|
||||||
option (google.api.http).get = "/vault/v1/sync-initial";
|
option (google.api.http).get = "/vault/v1/sync";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -34,9 +34,12 @@ requests:
|
|||||||
vault: !folder
|
vault: !folder
|
||||||
name: Vault
|
name: Vault
|
||||||
requests:
|
requests:
|
||||||
vault_schema: !request
|
|
||||||
method: GET
|
|
||||||
url: "{{host}}/vault/v1/schema"
|
|
||||||
vault_allocate: !request
|
vault_allocate: !request
|
||||||
method: GET
|
method: GET
|
||||||
url: "{{host}}/vault/v1/allocate"
|
url: "{{host}}/vault/v1/allocate"
|
||||||
|
vault_schema: !request
|
||||||
|
method: GET
|
||||||
|
url: "{{host}}/vault/v1/schema"
|
||||||
|
vault_sync: !request
|
||||||
|
method: GET
|
||||||
|
url: "{{host}}/vault/v1/sync"
|
||||||
|
|||||||
+97
-27
@@ -4,60 +4,118 @@ The Decentralized Identity module is responsible for managing native Sonr Accoun
|
|||||||
|
|
||||||
## State
|
## State
|
||||||
|
|
||||||
Specify and describe structures expected to marshalled into the store, and their keys
|
The DID module maintains several key state structures:
|
||||||
|
|
||||||
### Account State
|
### Controller State
|
||||||
|
|
||||||
The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key.
|
The Controller state represents a Sonr DWN Vault. It includes:
|
||||||
|
- Unique identifier (number)
|
||||||
|
- DID
|
||||||
|
- Sonr address
|
||||||
|
- Ethereum address
|
||||||
|
- Bitcoin address
|
||||||
|
- Public key
|
||||||
|
- Keyshares pointer
|
||||||
|
- Claimed block
|
||||||
|
- Creation block
|
||||||
|
|
||||||
### Credential State
|
### Assertion State
|
||||||
|
|
||||||
The Credential state includes the claims about a subject and is stored using the credential ID as the key.
|
The Assertion state includes:
|
||||||
|
- DID
|
||||||
|
- Controller
|
||||||
|
- Subject
|
||||||
|
- Public key
|
||||||
|
- Assertion type
|
||||||
|
- Accumulator (metadata)
|
||||||
|
- Creation block
|
||||||
|
|
||||||
|
### Authentication State
|
||||||
|
|
||||||
|
The Authentication state includes:
|
||||||
|
- DID
|
||||||
|
- Controller
|
||||||
|
- Subject
|
||||||
|
- Public key
|
||||||
|
- Credential ID
|
||||||
|
- Metadata
|
||||||
|
- Creation block
|
||||||
|
|
||||||
|
### Verification State
|
||||||
|
|
||||||
|
The Verification state includes:
|
||||||
|
- DID
|
||||||
|
- Controller
|
||||||
|
- DID method
|
||||||
|
- Issuer
|
||||||
|
- Subject
|
||||||
|
- Public key
|
||||||
|
- Verification type
|
||||||
|
- Metadata
|
||||||
|
- Creation block
|
||||||
|
|
||||||
## State Transitions
|
## State Transitions
|
||||||
|
|
||||||
Standard state transition operations triggered by hooks, messages, etc.
|
State transitions are triggered by the following messages:
|
||||||
|
- LinkAssertion
|
||||||
|
- LinkAuthentication
|
||||||
|
- UnlinkAssertion
|
||||||
|
- UnlinkAuthentication
|
||||||
|
- ExecuteTx
|
||||||
|
- UpdateParams
|
||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
Specify message structure(s) and expected state machine behaviour(s).
|
The DID module defines the following messages:
|
||||||
|
|
||||||
## Begin Block
|
1. MsgLinkAuthentication
|
||||||
|
2. MsgLinkAssertion
|
||||||
|
3. MsgExecuteTx
|
||||||
|
4. MsgUnlinkAssertion
|
||||||
|
5. MsgUnlinkAuthentication
|
||||||
|
6. MsgUpdateParams
|
||||||
|
|
||||||
Specify any begin-block operations.
|
Each message triggers specific state machine behaviors related to managing DIDs, authentications, assertions, and module parameters.
|
||||||
|
|
||||||
## End Block
|
## Query
|
||||||
|
|
||||||
Specify any end-block operations.
|
The DID module provides the following query endpoints:
|
||||||
|
|
||||||
## Hooks
|
1. Params: Query all parameters of the module
|
||||||
|
2. Resolve: Query the DID document by its ID
|
||||||
Describe available hooks to be called by/from this module.
|
3. Sign: Sign a message with the DID document
|
||||||
|
4. Verify: Verify a message with the DID document
|
||||||
## Events
|
|
||||||
|
|
||||||
List and describe event tags used.
|
|
||||||
|
|
||||||
## Client
|
|
||||||
|
|
||||||
List and describe CLI commands and gRPC and REST endpoints.
|
|
||||||
|
|
||||||
## Params
|
## Params
|
||||||
|
|
||||||
List all module parameters, their types (in JSON) and identitys.
|
The module parameters include:
|
||||||
|
- Allowed public keys (map of KeyInfo)
|
||||||
|
- Conveyance preference
|
||||||
|
- Attestation formats
|
||||||
|
|
||||||
|
## Client
|
||||||
|
|
||||||
|
The module provides gRPC and REST endpoints for all defined messages and queries.
|
||||||
|
|
||||||
## Future Improvements
|
## Future Improvements
|
||||||
|
|
||||||
Describe future improvements of this module.
|
Potential future improvements could include:
|
||||||
|
1. Enhanced privacy features for DID operations
|
||||||
|
2. Integration with more blockchain networks
|
||||||
|
3. Support for additional key types and cryptographic algorithms
|
||||||
|
4. Improved revocation mechanisms for credentials and assertions
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Acceptance tests.
|
Acceptance tests should cover all major functionality, including:
|
||||||
|
- Creating and managing DIDs
|
||||||
|
- Linking and unlinking assertions and authentications
|
||||||
|
- Executing transactions with DIDs
|
||||||
|
- Querying and resolving DIDs
|
||||||
|
- Parameter updates
|
||||||
|
|
||||||
## Appendix
|
## Appendix
|
||||||
|
|
||||||
Supplementary details referenced elsewhere within the spec.
|
|
||||||
|
|
||||||
### Account
|
### Account
|
||||||
|
|
||||||
An Account represents a user's identity within the Sonr ecosystem. It includes information such as the user's public key, associated wallets, and other identification details.
|
An Account represents a user's identity within the Sonr ecosystem. It includes information such as the user's public key, associated wallets, and other identification details.
|
||||||
@@ -69,3 +127,15 @@ A Decentralized Identifier (DID) is a unique identifier that is created, owned,
|
|||||||
### Verifiable Credential (VC)
|
### Verifiable Credential (VC)
|
||||||
|
|
||||||
A Verifiable Credential (VC) is a digital statement that can be cryptographically verified. It contains claims about a subject (e.g., a user) and is issued by a trusted authority.
|
A Verifiable Credential (VC) is a digital statement that can be cryptographically verified. It contains claims about a subject (e.g., a user) and is issued by a trusted authority.
|
||||||
|
|
||||||
|
### Key Types
|
||||||
|
|
||||||
|
The module supports various key types, including:
|
||||||
|
- Role
|
||||||
|
- Algorithm (e.g., ES256, EdDSA, ES256K)
|
||||||
|
- Encoding (e.g., hex, base64, multibase)
|
||||||
|
- Curve (e.g., P256, P384, P521, X25519, X448, Ed25519, Ed448, secp256k1)
|
||||||
|
|
||||||
|
### JSON Web Key (JWK)
|
||||||
|
|
||||||
|
The module supports JSON Web Keys (JWK) for representing cryptographic keys, including properties such as key type (kty), curve (crv), and coordinates (x, y) for EC and OKP keys, as well as modulus (n) and exponent (e) for RSA keys.
|
||||||
|
|||||||
+3
-3
@@ -7,9 +7,9 @@ import (
|
|||||||
|
|
||||||
var _ sdk.Msg = &MsgUpdateParams{}
|
var _ sdk.Msg = &MsgUpdateParams{}
|
||||||
|
|
||||||
// ╭────────────────────────────────────────────────────────╮
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
// │ MsgUpdateParams │
|
// │ MsgUpdateParams type definition │
|
||||||
// ╰────────────────────────────────────────────────────────╯
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
||||||
func NewMsgUpdateParams(
|
func NewMsgUpdateParams(
|
||||||
|
|||||||
+793
-49
@@ -339,6 +339,168 @@ func (m *Controller) GetCreationBlock() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grant is a Grant message type.
|
||||||
|
type Grant struct {
|
||||||
|
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||||
|
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||||
|
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||||
|
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) Reset() { *m = Grant{} }
|
||||||
|
func (m *Grant) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Grant) ProtoMessage() {}
|
||||||
|
func (*Grant) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_f44bb702879c34b4, []int{3}
|
||||||
|
}
|
||||||
|
func (m *Grant) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Grant.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Grant) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Grant.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Grant) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Grant) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Grant.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Grant proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Grant) GetId() uint64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) GetController() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Controller
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) GetSubject() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Subject
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) GetOrigin() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Origin
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) GetExpiryHeight() int64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.ExpiryHeight
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Macaroon is a Macaroon message type.
|
||||||
|
type Macaroon struct {
|
||||||
|
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||||
|
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||||
|
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||||
|
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
||||||
|
Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) Reset() { *m = Macaroon{} }
|
||||||
|
func (m *Macaroon) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Macaroon) ProtoMessage() {}
|
||||||
|
func (*Macaroon) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_f44bb702879c34b4, []int{4}
|
||||||
|
}
|
||||||
|
func (m *Macaroon) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Macaroon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Macaroon.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Macaroon) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Macaroon.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Macaroon) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Macaroon) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Macaroon.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Macaroon proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *Macaroon) GetId() uint64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) GetController() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Controller
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) GetSubject() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Subject
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) GetOrigin() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Origin
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) GetExpiryHeight() int64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.ExpiryHeight
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) GetMacaroon() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Macaroon
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// Verification represents a verification method
|
// Verification represents a verification method
|
||||||
type Verification struct {
|
type Verification struct {
|
||||||
// The unique identifier of the verification
|
// The unique identifier of the verification
|
||||||
@@ -365,7 +527,7 @@ func (m *Verification) Reset() { *m = Verification{} }
|
|||||||
func (m *Verification) String() string { return proto.CompactTextString(m) }
|
func (m *Verification) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Verification) ProtoMessage() {}
|
func (*Verification) ProtoMessage() {}
|
||||||
func (*Verification) Descriptor() ([]byte, []int) {
|
func (*Verification) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_f44bb702879c34b4, []int{3}
|
return fileDescriptor_f44bb702879c34b4, []int{5}
|
||||||
}
|
}
|
||||||
func (m *Verification) XXX_Unmarshal(b []byte) error {
|
func (m *Verification) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
@@ -463,6 +625,8 @@ func init() {
|
|||||||
proto.RegisterType((*Authentication)(nil), "did.v1.Authentication")
|
proto.RegisterType((*Authentication)(nil), "did.v1.Authentication")
|
||||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry")
|
proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry")
|
||||||
proto.RegisterType((*Controller)(nil), "did.v1.Controller")
|
proto.RegisterType((*Controller)(nil), "did.v1.Controller")
|
||||||
|
proto.RegisterType((*Grant)(nil), "did.v1.Grant")
|
||||||
|
proto.RegisterType((*Macaroon)(nil), "did.v1.Macaroon")
|
||||||
proto.RegisterType((*Verification)(nil), "did.v1.Verification")
|
proto.RegisterType((*Verification)(nil), "did.v1.Verification")
|
||||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.Verification.MetadataEntry")
|
proto.RegisterMapType((map[string]string)(nil), "did.v1.Verification.MetadataEntry")
|
||||||
}
|
}
|
||||||
@@ -470,54 +634,61 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
|
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
|
||||||
|
|
||||||
var fileDescriptor_f44bb702879c34b4 = []byte{
|
var fileDescriptor_f44bb702879c34b4 = []byte{
|
||||||
// 745 bytes of a gzipped FileDescriptorProto
|
// 849 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0xc1, 0x6e, 0xd3, 0x48,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x61, 0x8b, 0xe3, 0x44,
|
||||||
0x18, 0xc7, 0x3b, 0x71, 0x92, 0xd6, 0x5f, 0xd2, 0xc8, 0x1d, 0x75, 0x77, 0x47, 0xd5, 0x6e, 0x36,
|
0x18, 0xc7, 0x77, 0x9a, 0x36, 0xd7, 0x3c, 0xed, 0x96, 0xdc, 0xb0, 0x9e, 0x61, 0xd1, 0x5a, 0x73,
|
||||||
0x9b, 0xee, 0xae, 0xb2, 0xda, 0x6e, 0xa2, 0x76, 0x2f, 0xa8, 0xa0, 0x8a, 0x14, 0x38, 0xa0, 0xaa,
|
0x7a, 0xac, 0xb8, 0xb6, 0xdc, 0xf9, 0x46, 0x56, 0x39, 0xdc, 0x53, 0x51, 0x39, 0x16, 0x24, 0xca,
|
||||||
0x12, 0x32, 0xa8, 0x12, 0x5c, 0xa2, 0xb1, 0x67, 0x68, 0x4c, 0x6c, 0x4f, 0xf0, 0x8c, 0x23, 0x72,
|
0x81, 0xbe, 0x29, 0x93, 0xcc, 0xd8, 0x8e, 0x4d, 0x32, 0x75, 0x32, 0x29, 0xd7, 0x97, 0x82, 0x82,
|
||||||
0x44, 0x02, 0x89, 0x13, 0xe2, 0x09, 0x78, 0x1e, 0x8e, 0x95, 0xb8, 0x70, 0x44, 0xed, 0x1b, 0xf0,
|
0xaf, 0xc4, 0x4f, 0xe0, 0xc7, 0xf0, 0x33, 0xf8, 0xf2, 0x40, 0x04, 0x5f, 0xca, 0xee, 0x37, 0xf0,
|
||||||
0x04, 0xc8, 0x63, 0x3b, 0x71, 0xa0, 0xa2, 0x50, 0x21, 0x71, 0x89, 0x32, 0x7f, 0xff, 0xfd, 0x79,
|
0x13, 0xc8, 0xcc, 0x24, 0x6d, 0xaa, 0x87, 0x7b, 0xae, 0x82, 0xf7, 0xa6, 0x74, 0xfe, 0x79, 0xf2,
|
||||||
0xbe, 0xff, 0xcf, 0xdf, 0x18, 0x30, 0xf3, 0x58, 0x6f, 0xb2, 0xdd, 0x93, 0x8a, 0x2a, 0xde, 0x1d,
|
0xe4, 0x79, 0x7e, 0xff, 0xcc, 0x33, 0x01, 0x4c, 0x39, 0x9d, 0xac, 0x6e, 0x4f, 0x0a, 0x45, 0x14,
|
||||||
0x47, 0x42, 0x09, 0x5c, 0x65, 0x1e, 0xeb, 0x4e, 0xb6, 0x37, 0x7e, 0x71, 0x85, 0x0c, 0x84, 0xec,
|
0x1b, 0x2f, 0xa5, 0x50, 0x02, 0xbb, 0x94, 0xd3, 0xf1, 0xea, 0xf6, 0xe1, 0xb3, 0x89, 0x28, 0x32,
|
||||||
0x89, 0x28, 0x48, 0x2c, 0x22, 0x0a, 0x52, 0xc3, 0xc6, 0x7a, 0x76, 0xd3, 0x31, 0x0f, 0xb9, 0xf4,
|
0x51, 0x4c, 0x84, 0xcc, 0x74, 0x88, 0x90, 0x99, 0x0d, 0x38, 0x3c, 0xa8, 0x6e, 0x9a, 0xb1, 0x9c,
|
||||||
0x64, 0xaa, 0xb6, 0x9f, 0x1b, 0x60, 0xf6, 0xa5, 0xe4, 0x91, 0xf2, 0x44, 0x88, 0x2d, 0x30, 0x98,
|
0x15, 0xbc, 0xb0, 0x6a, 0xf8, 0x8d, 0x03, 0xde, 0x69, 0x51, 0x30, 0xa9, 0xb8, 0xc8, 0xb1, 0x0f,
|
||||||
0xc7, 0x08, 0x6a, 0xa1, 0x8e, 0x69, 0x27, 0x7f, 0x71, 0x13, 0xc0, 0x15, 0xa1, 0x8a, 0x84, 0xef,
|
0x0e, 0xe5, 0x34, 0x40, 0x23, 0x74, 0xe4, 0x45, 0xfa, 0x2f, 0x1e, 0x02, 0x24, 0x22, 0x57, 0x52,
|
||||||
0xf3, 0x88, 0x94, 0xf4, 0x85, 0x82, 0x82, 0x09, 0x2c, 0xcb, 0xd8, 0x79, 0xc4, 0x5d, 0x45, 0x0c,
|
0xa4, 0x29, 0x93, 0x41, 0xcb, 0x5c, 0x68, 0x28, 0x38, 0x80, 0x6b, 0x45, 0x19, 0x7f, 0xc1, 0x12,
|
||||||
0x7d, 0x31, 0x5f, 0xe2, 0xff, 0x00, 0xc6, 0xb1, 0xe3, 0x7b, 0xee, 0x60, 0xc4, 0xa7, 0xa4, 0xdc,
|
0x15, 0x38, 0xe6, 0x62, 0xbd, 0xc4, 0xaf, 0x01, 0x2c, 0xcb, 0x38, 0xe5, 0xc9, 0x74, 0xc1, 0xd6,
|
||||||
0x42, 0x9d, 0xda, 0x4e, 0xa3, 0x9b, 0xee, 0xb2, 0x7b, 0x27, 0x76, 0x0e, 0xf8, 0xd4, 0x36, 0x53,
|
0x41, 0x7b, 0x84, 0x8e, 0x7a, 0x77, 0x06, 0x63, 0x5b, 0xe5, 0xf8, 0xa3, 0x32, 0xbe, 0xcf, 0xd6,
|
||||||
0xc7, 0x01, 0x9f, 0xe2, 0xbf, 0xa0, 0x41, 0xf3, 0x7d, 0x0c, 0xd4, 0x74, 0xcc, 0x49, 0x45, 0xd7,
|
0x91, 0x67, 0x23, 0xee, 0xb3, 0x35, 0x7e, 0x19, 0x06, 0xa4, 0xae, 0x63, 0xaa, 0xd6, 0x4b, 0x16,
|
||||||
0x5b, 0x9d, 0xa9, 0xf7, 0xa6, 0x63, 0x8e, 0x6f, 0x42, 0x8d, 0xba, 0x6e, 0x1c, 0xc4, 0x3e, 0x55,
|
0x74, 0x4c, 0xbe, 0xfd, 0x8d, 0xfa, 0xc9, 0x7a, 0xc9, 0xf0, 0xbb, 0xd0, 0x23, 0x49, 0x52, 0x66,
|
||||||
0x22, 0x22, 0xd5, 0x96, 0xd1, 0xa9, 0xed, 0xb4, 0xf3, 0xb2, 0xb3, 0x4e, 0xba, 0xfd, 0xb9, 0xe9,
|
0x65, 0x4a, 0x94, 0x90, 0x81, 0x3b, 0x72, 0x8e, 0x7a, 0x77, 0xc2, 0x3a, 0xed, 0xa6, 0x93, 0xf1,
|
||||||
0x56, 0xa8, 0xa2, 0xa9, 0x5d, 0xbc, 0x2d, 0x79, 0x98, 0x1b, 0x71, 0xaa, 0x9f, 0xe5, 0xf8, 0xc2,
|
0xe9, 0x36, 0xe8, 0xbd, 0x5c, 0xc9, 0x75, 0xd4, 0xbc, 0x4d, 0x3f, 0x2c, 0x91, 0x8c, 0x98, 0x67,
|
||||||
0x1d, 0x91, 0xe5, 0x16, 0xea, 0x18, 0xf6, 0x6a, 0xae, 0xee, 0x27, 0xe2, 0xc6, 0x1e, 0x58, 0x9f,
|
0xc5, 0xa9, 0x48, 0x16, 0xc1, 0xb5, 0x11, 0x3a, 0x72, 0xa2, 0xfd, 0x5a, 0xbd, 0xa7, 0xc5, 0xc3,
|
||||||
0xd6, 0x49, 0x22, 0x4a, 0xfa, 0xc9, 0x22, 0x1a, 0xf1, 0x29, 0x5e, 0x87, 0xca, 0x84, 0xfa, 0x31,
|
0xbb, 0xe0, 0xff, 0x39, 0x8f, 0x46, 0xa4, 0xfb, 0xa9, 0x10, 0x2d, 0xd8, 0x1a, 0x1f, 0x40, 0x67,
|
||||||
0xd7, 0xe9, 0xd4, 0xed, 0x74, 0xb1, 0x5b, 0xba, 0x82, 0x76, 0xff, 0xf9, 0xf0, 0xfa, 0xed, 0x4b,
|
0x45, 0xd2, 0x92, 0x19, 0x3a, 0xfd, 0xc8, 0x2e, 0x4e, 0x5a, 0x6f, 0xa0, 0x93, 0x57, 0x7e, 0xff,
|
||||||
0x63, 0x13, 0x2a, 0x3a, 0x56, 0x4c, 0x00, 0xcf, 0x93, 0xdb, 0xca, 0x72, 0xb2, 0x10, 0x41, 0x04,
|
0xe1, 0xe7, 0xef, 0x9c, 0x9b, 0xd0, 0x31, 0x58, 0x71, 0x00, 0x78, 0x4b, 0xee, 0xb8, 0xe2, 0xe4,
|
||||||
0xb5, 0x9f, 0x1a, 0xd0, 0xe8, 0xc7, 0x6a, 0xc8, 0x43, 0xe5, 0xb9, 0xf4, 0x47, 0xc3, 0xd8, 0x84,
|
0xa3, 0x00, 0x05, 0x28, 0xfc, 0xca, 0x81, 0xc1, 0x69, 0xa9, 0xe6, 0x2c, 0x57, 0x3c, 0x21, 0xff,
|
||||||
0x24, 0x09, 0x96, 0x6c, 0x86, 0xfa, 0x03, 0x8f, 0x69, 0x16, 0x75, 0xbb, 0x3e, 0x17, 0x6f, 0x33,
|
0xb7, 0x19, 0x37, 0x41, 0x93, 0xa0, 0xba, 0x18, 0x92, 0x4e, 0x39, 0x35, 0x5e, 0xf4, 0xa3, 0xfe,
|
||||||
0x7c, 0x1d, 0x56, 0x02, 0xae, 0x28, 0xa3, 0x8a, 0x66, 0x1c, 0xfe, 0x9c, 0x71, 0x58, 0xe8, 0xa4,
|
0x56, 0xfc, 0x90, 0xe2, 0xb7, 0xa1, 0x9b, 0x31, 0x45, 0x28, 0x51, 0xa4, 0xf2, 0xe1, 0xa5, 0x8d,
|
||||||
0x7b, 0x98, 0xd9, 0x52, 0x12, 0xb3, 0xbb, 0xbe, 0x16, 0xc3, 0x55, 0x58, 0x5d, 0xa8, 0x70, 0x11,
|
0x0f, 0x3b, 0x9d, 0x8c, 0xcf, 0xaa, 0x30, 0xeb, 0xc4, 0xe6, 0xae, 0x27, 0xb5, 0xe1, 0x4d, 0xd8,
|
||||||
0x03, 0xf3, 0x52, 0x0c, 0x4a, 0xed, 0x17, 0x06, 0xc0, 0x8d, 0x79, 0x9a, 0x3f, 0x43, 0x35, 0x8c,
|
0xdf, 0xc9, 0x70, 0x99, 0x07, 0xde, 0x95, 0x3c, 0x68, 0x85, 0xdf, 0x3a, 0x00, 0xef, 0x6c, 0x69,
|
||||||
0x03, 0x87, 0x47, 0xfa, 0x41, 0x65, 0x3b, 0x5b, 0xe5, 0x5c, 0x4a, 0x73, 0x2e, 0x7f, 0x40, 0x5d,
|
0xde, 0x00, 0x37, 0x2f, 0xb3, 0x98, 0x49, 0xf3, 0xa0, 0x76, 0x54, 0xad, 0x6a, 0x5f, 0x5a, 0x5b,
|
||||||
0x8a, 0x30, 0x1a, 0x50, 0xc6, 0x22, 0x2e, 0x65, 0x16, 0x7e, 0x2d, 0xd1, 0xfa, 0xa9, 0x84, 0x7f,
|
0x5f, 0x5e, 0x84, 0x7e, 0x21, 0x72, 0x39, 0x25, 0x94, 0x4a, 0x56, 0x14, 0x15, 0xfc, 0x9e, 0xd6,
|
||||||
0x87, 0x1a, 0x57, 0xc3, 0x99, 0xa3, 0x9c, 0xb2, 0xe3, 0x6a, 0x58, 0x30, 0x38, 0xca, 0x9d, 0x19,
|
0x4e, 0xad, 0x84, 0x5f, 0x80, 0x1e, 0x53, 0xf3, 0x4d, 0x44, 0xdb, 0x7a, 0xc7, 0xd4, 0xbc, 0x11,
|
||||||
0xd2, 0x97, 0x1f, 0x1c, 0xe5, 0xe6, 0x86, 0x45, 0x84, 0xd5, 0x8b, 0x10, 0xfe, 0x04, 0xd5, 0x91,
|
0x10, 0xab, 0x64, 0x13, 0x60, 0x5f, 0x7e, 0x88, 0x55, 0x52, 0x07, 0xec, 0x5a, 0xe8, 0x5e, 0x66,
|
||||||
0x1c, 0x4c, 0xa8, 0xaf, 0x33, 0x35, 0xed, 0xca, 0x48, 0x1e, 0x51, 0x5f, 0x93, 0xf5, 0xa9, 0x17,
|
0xe1, 0x33, 0xe0, 0x2e, 0x8a, 0xe9, 0x8a, 0xa4, 0x86, 0xa9, 0x17, 0x75, 0x16, 0xc5, 0x03, 0x92,
|
||||||
0x70, 0x96, 0x25, 0xbe, 0xa2, 0x13, 0xaf, 0x67, 0xa2, 0x0e, 0xfc, 0x1c, 0x2e, 0xe6, 0x39, 0x5c,
|
0x1a, 0x67, 0x53, 0xc2, 0x33, 0x46, 0x2b, 0xe2, 0x5d, 0x43, 0xbc, 0x5f, 0x89, 0x06, 0xf8, 0x63,
|
||||||
0x76, 0xef, 0xeb, 0x68, 0xef, 0x02, 0xe4, 0x41, 0x59, 0x08, 0xe3, 0xc5, 0x28, 0x92, 0x64, 0xf1,
|
0x7c, 0xf1, 0x1e, 0xe3, 0xcb, 0xc9, 0xa7, 0x06, 0xed, 0xc7, 0x00, 0x35, 0x28, 0x1f, 0x61, 0xbc,
|
||||||
0xda, 0x42, 0xef, 0x56, 0x29, 0x95, 0x0a, 0xdd, 0x5a, 0x06, 0x41, 0xd8, 0xd4, 0xb1, 0x5a, 0x65,
|
0x8b, 0x42, 0x93, 0xc5, 0xd7, 0x77, 0x7a, 0xf7, 0x5b, 0x56, 0x6a, 0x74, 0xeb, 0x3b, 0x01, 0xc2,
|
||||||
0x82, 0x88, 0xd1, 0x7e, 0x56, 0x86, 0xfa, 0x11, 0x8f, 0xbc, 0x87, 0x97, 0x1f, 0x86, 0xdf, 0x00,
|
0x9e, 0xc1, 0xea, 0xb7, 0x03, 0x14, 0x38, 0xe1, 0x8f, 0x08, 0x3a, 0xef, 0x4b, 0x92, 0x2b, 0x3c,
|
||||||
0x98, 0xc7, 0x06, 0x01, 0x57, 0x43, 0xc1, 0x32, 0x24, 0x26, 0xf3, 0xd8, 0xa1, 0x16, 0x12, 0xba,
|
0x80, 0x56, 0xb5, 0x09, 0xda, 0x51, 0xeb, 0x5f, 0xed, 0x81, 0x1b, 0xe0, 0x0a, 0xc9, 0x67, 0x3c,
|
||||||
0x9e, 0x94, 0x31, 0x8f, 0x32, 0x16, 0xd9, 0xaa, 0x38, 0x43, 0x95, 0x2f, 0xcd, 0xd0, 0x85, 0x00,
|
0xaf, 0xe8, 0x57, 0x2b, 0x8d, 0x84, 0x3d, 0x5c, 0x72, 0xb9, 0x9e, 0xce, 0x19, 0x9f, 0xcd, 0x95,
|
||||||
0xfe, 0x85, 0xb5, 0x49, 0xa1, 0x83, 0xf4, 0x4c, 0x4b, 0x59, 0x58, 0xc5, 0x0b, 0xfa, 0x58, 0xdb,
|
0x61, 0xef, 0x44, 0x7d, 0x2b, 0x7e, 0x60, 0xb4, 0x93, 0x5b, 0xa6, 0xd7, 0x11, 0xb8, 0xba, 0x1c,
|
||||||
0x2b, 0xcc, 0xd2, 0xca, 0xe2, 0x99, 0x56, 0x8c, 0xe1, 0x1b, 0x26, 0xc9, 0xfc, 0xee, 0x93, 0xf4,
|
0x1f, 0xe1, 0x03, 0x18, 0x54, 0x79, 0x8f, 0x6d, 0x1a, 0xf3, 0x0e, 0xb5, 0xc3, 0x5f, 0x10, 0x74,
|
||||||
0x58, 0xe3, 0x1e, 0xe5, 0x93, 0xb4, 0x0e, 0x8d, 0x34, 0xb2, 0xe2, 0x14, 0xe1, 0x36, 0xfc, 0x5a,
|
0xcf, 0x48, 0x42, 0xa4, 0x10, 0xf9, 0x53, 0x52, 0x3b, 0x3e, 0x84, 0x6e, 0x56, 0x95, 0x64, 0xde,
|
||||||
0x98, 0xaf, 0x39, 0x80, 0xad, 0xd4, 0xab, 0xe1, 0xff, 0x0d, 0xad, 0xcf, 0x92, 0xc9, 0x8b, 0xe4,
|
0x1b, 0x2f, 0xda, 0xac, 0x9f, 0xb0, 0xaf, 0x4e, 0xf8, 0x75, 0x1b, 0xfa, 0x0f, 0x98, 0xe4, 0x9f,
|
||||||
0x3e, 0x83, 0x20, 0x52, 0xde, 0xbf, 0xf6, 0xe6, 0xb4, 0x89, 0x4e, 0x4e, 0x9b, 0xe8, 0xfd, 0x69,
|
0x5f, 0x7d, 0x3a, 0x3d, 0x0f, 0x40, 0x39, 0x9d, 0x66, 0x4c, 0xcd, 0x05, 0xad, 0x1a, 0xf4, 0x28,
|
||||||
0x13, 0xbd, 0x3a, 0x6b, 0x2e, 0x9d, 0x9c, 0x35, 0x97, 0xde, 0x9d, 0x35, 0x97, 0x1e, 0xb4, 0x8f,
|
0xa7, 0x67, 0x46, 0xd0, 0x2d, 0xf2, 0xa2, 0x28, 0x99, 0xac, 0x5b, 0xb4, 0xab, 0x26, 0x94, 0xce,
|
||||||
0x3d, 0x35, 0x8c, 0x9d, 0xae, 0x2b, 0x82, 0x9e, 0x08, 0x93, 0x57, 0xae, 0xa7, 0x7f, 0x9e, 0xf4,
|
0xdf, 0x0d, 0xb5, 0x4b, 0x77, 0xc4, 0xab, 0x70, 0x7d, 0xd5, 0xe8, 0xc0, 0x1e, 0x32, 0x76, 0x73,
|
||||||
0x92, 0xcf, 0x5c, 0x52, 0x51, 0x3a, 0x55, 0xfd, 0x89, 0xfb, 0xff, 0x63, 0x00, 0x00, 0x00, 0xff,
|
0xf8, 0xcd, 0x0b, 0xe6, 0x9c, 0xb9, 0xdb, 0x18, 0x6e, 0xdd, 0xdd, 0x43, 0xa6, 0x89, 0xe1, 0x1f,
|
||||||
0xff, 0x4d, 0x8f, 0xef, 0xfc, 0x2f, 0x07, 0x00, 0x00,
|
0x8c, 0x36, 0xef, 0x3f, 0x1f, 0x6d, 0x5f, 0x1a, 0xef, 0x16, 0xf5, 0x68, 0x3b, 0x80, 0x81, 0x45,
|
||||||
|
0xd6, 0x1c, 0x6b, 0x38, 0x84, 0xe7, 0x1a, 0x03, 0x6f, 0x6b, 0xc0, 0xb1, 0x8d, 0x35, 0xbb, 0xf1,
|
||||||
|
0x16, 0x8c, 0xfe, 0x42, 0xa6, 0x4e, 0x52, 0xc7, 0x39, 0x01, 0x0a, 0xdc, 0x7b, 0x6f, 0xfd, 0x74,
|
||||||
|
0x3e, 0x44, 0x8f, 0xce, 0x87, 0xe8, 0xb7, 0xf3, 0x21, 0xfa, 0xfe, 0x62, 0xb8, 0xf7, 0xe8, 0x62,
|
||||||
|
0xb8, 0xf7, 0xeb, 0xc5, 0x70, 0xef, 0xb3, 0x70, 0xc6, 0xd5, 0xbc, 0x8c, 0xc7, 0x89, 0xc8, 0x26,
|
||||||
|
0x22, 0xd7, 0x33, 0x60, 0x62, 0x7e, 0x1e, 0x4e, 0xf4, 0x77, 0x87, 0xce, 0x58, 0xc4, 0xae, 0xf9,
|
||||||
|
0xe6, 0x78, 0xfd, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xac, 0xdb, 0xa3, 0xc0, 0x08, 0x00,
|
||||||
|
0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Assertion) Marshal() (dAtA []byte, err error) {
|
func (m *Assertion) Marshal() (dAtA []byte, err error) {
|
||||||
@@ -781,6 +952,121 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Grant) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.ExpiryHeight != 0 {
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x28
|
||||||
|
}
|
||||||
|
if len(m.Origin) > 0 {
|
||||||
|
i -= len(m.Origin)
|
||||||
|
copy(dAtA[i:], m.Origin)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
|
}
|
||||||
|
if len(m.Subject) > 0 {
|
||||||
|
i -= len(m.Subject)
|
||||||
|
copy(dAtA[i:], m.Subject)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
if len(m.Controller) > 0 {
|
||||||
|
i -= len(m.Controller)
|
||||||
|
copy(dAtA[i:], m.Controller)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
if m.Id != 0 {
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Macaroon) > 0 {
|
||||||
|
i -= len(m.Macaroon)
|
||||||
|
copy(dAtA[i:], m.Macaroon)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Macaroon)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x32
|
||||||
|
}
|
||||||
|
if m.ExpiryHeight != 0 {
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x28
|
||||||
|
}
|
||||||
|
if len(m.Origin) > 0 {
|
||||||
|
i -= len(m.Origin)
|
||||||
|
copy(dAtA[i:], m.Origin)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x22
|
||||||
|
}
|
||||||
|
if len(m.Subject) > 0 {
|
||||||
|
i -= len(m.Subject)
|
||||||
|
copy(dAtA[i:], m.Subject)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x1a
|
||||||
|
}
|
||||||
|
if len(m.Controller) > 0 {
|
||||||
|
i -= len(m.Controller)
|
||||||
|
copy(dAtA[i:], m.Controller)
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
if m.Id != 0 {
|
||||||
|
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x8
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Verification) Marshal() (dAtA []byte, err error) {
|
func (m *Verification) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
@@ -1019,6 +1305,64 @@ func (m *Controller) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Grant) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Id != 0 {
|
||||||
|
n += 1 + sovState(uint64(m.Id))
|
||||||
|
}
|
||||||
|
l = len(m.Controller)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.Subject)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.Origin)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
if m.ExpiryHeight != 0 {
|
||||||
|
n += 1 + sovState(uint64(m.ExpiryHeight))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Macaroon) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if m.Id != 0 {
|
||||||
|
n += 1 + sovState(uint64(m.Id))
|
||||||
|
}
|
||||||
|
l = len(m.Controller)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.Subject)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
l = len(m.Origin)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
if m.ExpiryHeight != 0 {
|
||||||
|
n += 1 + sovState(uint64(m.ExpiryHeight))
|
||||||
|
}
|
||||||
|
l = len(m.Macaroon)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovState(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Verification) Size() (n int) {
|
func (m *Verification) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
@@ -2099,6 +2443,406 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *Grant) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: Grant: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||||
|
}
|
||||||
|
m.Id = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.Id |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Controller = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 3:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Subject = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 4:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Origin = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 5:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
||||||
|
}
|
||||||
|
m.ExpiryHeight = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.ExpiryHeight |= int64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipState(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *Macaroon) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: Macaroon: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: Macaroon: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||||
|
}
|
||||||
|
m.Id = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.Id |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Controller = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 3:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Subject = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 4:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Origin = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 5:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
||||||
|
}
|
||||||
|
m.ExpiryHeight = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.ExpiryHeight |= int64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowState
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Macaroon = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipState(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthState
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (m *Verification) Unmarshal(dAtA []byte) error {
|
func (m *Verification) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
# `x/macaroon`
|
|
||||||
|
|
||||||
The Macaroon module is responsible for providing decentralized access control and service authorization for the Sonr ecosystem.
|
|
||||||
|
|
||||||
## Concepts
|
|
||||||
|
|
||||||
## State
|
|
||||||
|
|
||||||
Specify and describe structures expected to marshalled into the store, and their keys
|
|
||||||
|
|
||||||
### Account State
|
|
||||||
|
|
||||||
The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key.
|
|
||||||
|
|
||||||
### Credential State
|
|
||||||
|
|
||||||
The Credential state includes the claims about a subject and is stored using the credential ID as the key.
|
|
||||||
|
|
||||||
## State Transitions
|
|
||||||
|
|
||||||
Standard state transition operations triggered by hooks, messages, etc.
|
|
||||||
|
|
||||||
## Messages
|
|
||||||
|
|
||||||
Specify message structure(s) and expected state machine behaviour(s).
|
|
||||||
|
|
||||||
## Begin Block
|
|
||||||
|
|
||||||
Specify any begin-block operations.
|
|
||||||
|
|
||||||
## End Block
|
|
||||||
|
|
||||||
Specify any end-block operations.
|
|
||||||
|
|
||||||
## Hooks
|
|
||||||
|
|
||||||
Describe available hooks to be called by/from this module.
|
|
||||||
|
|
||||||
## Events
|
|
||||||
|
|
||||||
List and describe event tags used.
|
|
||||||
|
|
||||||
## Client
|
|
||||||
|
|
||||||
List and describe CLI commands and gRPC and REST endpoints.
|
|
||||||
|
|
||||||
## Params
|
|
||||||
|
|
||||||
List all module parameters, their types (in JSON) and identitys.
|
|
||||||
|
|
||||||
## Future Improvements
|
|
||||||
|
|
||||||
Describe future improvements of this module.
|
|
||||||
|
|
||||||
## Tests
|
|
||||||
|
|
||||||
Acceptance tests.
|
|
||||||
|
|
||||||
## Appendix
|
|
||||||
|
|
||||||
Supplementary details referenced elsewhere within the spec.
|
|
||||||
his is a module base generated with [`spawn`](https://github.com/rollchains/spawn).
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
package module
|
|
||||||
|
|
||||||
import (
|
|
||||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
|
||||||
modulev1 "github.com/onsonr/sonr/api/macaroon/v1"
|
|
||||||
)
|
|
||||||
|
|
||||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
|
||||||
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|
||||||
return &autocliv1.ModuleOptions{
|
|
||||||
Query: &autocliv1.ServiceCommandDescriptor{
|
|
||||||
Service: modulev1.Query_ServiceDesc.ServiceName,
|
|
||||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
||||||
{
|
|
||||||
RpcMethod: "Params",
|
|
||||||
Use: "params",
|
|
||||||
Short: "Query the current consensus parameters",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Tx: &autocliv1.ServiceCommandDescriptor{
|
|
||||||
Service: modulev1.Msg_ServiceDesc.ServiceName,
|
|
||||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
||||||
{
|
|
||||||
RpcMethod: "UpdateParams",
|
|
||||||
Skip: false, // set to true if authority gated
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package cli
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
|
||||||
|
|
||||||
func GetQueryCmd() *cobra.Command {
|
|
||||||
queryCmd := &cobra.Command{
|
|
||||||
Use: types.ModuleName,
|
|
||||||
Short: "Querying commands for " + types.ModuleName,
|
|
||||||
DisableFlagParsing: true,
|
|
||||||
SuggestionsMinimumDistance: 2,
|
|
||||||
RunE: client.ValidateCmd,
|
|
||||||
}
|
|
||||||
queryCmd.AddCommand(
|
|
||||||
GetCmdParams(),
|
|
||||||
)
|
|
||||||
return queryCmd
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetCmdParams() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{
|
|
||||||
Use: "params",
|
|
||||||
Short: "Show all module params",
|
|
||||||
Args: cobra.ExactArgs(0),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
clientCtx, err := client.GetClientQueryContext(cmd)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
queryClient := types.NewQueryClient(clientCtx)
|
|
||||||
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return clientCtx.PrintProto(res)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
flags.AddQueryFlagsToCmd(cmd)
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package cli
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
|
||||||
|
|
||||||
// NewTxCmd returns a root CLI command handler for certain modules
|
|
||||||
// transaction commands.
|
|
||||||
func NewTxCmd() *cobra.Command {
|
|
||||||
txCmd := &cobra.Command{
|
|
||||||
Use: types.ModuleName,
|
|
||||||
Short: types.ModuleName + " subcommands.",
|
|
||||||
DisableFlagParsing: true,
|
|
||||||
SuggestionsMinimumDistance: 2,
|
|
||||||
RunE: client.ValidateCmd,
|
|
||||||
}
|
|
||||||
|
|
||||||
txCmd.AddCommand(
|
|
||||||
MsgUpdateParams(),
|
|
||||||
)
|
|
||||||
return txCmd
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns a CLI command handler for registering a
|
|
||||||
// contract for the module.
|
|
||||||
func MsgUpdateParams() *cobra.Command {
|
|
||||||
cmd := &cobra.Command{
|
|
||||||
Use: "update-params [some-value]",
|
|
||||||
Short: "Update the params (must be submitted from the authority)",
|
|
||||||
Args: cobra.ExactArgs(1),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
cliCtx, err := client.GetClientTxContext(cmd)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
senderAddress := cliCtx.GetFromAddress()
|
|
||||||
//
|
|
||||||
// someValue, err := strconv.ParseBool(args[0])
|
|
||||||
// if err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
|
|
||||||
msg := &types.MsgUpdateParams{
|
|
||||||
Authority: senderAddress.String(),
|
|
||||||
Params: types.Params{
|
|
||||||
// SomeValue: someValue,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := msg.Validate(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
flags.AddTxFlagsToCmd(cmd)
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package module
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"cosmossdk.io/core/address"
|
|
||||||
"cosmossdk.io/core/appmodule"
|
|
||||||
"cosmossdk.io/core/store"
|
|
||||||
"cosmossdk.io/depinject"
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
|
||||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
|
||||||
|
|
||||||
modulev1 "github.com/onsonr/sonr/api/macaroon/module/v1"
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ appmodule.AppModule = AppModule{}
|
|
||||||
|
|
||||||
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
|
|
||||||
func (am AppModule) IsOnePerModuleType() {}
|
|
||||||
|
|
||||||
// IsAppModule implements the appmodule.AppModule interface.
|
|
||||||
func (am AppModule) IsAppModule() {}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
appmodule.Register(
|
|
||||||
&modulev1.Module{},
|
|
||||||
appmodule.Provide(ProvideModule),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
type ModuleInputs struct {
|
|
||||||
depinject.In
|
|
||||||
|
|
||||||
Cdc codec.Codec
|
|
||||||
StoreService store.KVStoreService
|
|
||||||
AddressCodec address.Codec
|
|
||||||
AccountKeeper authkeeper.AccountKeeper
|
|
||||||
DidKeeper didkeeper.Keeper
|
|
||||||
|
|
||||||
StakingKeeper stakingkeeper.Keeper
|
|
||||||
SlashingKeeper slashingkeeper.Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
type ModuleOutputs struct {
|
|
||||||
depinject.Out
|
|
||||||
|
|
||||||
Module appmodule.AppModule
|
|
||||||
Keeper keeper.Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
|
||||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
|
||||||
|
|
||||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.AccountKeeper, in.DidKeeper)
|
|
||||||
m := NewAppModule(in.Cdc, k, in.DidKeeper)
|
|
||||||
|
|
||||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (k Keeper) Logger() log.Logger {
|
|
||||||
return k.logger
|
|
||||||
}
|
|
||||||
|
|
||||||
// InitGenesis initializes the module's state from a genesis state.
|
|
||||||
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
|
||||||
// this line is used by starport scaffolding # genesis/module/init
|
|
||||||
if err := data.Params.Validate(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return k.Params.Set(ctx, data.Params)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExportGenesis exports the module's state to a genesis state.
|
|
||||||
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
|
||||||
params, err := k.Params.Get(ctx)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/module/export
|
|
||||||
|
|
||||||
return &types.GenesisState{
|
|
||||||
Params: params,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGenesis(t *testing.T) {
|
|
||||||
f := SetupTest(t)
|
|
||||||
|
|
||||||
genesisState := &types.GenesisState{
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/test/state
|
|
||||||
}
|
|
||||||
|
|
||||||
f.k.InitGenesis(f.ctx, genesisState)
|
|
||||||
|
|
||||||
got := f.k.ExportGenesis(f.ctx)
|
|
||||||
require.NotNil(t, got)
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/test/assert
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cosmossdk.io/collections"
|
|
||||||
storetypes "cosmossdk.io/core/store"
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
"cosmossdk.io/orm/model/ormdb"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
|
|
||||||
apiv1 "github.com/onsonr/sonr/api/macaroon/v1"
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Keeper struct {
|
|
||||||
cdc codec.BinaryCodec
|
|
||||||
|
|
||||||
logger log.Logger
|
|
||||||
|
|
||||||
// state management
|
|
||||||
Schema collections.Schema
|
|
||||||
Params collections.Item[types.Params]
|
|
||||||
OrmDB apiv1.StateStore
|
|
||||||
|
|
||||||
AccountKeeper authkeeper.AccountKeeper
|
|
||||||
DIDKeeper didkeeper.Keeper
|
|
||||||
|
|
||||||
authority string
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewKeeper creates a new Keeper instance
|
|
||||||
func NewKeeper(
|
|
||||||
cdc codec.BinaryCodec,
|
|
||||||
storeService storetypes.KVStoreService,
|
|
||||||
logger log.Logger,
|
|
||||||
authority string,
|
|
||||||
accKeeper authkeeper.AccountKeeper,
|
|
||||||
didKeeper didkeeper.Keeper,
|
|
||||||
) Keeper {
|
|
||||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
|
||||||
|
|
||||||
sb := collections.NewSchemaBuilder(storeService)
|
|
||||||
|
|
||||||
if authority == "" {
|
|
||||||
authority = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
|
||||||
}
|
|
||||||
|
|
||||||
db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
store, err := apiv1.NewStateStore(db)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
k := Keeper{
|
|
||||||
cdc: cdc,
|
|
||||||
logger: logger,
|
|
||||||
|
|
||||||
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
|
||||||
OrmDB: store,
|
|
||||||
|
|
||||||
AccountKeeper: accKeeper,
|
|
||||||
DIDKeeper: didKeeper,
|
|
||||||
|
|
||||||
authority: authority,
|
|
||||||
}
|
|
||||||
|
|
||||||
schema, err := sb.Build()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
k.Schema = schema
|
|
||||||
|
|
||||||
return k
|
|
||||||
}
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"cosmossdk.io/core/store"
|
|
||||||
"cosmossdk.io/log"
|
|
||||||
storetypes "cosmossdk.io/store/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/runtime"
|
|
||||||
"github.com/cosmos/cosmos-sdk/testutil"
|
|
||||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
|
||||||
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
|
|
||||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
|
||||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
|
||||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
|
||||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"github.com/stretchr/testify/suite"
|
|
||||||
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
module "github.com/onsonr/sonr/x/macaroon"
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
var maccPerms = map[string][]string{
|
|
||||||
authtypes.FeeCollectorName: nil,
|
|
||||||
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
|
|
||||||
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
|
|
||||||
minttypes.ModuleName: {authtypes.Minter},
|
|
||||||
govtypes.ModuleName: {authtypes.Burner},
|
|
||||||
}
|
|
||||||
|
|
||||||
type testFixture struct {
|
|
||||||
suite.Suite
|
|
||||||
|
|
||||||
ctx sdk.Context
|
|
||||||
k keeper.Keeper
|
|
||||||
msgServer types.MsgServer
|
|
||||||
queryServer types.QueryServer
|
|
||||||
appModule *module.AppModule
|
|
||||||
|
|
||||||
accountkeeper authkeeper.AccountKeeper
|
|
||||||
didk didkeeper.Keeper
|
|
||||||
bankkeeper bankkeeper.BaseKeeper
|
|
||||||
stakingKeeper *stakingkeeper.Keeper
|
|
||||||
mintkeeper mintkeeper.Keeper
|
|
||||||
|
|
||||||
addrs []sdk.AccAddress
|
|
||||||
govModAddr string
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetupTest(t *testing.T) *testFixture {
|
|
||||||
t.Helper()
|
|
||||||
f := new(testFixture)
|
|
||||||
require := require.New(t)
|
|
||||||
|
|
||||||
// Base setup
|
|
||||||
logger := log.NewTestLogger(t)
|
|
||||||
encCfg := moduletestutil.MakeTestEncodingConfig()
|
|
||||||
|
|
||||||
f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
|
||||||
f.addrs = simtestutil.CreateIncrementalAccounts(3)
|
|
||||||
|
|
||||||
key := storetypes.NewKVStoreKey(types.ModuleName)
|
|
||||||
storeService := runtime.NewKVStoreService(key)
|
|
||||||
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
|
|
||||||
|
|
||||||
f.ctx = testCtx.Ctx
|
|
||||||
|
|
||||||
// Register SDK modules.
|
|
||||||
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
|
||||||
|
|
||||||
// Setup Keeper.
|
|
||||||
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.accountkeeper, f.didk)
|
|
||||||
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
|
||||||
f.queryServer = keeper.NewQuerier(f.k)
|
|
||||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didk)
|
|
||||||
|
|
||||||
return f
|
|
||||||
}
|
|
||||||
|
|
||||||
func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) {
|
|
||||||
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
|
||||||
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
|
||||||
|
|
||||||
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
|
||||||
}
|
|
||||||
|
|
||||||
func registerBaseSDKModules(
|
|
||||||
f *testFixture,
|
|
||||||
encCfg moduletestutil.TestEncodingConfig,
|
|
||||||
storeService store.KVStoreService,
|
|
||||||
logger log.Logger,
|
|
||||||
require *require.Assertions,
|
|
||||||
) {
|
|
||||||
registerModuleInterfaces(encCfg)
|
|
||||||
|
|
||||||
// Auth Keeper.
|
|
||||||
f.accountkeeper = authkeeper.NewAccountKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
authtypes.ProtoBaseAccount,
|
|
||||||
maccPerms,
|
|
||||||
authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix,
|
|
||||||
f.govModAddr,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Bank Keeper.
|
|
||||||
f.bankkeeper = bankkeeper.NewBaseKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
f.accountkeeper,
|
|
||||||
nil,
|
|
||||||
f.govModAddr, logger,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Staking Keeper.
|
|
||||||
f.stakingKeeper = stakingkeeper.NewKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
f.accountkeeper, f.bankkeeper, f.govModAddr,
|
|
||||||
authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
|
|
||||||
authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
|
||||||
)
|
|
||||||
require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams()))
|
|
||||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx))
|
|
||||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx))
|
|
||||||
|
|
||||||
// Mint Keeper.
|
|
||||||
f.mintkeeper = mintkeeper.NewKeeper(
|
|
||||||
encCfg.Codec, storeService,
|
|
||||||
f.stakingKeeper, f.accountkeeper, f.bankkeeper,
|
|
||||||
authtypes.FeeCollectorName, f.govModAddr,
|
|
||||||
)
|
|
||||||
f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName))
|
|
||||||
f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState())
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestORM(t *testing.T) {
|
|
||||||
f := SetupTest(t)
|
|
||||||
if f == nil {
|
|
||||||
t.FailNow()
|
|
||||||
}
|
|
||||||
// dt := f.k.OrmDB.ExampleDataTable()
|
|
||||||
// acc := []byte("test_acc")
|
|
||||||
// amt := uint64(7)
|
|
||||||
//
|
|
||||||
// err := dt.Insert(f.ctx, &apiv1.ExampleData{
|
|
||||||
// Account: acc,
|
|
||||||
// Amount: amt,
|
|
||||||
// })
|
|
||||||
// require.NoError(t, err)
|
|
||||||
//
|
|
||||||
// d, err := dt.Has(f.ctx, []byte("test_acc"))
|
|
||||||
// require.NoError(t, err)
|
|
||||||
// require.True(t, d)
|
|
||||||
//
|
|
||||||
// res, err := dt.Get(f.ctx, []byte("test_acc"))
|
|
||||||
// require.NoError(t, err)
|
|
||||||
// require.NotNil(t, res)
|
|
||||||
// require.EqualValues(t, amt, res.Amount)
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ types.QueryServer = Querier{}
|
|
||||||
|
|
||||||
type Querier struct {
|
|
||||||
Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewQuerier(keeper Keeper) Querier {
|
|
||||||
return Querier{Keeper: keeper}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
|
||||||
|
|
||||||
p, err := k.Keeper.Params.Get(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &types.QueryParamsResponse{Params: &p}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// RefreshToken implements types.QueryServer.
|
|
||||||
func (k Querier) RefreshToken(goCtx context.Context, req *types.QueryRefreshTokenRequest) (*types.QueryRefreshTokenResponse, error) {
|
|
||||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
||||||
return &types.QueryRefreshTokenResponse{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateToken implements types.QueryServer.
|
|
||||||
func (k Querier) ValidateToken(goCtx context.Context, req *types.QueryValidateTokenRequest) (*types.QueryValidateTokenResponse, error) {
|
|
||||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
||||||
return &types.QueryValidateTokenResponse{}, nil
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package keeper
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"cosmossdk.io/errors"
|
|
||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
type msgServer struct {
|
|
||||||
k Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ types.MsgServer = msgServer{}
|
|
||||||
|
|
||||||
// NewMsgServerImpl returns an implementation of the module MsgServer interface.
|
|
||||||
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
|
|
||||||
return &msgServer{k: keeper}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
|
||||||
if ms.k.authority != msg.Authority {
|
|
||||||
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, ms.k.Params.Set(ctx, msg.Params)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AuthorizeService implements types.MsgServer.
|
|
||||||
func (ms msgServer) AuthorizeService(ctx context.Context, msg *types.MsgIssueMacaroon) (*types.MsgIssueMacaroonResponse, error) {
|
|
||||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
||||||
return &types.MsgIssueMacaroonResponse{}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// IssueMacaroon implements types.MsgServer.
|
|
||||||
func (ms msgServer) IssueMacaroon(ctx context.Context, msg *types.MsgIssueMacaroon) (*types.MsgIssueMacaroonResponse, error) {
|
|
||||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
|
||||||
return &types.MsgIssueMacaroonResponse{}, nil
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
package keeper_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestParams(t *testing.T) {
|
|
||||||
f := SetupTest(t)
|
|
||||||
require := require.New(t)
|
|
||||||
|
|
||||||
testCases := []struct {
|
|
||||||
name string
|
|
||||||
request *types.MsgUpdateParams
|
|
||||||
err bool
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
name: "fail; invalid authority",
|
|
||||||
request: &types.MsgUpdateParams{
|
|
||||||
Authority: f.addrs[0].String(),
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
},
|
|
||||||
err: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "success",
|
|
||||||
request: &types.MsgUpdateParams{
|
|
||||||
Authority: f.govModAddr,
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
},
|
|
||||||
err: false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
|
||||||
tc := tc
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
|
||||||
_, err := f.msgServer.UpdateParams(f.ctx, tc.request)
|
|
||||||
|
|
||||||
if tc.err {
|
|
||||||
require.Error(err)
|
|
||||||
} else {
|
|
||||||
require.NoError(err)
|
|
||||||
|
|
||||||
r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{})
|
|
||||||
require.NoError(err)
|
|
||||||
|
|
||||||
require.EqualValues(&tc.request.Params, r.Params)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
package module
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"cosmossdk.io/client/v2/autocli"
|
|
||||||
errorsmod "cosmossdk.io/errors"
|
|
||||||
abci "github.com/cometbft/cometbft/abci/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/types/module"
|
|
||||||
"github.com/gorilla/mux"
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
||||||
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// ConsensusVersion defines the current x/macaroon module consensus version.
|
|
||||||
ConsensusVersion = 1
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # simapp/module/const
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
_ module.AppModuleBasic = AppModuleBasic{}
|
|
||||||
_ module.AppModuleGenesis = AppModule{}
|
|
||||||
_ module.AppModule = AppModule{}
|
|
||||||
|
|
||||||
_ autocli.HasAutoCLIConfig = AppModule{}
|
|
||||||
)
|
|
||||||
|
|
||||||
// AppModuleBasic defines the basic application module used by the wasm module.
|
|
||||||
type AppModuleBasic struct {
|
|
||||||
cdc codec.Codec
|
|
||||||
}
|
|
||||||
|
|
||||||
type AppModule struct {
|
|
||||||
AppModuleBasic
|
|
||||||
|
|
||||||
keeper keeper.Keeper
|
|
||||||
didk didkeeper.Keeper
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAppModule constructor
|
|
||||||
func NewAppModule(
|
|
||||||
cdc codec.Codec,
|
|
||||||
keeper keeper.Keeper,
|
|
||||||
didkeeper didkeeper.Keeper,
|
|
||||||
) *AppModule {
|
|
||||||
return &AppModule{
|
|
||||||
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
|
||||||
keeper: keeper,
|
|
||||||
didk: didkeeper,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) Name() string {
|
|
||||||
return types.ModuleName
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
|
|
||||||
return cdc.MustMarshalJSON(&types.GenesisState{
|
|
||||||
Params: types.DefaultParams(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
|
|
||||||
var data types.GenesisState
|
|
||||||
err := marshaler.UnmarshalJSON(message, &data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := data.Params.Validate(); err != nil {
|
|
||||||
return errorsmod.Wrap(err, "params")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
|
|
||||||
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
|
|
||||||
if err != nil {
|
|
||||||
// same behavior as in cosmos-sdk
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods.
|
|
||||||
/*
|
|
||||||
func (a AppModuleBasic) GetTxCmd() *cobra.Command {
|
|
||||||
return cli.NewTxCmd()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
|
|
||||||
return cli.GetQueryCmd()
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|
||||||
types.RegisterLegacyAminoCodec(cdc)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) {
|
|
||||||
types.RegisterInterfaces(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate {
|
|
||||||
var genesisState types.GenesisState
|
|
||||||
marshaler.MustUnmarshalJSON(message, &genesisState)
|
|
||||||
|
|
||||||
if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage {
|
|
||||||
genState := a.keeper.ExportGenesis(ctx)
|
|
||||||
return marshaler.MustMarshalJSON(genState)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) QuerierRoute() string {
|
|
||||||
return types.QuerierRoute
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppModule) RegisterServices(cfg module.Configurator) {
|
|
||||||
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper))
|
|
||||||
types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper))
|
|
||||||
}
|
|
||||||
|
|
||||||
// ConsensusVersion is a sequence number for state-breaking change of the
|
|
||||||
// module. It should be incremented on each consensus-breaking change
|
|
||||||
// introduced by the module. To avoid wrong/empty versions, the initial version
|
|
||||||
// should be set to 1.
|
|
||||||
func (a AppModule) ConsensusVersion() uint64 {
|
|
||||||
return ConsensusVersion
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
fmt "fmt"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
OriginMacroonCaveat MacroonCaveat = "origin"
|
|
||||||
ScopesMacroonCaveat MacroonCaveat = "scopes"
|
|
||||||
SubjectMacroonCaveat MacroonCaveat = "subject"
|
|
||||||
ExpMacroonCaveat MacroonCaveat = "exp"
|
|
||||||
TokenMacroonCaveat MacroonCaveat = "token"
|
|
||||||
)
|
|
||||||
|
|
||||||
var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat}
|
|
||||||
|
|
||||||
type MacroonCaveat string
|
|
||||||
|
|
||||||
func (c MacroonCaveat) Equal(other string) bool {
|
|
||||||
return string(c) == other
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c MacroonCaveat) String() string {
|
|
||||||
return string(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c MacroonCaveat) Verify(value string) error {
|
|
||||||
switch c {
|
|
||||||
case OriginMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
case ScopesMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
case SubjectMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
case ExpMacroonCaveat:
|
|
||||||
// Check if the expiration time is still valid
|
|
||||||
exp, err := time.Parse(time.RFC3339, value)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if time.Now().After(exp) {
|
|
||||||
return fmt.Errorf("expired")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
case TokenMacroonCaveat:
|
|
||||||
return nil
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("unknown caveat: %s", c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
|
||||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
|
||||||
// this line is used by starport scaffolding # 1
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
amino = codec.NewLegacyAmino()
|
|
||||||
AminoCdc = codec.NewAminoCodec(amino)
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
RegisterLegacyAminoCodec(amino)
|
|
||||||
cryptocodec.RegisterCrypto(amino)
|
|
||||||
sdk.RegisterLegacyAminoCodec(amino)
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
|
||||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|
||||||
cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
|
||||||
// this line is used by starport scaffolding # 3
|
|
||||||
|
|
||||||
registry.RegisterImplementations(
|
|
||||||
(*sdk.Msg)(nil),
|
|
||||||
&MsgUpdateParams{},
|
|
||||||
)
|
|
||||||
|
|
||||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import sdkerrors "cosmossdk.io/errors"
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 100, "invalid genesis state")
|
|
||||||
ErrUnauthorizedMacaroonToken = sdkerrors.Register(ModuleName, 200, "unauthorized macaroon token")
|
|
||||||
ErrInvalidMacaroonScopes = sdkerrors.Register(ModuleName, 201, "invalid macaroon scopes")
|
|
||||||
ErrInvalidMacaroonController = sdkerrors.Register(ModuleName, 202, "invalid macaroon controller")
|
|
||||||
ErrInvalidTransactionSignature = sdkerrors.Register(ModuleName, 203, "invalid supplied transaction signature")
|
|
||||||
)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
package types
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # genesis/types/import
|
|
||||||
|
|
||||||
// DefaultIndex is the default global index
|
|
||||||
const DefaultIndex uint64 = 1
|
|
||||||
|
|
||||||
// DefaultGenesis returns the default genesis state
|
|
||||||
func DefaultGenesis() *GenesisState {
|
|
||||||
return &GenesisState{
|
|
||||||
// this line is used by starport scaffolding # genesis/types/default
|
|
||||||
Params: DefaultParams(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate performs basic genesis state validation returning an error upon any
|
|
||||||
// failure.
|
|
||||||
func (gs GenesisState) Validate() error {
|
|
||||||
// this line is used by starport scaffolding # genesis/types/validate
|
|
||||||
|
|
||||||
return gs.Params.Validate()
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,42 +0,0 @@
|
|||||||
package types_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/onsonr/sonr/x/macaroon/types"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGenesisState_Validate(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
desc string
|
|
||||||
genState *types.GenesisState
|
|
||||||
valid bool
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
desc: "default is valid",
|
|
||||||
genState: types.DefaultGenesis(),
|
|
||||||
valid: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
desc: "valid genesis state",
|
|
||||||
genState: &types.GenesisState{
|
|
||||||
|
|
||||||
// this line is used by starport scaffolding # types/genesis/validField
|
|
||||||
},
|
|
||||||
valid: true,
|
|
||||||
},
|
|
||||||
// this line is used by starport scaffolding # types/genesis/testcase
|
|
||||||
}
|
|
||||||
for _, tc := range tests {
|
|
||||||
t.Run(tc.desc, func(t *testing.T) {
|
|
||||||
err := tc.genState.Validate()
|
|
||||||
if tc.valid {
|
|
||||||
require.NoError(t, err)
|
|
||||||
} else {
|
|
||||||
require.Error(t, err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cosmossdk.io/collections"
|
|
||||||
|
|
||||||
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
// ParamsKey saves the current module params.
|
|
||||||
ParamsKey = collections.NewPrefix(0)
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
ModuleName = "macaroon"
|
|
||||||
|
|
||||||
StoreKey = ModuleName
|
|
||||||
|
|
||||||
QuerierRoute = ModuleName
|
|
||||||
)
|
|
||||||
|
|
||||||
var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{
|
|
||||||
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
|
||||||
{Id: 1, ProtoFileName: "macaroon/v1/state.proto"},
|
|
||||||
},
|
|
||||||
Prefix: []byte{0},
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cosmossdk.io/errors"
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ sdk.Msg = &MsgUpdateParams{}
|
|
||||||
|
|
||||||
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
|
||||||
func NewMsgUpdateParams(
|
|
||||||
sender sdk.Address,
|
|
||||||
someValue bool,
|
|
||||||
) *MsgUpdateParams {
|
|
||||||
return &MsgUpdateParams{
|
|
||||||
Authority: sender.String(),
|
|
||||||
Params: Params{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Route returns the name of the module
|
|
||||||
func (msg MsgUpdateParams) Route() string { return ModuleName }
|
|
||||||
|
|
||||||
// Type returns the the action
|
|
||||||
func (msg MsgUpdateParams) Type() string { return "update_params" }
|
|
||||||
|
|
||||||
// GetSignBytes implements the LegacyMsg interface.
|
|
||||||
func (msg MsgUpdateParams) GetSignBytes() []byte {
|
|
||||||
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
|
||||||
func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
|
||||||
addr, _ := sdk.AccAddressFromBech32(msg.Authority)
|
|
||||||
return []sdk.AccAddress{addr}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateBasic does a sanity check on the provided data.
|
|
||||||
func (msg *MsgUpdateParams) Validate() error {
|
|
||||||
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
|
||||||
return errors.Wrap(err, "invalid authority address")
|
|
||||||
}
|
|
||||||
|
|
||||||
return msg.Params.Validate()
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DefaultParams returns default module parameters.
|
|
||||||
func DefaultParams() Params {
|
|
||||||
return Params{
|
|
||||||
Methods: DefaultMethods(),
|
|
||||||
Scopes: DefaultScopes(),
|
|
||||||
Caveats: DefaultCaveats(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stringer method for Params.
|
|
||||||
func (p Params) String() string {
|
|
||||||
bz, err := json.Marshal(p)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return string(bz)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate does the sanity check on the params.
|
|
||||||
func (p Params) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func DefaultMethods() *Methods {
|
|
||||||
return &Methods{
|
|
||||||
Default: "did:sonr",
|
|
||||||
Supported: []string{"did:key", "did:web", "did:sonr", "did:ipfs", "did:btcr", "did:ethr"},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func DefaultScopes() *Scopes {
|
|
||||||
return &Scopes{
|
|
||||||
Base: "openid profile sonr.address",
|
|
||||||
Supported: []string{"create", "read", "update", "delete", "sign", "verify", "simulate", "execute", "broadcast", "admin"},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func DefaultCaveats() *Caveats {
|
|
||||||
return &Caveats{
|
|
||||||
// First party - JWT Format
|
|
||||||
SupportedFirstParty: DefaultFirstPartyCaveats(),
|
|
||||||
// Third party - UCAN Format
|
|
||||||
SupportedThirdParty: DefaultThirdPartyCaveats(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func DefaultFirstPartyCaveats() []*Caveat {
|
|
||||||
return []*Caveat{
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "aud",
|
|
||||||
Description: "Audience must be a valid DID",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "exp",
|
|
||||||
Description: "Expiration time must be a valid timestamp",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "iat",
|
|
||||||
Description: "Issued at time must be a valid timestamp",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "iss",
|
|
||||||
Description: "Issuer must be a valid DID",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "nbf",
|
|
||||||
Description: "Not before time must be a valid timestamp",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "nonce",
|
|
||||||
Description: "Nonce must be a valid string",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
|
||||||
Caveat: "sub",
|
|
||||||
Description: "Subject must be a valid DID",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func DefaultThirdPartyCaveats() []*Caveat {
|
|
||||||
return []*Caveat{
|
|
||||||
{
|
|
||||||
Scopes: []string{"create", "read", "update", "delete", "sign", "verify", "simulate", "execute", "broadcast", "admin"},
|
|
||||||
Caveat: "cap",
|
|
||||||
Description: "Capability must be a valid capability",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Scopes: []string{"create", "read", "update", "delete", "sign", "verify", "simulate", "execute", "broadcast", "admin"},
|
|
||||||
Caveat: "exp",
|
|
||||||
Description: "Expiration time must be a valid timestamp",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Caveat) Equal(other *Caveat) bool {
|
|
||||||
return c.Caveat == other.Caveat
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,319 +0,0 @@
|
|||||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
|
||||||
// source: macaroon/v1/query.proto
|
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a reverse proxy.
|
|
||||||
|
|
||||||
It translates gRPC into RESTful JSON APIs.
|
|
||||||
*/
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/golang/protobuf/descriptor"
|
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
|
||||||
"google.golang.org/grpc"
|
|
||||||
"google.golang.org/grpc/codes"
|
|
||||||
"google.golang.org/grpc/grpclog"
|
|
||||||
"google.golang.org/grpc/metadata"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Suppress "imported and not used" errors
|
|
||||||
var _ codes.Code
|
|
||||||
var _ io.Reader
|
|
||||||
var _ status.Status
|
|
||||||
var _ = runtime.String
|
|
||||||
var _ = utilities.NewDoubleArray
|
|
||||||
var _ = descriptor.ForMessage
|
|
||||||
var _ = metadata.Join
|
|
||||||
|
|
||||||
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryParamsRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryParamsRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
msg, err := server.Params(ctx, &protoReq)
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
filter_Query_RefreshToken_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
|
||||||
)
|
|
||||||
|
|
||||||
func request_Query_RefreshToken_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryRefreshTokenRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
if err := req.ParseForm(); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RefreshToken_0); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
msg, err := client.RefreshToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func local_request_Query_RefreshToken_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryRefreshTokenRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
if err := req.ParseForm(); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RefreshToken_0); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
msg, err := server.RefreshToken(ctx, &protoReq)
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
filter_Query_ValidateToken_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
|
||||||
)
|
|
||||||
|
|
||||||
func request_Query_ValidateToken_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryValidateTokenRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
if err := req.ParseForm(); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidateToken_0); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
msg, err := client.ValidateToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func local_request_Query_ValidateToken_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
||||||
var protoReq QueryValidateTokenRequest
|
|
||||||
var metadata runtime.ServerMetadata
|
|
||||||
|
|
||||||
if err := req.ParseForm(); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidateToken_0); err != nil {
|
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
msg, err := server.ValidateToken(ctx, &protoReq)
|
|
||||||
return msg, metadata, err
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
|
||||||
// UnaryRPC :call QueryServer directly.
|
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
|
||||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
var stream runtime.ServerTransportStream
|
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
|
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
mux.Handle("POST", pattern_Query_RefreshToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
var stream runtime.ServerTransportStream
|
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := local_request_Query_RefreshToken_0(rctx, inboundMarshaler, server, req, pathParams)
|
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_RefreshToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
mux.Handle("POST", pattern_Query_ValidateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
var stream runtime.ServerTransportStream
|
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := local_request_Query_ValidateToken_0(rctx, inboundMarshaler, server, req, pathParams)
|
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_ValidateToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but
|
|
||||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
|
||||||
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
|
||||||
conn, err := grpc.Dial(endpoint, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer func() {
|
|
||||||
if err != nil {
|
|
||||||
if cerr := conn.Close(); cerr != nil {
|
|
||||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
go func() {
|
|
||||||
<-ctx.Done()
|
|
||||||
if cerr := conn.Close(); cerr != nil {
|
|
||||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}()
|
|
||||||
|
|
||||||
return RegisterQueryHandler(ctx, mux, conn)
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandler registers the http handlers for service Query to "mux".
|
|
||||||
// The handlers forward requests to the grpc endpoint over "conn".
|
|
||||||
func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
|
||||||
return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn))
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterQueryHandlerClient registers the http handlers for service Query
|
|
||||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient".
|
|
||||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient"
|
|
||||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
|
||||||
// "QueryClient" to call the correct interceptors.
|
|
||||||
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error {
|
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
mux.Handle("POST", pattern_Query_RefreshToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := request_Query_RefreshToken_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_RefreshToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
mux.Handle("POST", pattern_Query_ValidateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
|
||||||
defer cancel()
|
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
||||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, md, err := request_Query_ValidateToken_0(rctx, inboundMarshaler, client, req, pathParams)
|
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
|
||||||
if err != nil {
|
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
forward_Query_ValidateToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"macaroon", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
|
||||||
|
|
||||||
pattern_Query_RefreshToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"macaroon", "v1", "refresh"}, "", runtime.AssumeColonVerbOpt(false)))
|
|
||||||
|
|
||||||
pattern_Query_ValidateToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"macaroon", "v1", "validate"}, "", runtime.AssumeColonVerbOpt(false)))
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
|
||||||
|
|
||||||
forward_Query_RefreshToken_0 = runtime.ForwardResponseMessage
|
|
||||||
|
|
||||||
forward_Query_ValidateToken_0 = runtime.ForwardResponseMessage
|
|
||||||
)
|
|
||||||
@@ -1,890 +0,0 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
||||||
// source: macaroon/v1/state.proto
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "cosmossdk.io/orm"
|
|
||||||
fmt "fmt"
|
|
||||||
proto "github.com/cosmos/gogoproto/proto"
|
|
||||||
io "io"
|
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||||
var _ = proto.Marshal
|
|
||||||
var _ = fmt.Errorf
|
|
||||||
var _ = math.Inf
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type Grant struct {
|
|
||||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
||||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
|
||||||
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
|
||||||
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
|
||||||
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) Reset() { *m = Grant{} }
|
|
||||||
func (m *Grant) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*Grant) ProtoMessage() {}
|
|
||||||
func (*Grant) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_2ade56339acadfd8, []int{0}
|
|
||||||
}
|
|
||||||
func (m *Grant) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Grant.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Grant) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Grant.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Grant) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Grant) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Grant.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_Grant proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func (m *Grant) GetId() uint64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Id
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) GetController() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Controller
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) GetSubject() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Subject
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) GetOrigin() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Origin
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) GetExpiryHeight() int64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.ExpiryHeight
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
type Macaroon struct {
|
|
||||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
||||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
|
||||||
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
|
||||||
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
|
||||||
ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"`
|
|
||||||
Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) Reset() { *m = Macaroon{} }
|
|
||||||
func (m *Macaroon) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*Macaroon) ProtoMessage() {}
|
|
||||||
func (*Macaroon) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_2ade56339acadfd8, []int{1}
|
|
||||||
}
|
|
||||||
func (m *Macaroon) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Macaroon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Macaroon.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Macaroon) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Macaroon.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Macaroon) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Macaroon) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Macaroon.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_Macaroon proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func (m *Macaroon) GetId() uint64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Id
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) GetController() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Controller
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) GetSubject() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Subject
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) GetOrigin() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Origin
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) GetExpiryHeight() int64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.ExpiryHeight
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) GetMacaroon() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Macaroon
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterType((*Grant)(nil), "macaroon.v1.Grant")
|
|
||||||
proto.RegisterType((*Macaroon)(nil), "macaroon.v1.Macaroon")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { proto.RegisterFile("macaroon/v1/state.proto", fileDescriptor_2ade56339acadfd8) }
|
|
||||||
|
|
||||||
var fileDescriptor_2ade56339acadfd8 = []byte{
|
|
||||||
// 307 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x4d, 0x4c, 0x4e,
|
|
||||||
0x2c, 0xca, 0xcf, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28,
|
|
||||||
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x49, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7,
|
|
||||||
0xe6, 0x17, 0xeb, 0xe7, 0x17, 0xe5, 0x82, 0xd4, 0xe5, 0x17, 0xe5, 0x42, 0x54, 0x29, 0x6d, 0x63,
|
|
||||||
0xe4, 0x62, 0x75, 0x2f, 0x4a, 0xcc, 0x2b, 0x11, 0xe2, 0xe3, 0x62, 0xca, 0x4c, 0x91, 0x60, 0x54,
|
|
||||||
0x60, 0xd4, 0x60, 0x09, 0x62, 0xca, 0x4c, 0x11, 0x92, 0xe3, 0xe2, 0x4a, 0xce, 0xcf, 0x2b, 0x29,
|
|
||||||
0xca, 0xcf, 0xc9, 0x49, 0x2d, 0x92, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x0c, 0x42, 0x12, 0x11, 0x92,
|
|
||||||
0xe0, 0x62, 0x2f, 0x2e, 0x4d, 0xca, 0x4a, 0x4d, 0x2e, 0x91, 0x60, 0x06, 0x4b, 0xc2, 0xb8, 0x42,
|
|
||||||
0x62, 0x5c, 0x6c, 0xf9, 0x45, 0x99, 0xe9, 0x99, 0x79, 0x12, 0x2c, 0x60, 0x09, 0x28, 0x4f, 0x48,
|
|
||||||
0x99, 0x8b, 0x37, 0xb5, 0xa2, 0x20, 0xb3, 0xa8, 0x32, 0x3e, 0x23, 0x35, 0x33, 0x3d, 0xa3, 0x44,
|
|
||||||
0x82, 0x55, 0x81, 0x51, 0x83, 0x39, 0x88, 0x07, 0x22, 0xe8, 0x01, 0x16, 0xb3, 0x52, 0xfb, 0x34,
|
|
||||||
0xef, 0x72, 0x1f, 0xb3, 0x02, 0x17, 0x1b, 0xc8, 0x39, 0x02, 0x8c, 0x42, 0x22, 0x5c, 0x7c, 0x50,
|
|
||||||
0x73, 0x75, 0x20, 0xc6, 0x08, 0x30, 0x4a, 0x30, 0x4a, 0x30, 0x2a, 0x5d, 0x65, 0xe4, 0xe2, 0xf0,
|
|
||||||
0x85, 0xfa, 0x70, 0x90, 0xb8, 0x5d, 0x48, 0x8a, 0x8b, 0x03, 0x16, 0xe8, 0x12, 0x6c, 0x60, 0xed,
|
|
||||||
0x70, 0x3e, 0x91, 0xfe, 0x62, 0x72, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6,
|
|
||||||
0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39,
|
|
||||||
0x86, 0x28, 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xfc, 0xbc,
|
|
||||||
0xe2, 0xfc, 0xbc, 0x22, 0x7d, 0x30, 0x51, 0xa1, 0x0f, 0x4f, 0x02, 0x25, 0x95, 0x05, 0xa9, 0xc5,
|
|
||||||
0x49, 0x6c, 0xe0, 0xa8, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x46, 0x4a, 0xd1, 0x1b,
|
|
||||||
0x02, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.ExpiryHeight != 0 {
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x28
|
|
||||||
}
|
|
||||||
if len(m.Origin) > 0 {
|
|
||||||
i -= len(m.Origin)
|
|
||||||
copy(dAtA[i:], m.Origin)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
}
|
|
||||||
if len(m.Subject) > 0 {
|
|
||||||
i -= len(m.Subject)
|
|
||||||
copy(dAtA[i:], m.Subject)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
}
|
|
||||||
if len(m.Controller) > 0 {
|
|
||||||
i -= len(m.Controller)
|
|
||||||
copy(dAtA[i:], m.Controller)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if m.Id != 0 {
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if len(m.Macaroon) > 0 {
|
|
||||||
i -= len(m.Macaroon)
|
|
||||||
copy(dAtA[i:], m.Macaroon)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Macaroon)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x32
|
|
||||||
}
|
|
||||||
if m.ExpiryHeight != 0 {
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x28
|
|
||||||
}
|
|
||||||
if len(m.Origin) > 0 {
|
|
||||||
i -= len(m.Origin)
|
|
||||||
copy(dAtA[i:], m.Origin)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
}
|
|
||||||
if len(m.Subject) > 0 {
|
|
||||||
i -= len(m.Subject)
|
|
||||||
copy(dAtA[i:], m.Subject)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
}
|
|
||||||
if len(m.Controller) > 0 {
|
|
||||||
i -= len(m.Controller)
|
|
||||||
copy(dAtA[i:], m.Controller)
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if m.Id != 0 {
|
|
||||||
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x8
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovState(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Grant) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Id != 0 {
|
|
||||||
n += 1 + sovState(uint64(m.Id))
|
|
||||||
}
|
|
||||||
l = len(m.Controller)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Subject)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Origin)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
if m.ExpiryHeight != 0 {
|
|
||||||
n += 1 + sovState(uint64(m.ExpiryHeight))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Macaroon) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Id != 0 {
|
|
||||||
n += 1 + sovState(uint64(m.Id))
|
|
||||||
}
|
|
||||||
l = len(m.Controller)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Subject)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Origin)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
if m.ExpiryHeight != 0 {
|
|
||||||
n += 1 + sovState(uint64(m.ExpiryHeight))
|
|
||||||
}
|
|
||||||
l = len(m.Macaroon)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovState(uint64(l))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovState(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozState(x uint64) (n int) {
|
|
||||||
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (m *Grant) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Grant: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
||||||
}
|
|
||||||
m.Id = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Id |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Controller = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Subject = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Origin = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 5:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
|
||||||
}
|
|
||||||
m.ExpiryHeight = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.ExpiryHeight |= int64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipState(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (m *Macaroon) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Macaroon: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Macaroon: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
||||||
}
|
|
||||||
m.Id = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Id |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Controller = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Subject = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Origin = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 5:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType)
|
|
||||||
}
|
|
||||||
m.ExpiryHeight = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.ExpiryHeight |= int64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Macaroon = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipState(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipState(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowState
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupState
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthState
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
||||||
ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
|
|
||||||
ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
|
||||||
File diff suppressed because it is too large
Load Diff
+60
-32
@@ -1,63 +1,91 @@
|
|||||||
# `x/service`
|
# `x/service`
|
||||||
|
|
||||||
The Service module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It leverages
|
The Service module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It provides a secure and verifiable mechanism for registering and authorizing services using Decentralized Identifiers (DIDs).
|
||||||
the native NFT module associated with DID Methods to provide a secure and verifiable mechanism for registering and authorizing services.
|
|
||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
|
- **Service**: A decentralized service on the Sonr Blockchain with properties such as ID, authority, origin, name, description, category, tags, and expiry height.
|
||||||
|
- **Profile**: Represents a DID alias with properties like ID, subject, origin, and controller.
|
||||||
|
- **Metadata**: Contains information about a service, including name, description, category, icon, and tags.
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
- [x/did](https://github.com/onsonr/sonr/tree/master/x/did)
|
||||||
|
- [x/group](https://github.com/onsonr/sonr/tree/master/x/group)
|
||||||
|
- [x/nft](https://github.com/onsonr/sonr/tree/master/x/nft)
|
||||||
|
|
||||||
## State
|
## State
|
||||||
|
|
||||||
Specify and describe structures expected to marshalled into the store, and their keys
|
The module uses the following state structures:
|
||||||
|
|
||||||
### Account State
|
### Metadata
|
||||||
|
|
||||||
The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key.
|
Stores information about services:
|
||||||
|
|
||||||
### Credential State
|
- Primary key: `id` (auto-increment)
|
||||||
|
- Unique index: `origin`
|
||||||
|
- Fields: id, origin, name, description, category, icon (URI), tags
|
||||||
|
|
||||||
The Credential state includes the claims about a subject and is stored using the credential ID as the key.
|
### Profile
|
||||||
|
|
||||||
## State Transitions
|
Stores DID alias information:
|
||||||
|
|
||||||
Standard state transition operations triggered by hooks, messages, etc.
|
- Primary key: `id`
|
||||||
|
- Unique index: `subject,origin`
|
||||||
|
- Fields: id, subject, origin, controller
|
||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
Specify message structure(s) and expected state machine behaviour(s).
|
### MsgUpdateParams
|
||||||
|
|
||||||
## Begin Block
|
Updates the module parameters. Can only be executed by the governance account.
|
||||||
|
|
||||||
Specify any begin-block operations.
|
### MsgRegisterService
|
||||||
|
|
||||||
## End Block
|
Registers a new service on the blockchain. Requires a valid TXT record in DNS for the origin.
|
||||||
|
|
||||||
Specify any end-block operations.
|
|
||||||
|
|
||||||
## Hooks
|
|
||||||
|
|
||||||
Describe available hooks to be called by/from this module.
|
|
||||||
|
|
||||||
## Events
|
|
||||||
|
|
||||||
List and describe event tags used.
|
|
||||||
|
|
||||||
## Client
|
|
||||||
|
|
||||||
List and describe CLI commands and gRPC and REST endpoints.
|
|
||||||
|
|
||||||
## Params
|
## Params
|
||||||
|
|
||||||
List all module parameters, their types (in JSON) and identitys.
|
The module has the following parameters:
|
||||||
|
|
||||||
|
- `categories`: List of allowed service categories
|
||||||
|
- `types`: List of allowed service types
|
||||||
|
|
||||||
|
## Query
|
||||||
|
|
||||||
|
The module provides the following query:
|
||||||
|
|
||||||
|
### Params
|
||||||
|
|
||||||
|
Retrieves all parameters of the module.
|
||||||
|
|
||||||
|
## Client
|
||||||
|
|
||||||
|
### gRPC
|
||||||
|
|
||||||
|
The module provides a gRPC Query service with the following RPC:
|
||||||
|
|
||||||
|
- `Params`: Get all parameters of the module
|
||||||
|
|
||||||
|
### CLI
|
||||||
|
|
||||||
|
(TODO: Add CLI commands for interacting with the module)
|
||||||
|
|
||||||
|
## Events
|
||||||
|
|
||||||
|
(TODO: List and describe event tags used by the module)
|
||||||
|
|
||||||
## Future Improvements
|
## Future Improvements
|
||||||
|
|
||||||
Describe future improvements of this module.
|
- Implement service discovery mechanisms
|
||||||
|
- Add support for service reputation and rating systems
|
||||||
|
- Enhance service metadata with more detailed information
|
||||||
|
- Implement service update and deactivation functionality
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Acceptance tests.
|
(TODO: Add acceptance tests for the module)
|
||||||
|
|
||||||
## Appendix
|
## Appendix
|
||||||
|
|
||||||
Supplementary details referenced elsewhere within the spec.
|
This module is part of the Sonr blockchain project and interacts with other modules such as DID and NFT modules to provide a comprehensive decentralized service ecosystem.
|
||||||
his is a module base generated with [`spawn`](https://github.com/rollchains/spawn).
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import (
|
|||||||
|
|
||||||
modulev1 "github.com/onsonr/sonr/api/service/module/v1"
|
modulev1 "github.com/onsonr/sonr/api/service/module/v1"
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/service/keeper"
|
"github.com/onsonr/sonr/x/service/keeper"
|
||||||
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
||||||
)
|
)
|
||||||
@@ -47,7 +46,6 @@ type ModuleInputs struct {
|
|||||||
|
|
||||||
DidKeeper didkeeper.Keeper
|
DidKeeper didkeeper.Keeper
|
||||||
GroupKeeper groupkeeper.Keeper
|
GroupKeeper groupkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
|
||||||
NFTKeeper nftkeeper.Keeper
|
NFTKeeper nftkeeper.Keeper
|
||||||
StakingKeeper stakingkeeper.Keeper
|
StakingKeeper stakingkeeper.Keeper
|
||||||
SlashingKeeper slashingkeeper.Keeper
|
SlashingKeeper slashingkeeper.Keeper
|
||||||
@@ -64,8 +62,8 @@ type ModuleOutputs struct {
|
|||||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
|
||||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.DidKeeper, in.GroupKeeper, in.MacaroonKeeper, in.NFTKeeper, in.VaultKeeper)
|
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.DidKeeper, in.GroupKeeper, in.NFTKeeper, in.VaultKeeper)
|
||||||
m := NewAppModule(in.Cdc, k, in.DidKeeper, in.MacaroonKeeper)
|
m := NewAppModule(in.Cdc, k, in.DidKeeper)
|
||||||
|
|
||||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import (
|
|||||||
|
|
||||||
apiv1 "github.com/onsonr/sonr/api/service/v1"
|
apiv1 "github.com/onsonr/sonr/api/service/v1"
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/service/types"
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
||||||
)
|
)
|
||||||
@@ -30,11 +29,10 @@ type Keeper struct {
|
|||||||
|
|
||||||
authority string
|
authority string
|
||||||
|
|
||||||
DidKeeper didkeeper.Keeper
|
DidKeeper didkeeper.Keeper
|
||||||
GroupKeeper groupkeeper.Keeper
|
GroupKeeper groupkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
NFTKeeper nftkeeper.Keeper
|
||||||
NFTKeeper nftkeeper.Keeper
|
VaultKeeper vaultkeeper.Keeper
|
||||||
VaultKeeper vaultkeeper.Keeper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewKeeper creates a new Keeper instance
|
// NewKeeper creates a new Keeper instance
|
||||||
@@ -45,7 +43,6 @@ func NewKeeper(
|
|||||||
authority string,
|
authority string,
|
||||||
didKeeper didkeeper.Keeper,
|
didKeeper didkeeper.Keeper,
|
||||||
groupKeeper groupkeeper.Keeper,
|
groupKeeper groupkeeper.Keeper,
|
||||||
macaroonKeeper macaroonkeeper.Keeper,
|
|
||||||
nftKeeper nftkeeper.Keeper,
|
nftKeeper nftkeeper.Keeper,
|
||||||
vaultKeeper vaultkeeper.Keeper,
|
vaultKeeper vaultkeeper.Keeper,
|
||||||
) Keeper {
|
) Keeper {
|
||||||
@@ -76,10 +73,9 @@ func NewKeeper(
|
|||||||
|
|
||||||
authority: authority,
|
authority: authority,
|
||||||
|
|
||||||
DidKeeper: didKeeper,
|
DidKeeper: didKeeper,
|
||||||
GroupKeeper: groupKeeper,
|
GroupKeeper: groupKeeper,
|
||||||
MacaroonKeeper: macaroonKeeper,
|
NFTKeeper: nftKeeper,
|
||||||
NFTKeeper: nftKeeper,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
schema, err := sb.Build()
|
schema, err := sb.Build()
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import (
|
|||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
module "github.com/onsonr/sonr/x/service"
|
module "github.com/onsonr/sonr/x/service"
|
||||||
"github.com/onsonr/sonr/x/service/keeper"
|
"github.com/onsonr/sonr/x/service/keeper"
|
||||||
"github.com/onsonr/sonr/x/service/types"
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
@@ -54,7 +53,6 @@ type testFixture struct {
|
|||||||
bankkeeper bankkeeper.BaseKeeper
|
bankkeeper bankkeeper.BaseKeeper
|
||||||
didkeeper didkeeper.Keeper
|
didkeeper didkeeper.Keeper
|
||||||
groupkeeper groupkeeper.Keeper
|
groupkeeper groupkeeper.Keeper
|
||||||
mack macaroonkeeper.Keeper
|
|
||||||
stakingKeeper *stakingkeeper.Keeper
|
stakingKeeper *stakingkeeper.Keeper
|
||||||
mintkeeper mintkeeper.Keeper
|
mintkeeper mintkeeper.Keeper
|
||||||
nftkeeper nftkeeper.Keeper
|
nftkeeper nftkeeper.Keeper
|
||||||
@@ -86,10 +84,10 @@ func SetupTest(t *testing.T) *testFixture {
|
|||||||
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
||||||
|
|
||||||
// Setup Keeper.
|
// Setup Keeper.
|
||||||
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.didkeeper, f.groupkeeper, f.mack, f.nftkeeper, f.vaultkeeper)
|
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.didkeeper, f.groupkeeper, f.nftkeeper, f.vaultkeeper)
|
||||||
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
||||||
f.queryServer = keeper.NewQuerier(f.k)
|
f.queryServer = keeper.NewQuerier(f.k)
|
||||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didkeeper, f.mack)
|
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didkeeper)
|
||||||
|
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import (
|
|||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/service/keeper"
|
"github.com/onsonr/sonr/x/service/keeper"
|
||||||
"github.com/onsonr/sonr/x/service/types"
|
"github.com/onsonr/sonr/x/service/types"
|
||||||
)
|
)
|
||||||
@@ -46,7 +45,6 @@ type AppModule struct {
|
|||||||
|
|
||||||
keeper keeper.Keeper
|
keeper keeper.Keeper
|
||||||
didk didkeeper.Keeper
|
didk didkeeper.Keeper
|
||||||
mack macaroonkeeper.Keeper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAppModule constructor
|
// NewAppModule constructor
|
||||||
@@ -54,13 +52,11 @@ func NewAppModule(
|
|||||||
cdc codec.Codec,
|
cdc codec.Codec,
|
||||||
keeper keeper.Keeper,
|
keeper keeper.Keeper,
|
||||||
didkeeper didkeeper.Keeper,
|
didkeeper didkeeper.Keeper,
|
||||||
macaroonkeeper macaroonkeeper.Keeper,
|
|
||||||
) *AppModule {
|
) *AppModule {
|
||||||
return &AppModule{
|
return &AppModule{
|
||||||
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
||||||
keeper: keeper,
|
keeper: keeper,
|
||||||
didk: didkeeper,
|
didk: didkeeper,
|
||||||
mack: macaroonkeeper,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ var (
|
|||||||
ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 100, "invalid genesis state")
|
ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 100, "invalid genesis state")
|
||||||
ErrInvalidServiceOrigin = sdkerrors.Register(ModuleName, 200, "invalid service origin")
|
ErrInvalidServiceOrigin = sdkerrors.Register(ModuleName, 200, "invalid service origin")
|
||||||
ErrUnrecognizedService = sdkerrors.Register(ModuleName, 201, "unrecognized service")
|
ErrUnrecognizedService = sdkerrors.Register(ModuleName, 201, "unrecognized service")
|
||||||
|
ErrInvalidServiceGroup = sdkerrors.Register(ModuleName, 202, "invalid group")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
package types
|
|
||||||
@@ -17,6 +17,5 @@ func DefaultGenesis() *GenesisState {
|
|||||||
// failure.
|
// failure.
|
||||||
func (gs GenesisState) Validate() error {
|
func (gs GenesisState) Validate() error {
|
||||||
// this line is used by starport scaffolding # genesis/types/validate
|
// this line is used by starport scaffolding # genesis/types/validate
|
||||||
|
|
||||||
return gs.Params.Validate()
|
return gs.Params.Validate()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ import (
|
|||||||
|
|
||||||
var _ sdk.Msg = &MsgUpdateParams{}
|
var _ sdk.Msg = &MsgUpdateParams{}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ MsgUpdateParams type definition │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
||||||
func NewMsgUpdateParams(
|
func NewMsgUpdateParams(
|
||||||
sender sdk.Address,
|
sender sdk.Address,
|
||||||
@@ -37,11 +41,14 @@ func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
|||||||
return []sdk.AccAddress{addr}
|
return []sdk.AccAddress{addr}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateBasic does a sanity check on the provided data.
|
// Validate does a sanity check on the provided data.
|
||||||
func (msg *MsgUpdateParams) Validate() error {
|
func (msg *MsgUpdateParams) Validate() error {
|
||||||
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
||||||
return errors.Wrap(err, "invalid authority address")
|
return errors.Wrap(err, "invalid authority address")
|
||||||
}
|
}
|
||||||
|
|
||||||
return msg.Params.Validate()
|
return msg.Params.Validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ╭───────────────────────────────────────────────────────────╮
|
||||||
|
// │ Registration Components │
|
||||||
|
// ╰───────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
+91
-17
@@ -4,62 +4,136 @@ The Vault module is responsible for the management of IPFS deployed Decentralize
|
|||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
|
The Vault module introduces several key concepts:
|
||||||
|
|
||||||
|
1. Decentralized Web Node (DWN): A distributed network for storing and sharing data.
|
||||||
|
2. Schema: A structure defining the format of various data types in the vault.
|
||||||
|
3. IPFS Integration: The module can interact with IPFS for decentralized data storage.
|
||||||
|
|
||||||
## State
|
## State
|
||||||
|
|
||||||
Specify and describe structures expected to marshalled into the store, and their keys
|
The Vault module maintains the following state:
|
||||||
|
|
||||||
### Account State
|
### DWN State
|
||||||
|
|
||||||
The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key.
|
The DWN state is stored using the following structure:
|
||||||
|
|
||||||
### Credential State
|
```protobuf
|
||||||
|
message DWN {
|
||||||
|
uint64 id = 1;
|
||||||
|
string alias = 2;
|
||||||
|
string cid = 3;
|
||||||
|
string resolver = 4;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
The Credential state includes the claims about a subject and is stored using the credential ID as the key.
|
This state is indexed by ID, alias, and CID for efficient querying.
|
||||||
|
|
||||||
|
### Params State
|
||||||
|
|
||||||
|
The module parameters are stored in the following structure:
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
message Params {
|
||||||
|
bool ipfs_active = 1;
|
||||||
|
bool local_registration_enabled = 2;
|
||||||
|
Schema schema = 4;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Schema State
|
||||||
|
|
||||||
|
The Schema state defines the structure for various data types:
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
message Schema {
|
||||||
|
int32 version = 1;
|
||||||
|
string account = 2;
|
||||||
|
string asset = 3;
|
||||||
|
string chain = 4;
|
||||||
|
string credential = 5;
|
||||||
|
string did = 6;
|
||||||
|
string jwk = 7;
|
||||||
|
string grant = 8;
|
||||||
|
string keyshare = 9;
|
||||||
|
string profile = 10;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## State Transitions
|
## State Transitions
|
||||||
|
|
||||||
Standard state transition operations triggered by hooks, messages, etc.
|
State transitions in the Vault module are primarily triggered by:
|
||||||
|
|
||||||
|
1. Updating module parameters
|
||||||
|
2. Allocating new vaults
|
||||||
|
3. Syncing DID documents
|
||||||
|
|
||||||
## Messages
|
## Messages
|
||||||
|
|
||||||
Specify message structure(s) and expected state machine behaviour(s).
|
The Vault module defines the following message:
|
||||||
|
|
||||||
|
1. `MsgUpdateParams`: Used to update the module parameters.
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
message MsgUpdateParams {
|
||||||
|
string authority = 1;
|
||||||
|
Params params = 2;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Begin Block
|
## Begin Block
|
||||||
|
|
||||||
Specify any begin-block operations.
|
No specific begin-block operations are defined for this module.
|
||||||
|
|
||||||
## End Block
|
## End Block
|
||||||
|
|
||||||
Specify any end-block operations.
|
No specific end-block operations are defined for this module.
|
||||||
|
|
||||||
## Hooks
|
## Hooks
|
||||||
|
|
||||||
Describe available hooks to be called by/from this module.
|
The Vault module does not define any hooks.
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
List and describe event tags used.
|
The Vault module does not explicitly define any events. However, standard Cosmos SDK events may be emitted during state transitions.
|
||||||
|
|
||||||
## Client
|
## Client
|
||||||
|
|
||||||
List and describe CLI commands and gRPC and REST endpoints.
|
The Vault module provides the following gRPC query endpoints:
|
||||||
|
|
||||||
|
1. `Params`: Queries all parameters of the module.
|
||||||
|
2. `Schema`: Queries the DID document schema.
|
||||||
|
3. `Allocate`: Initializes a Target Vault available for claims.
|
||||||
|
4. `Sync`: Queries the DID document by its ID and returns required information.
|
||||||
|
|
||||||
## Params
|
## Params
|
||||||
|
|
||||||
List all module parameters, their types (in JSON) and identitys.
|
The module parameters include:
|
||||||
|
|
||||||
|
- `ipfs_active` (bool): Indicates if IPFS integration is active.
|
||||||
|
- `local_registration_enabled` (bool): Indicates if local registration is enabled.
|
||||||
|
- `schema` (Schema): Defines the structure for various data types in the vault.
|
||||||
|
|
||||||
## Future Improvements
|
## Future Improvements
|
||||||
|
|
||||||
Describe future improvements of this module.
|
Potential future improvements could include:
|
||||||
|
|
||||||
|
1. Enhanced IPFS integration features.
|
||||||
|
2. Additional authentication mechanisms beyond WebAuthn.
|
||||||
|
3. Improved DID document management and querying capabilities.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Acceptance tests.
|
Acceptance tests should cover:
|
||||||
|
|
||||||
|
1. Parameter updates
|
||||||
|
2. DWN state management
|
||||||
|
3. Schema queries
|
||||||
|
4. Vault allocation process
|
||||||
|
5. DID document syncing
|
||||||
|
|
||||||
## Appendix
|
## Appendix
|
||||||
|
|
||||||
Supplementary details referenced elsewhere within the spec.
|
|
||||||
|
|
||||||
| Concept | Description |
|
| Concept | Description |
|
||||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. |
|
| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. |
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import (
|
|||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
|
|
||||||
modulev1 "github.com/onsonr/sonr/api/vault/module/v1"
|
modulev1 "github.com/onsonr/sonr/api/vault/module/v1"
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
@@ -45,7 +44,6 @@ type ModuleInputs struct {
|
|||||||
|
|
||||||
AccountKeeper authkeeper.AccountKeeper
|
AccountKeeper authkeeper.AccountKeeper
|
||||||
DidKeeper didkeeper.Keeper
|
DidKeeper didkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
|
||||||
StakingKeeper stakingkeeper.Keeper
|
StakingKeeper stakingkeeper.Keeper
|
||||||
SlashingKeeper slashingkeeper.Keeper
|
SlashingKeeper slashingkeeper.Keeper
|
||||||
}
|
}
|
||||||
@@ -60,7 +58,7 @@ type ModuleOutputs struct {
|
|||||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||||
|
|
||||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.AccountKeeper, in.DidKeeper, in.MacaroonKeeper)
|
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.AccountKeeper, in.DidKeeper)
|
||||||
m := NewAppModule(in.Cdc, k, in.DidKeeper)
|
m := NewAppModule(in.Cdc, k, in.DidKeeper)
|
||||||
|
|
||||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import (
|
|||||||
apiv1 "github.com/onsonr/sonr/api/vault/v1"
|
apiv1 "github.com/onsonr/sonr/api/vault/v1"
|
||||||
dwngen "github.com/onsonr/sonr/internal/dwn/gen"
|
dwngen "github.com/onsonr/sonr/internal/dwn/gen"
|
||||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||||
macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper"
|
|
||||||
"github.com/onsonr/sonr/x/vault/types"
|
"github.com/onsonr/sonr/x/vault/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -36,9 +35,8 @@ type Keeper struct {
|
|||||||
ipfsClient *rpc.HttpApi
|
ipfsClient *rpc.HttpApi
|
||||||
hasIpfsConn bool
|
hasIpfsConn bool
|
||||||
|
|
||||||
AccountKeeper authkeeper.AccountKeeper
|
AccountKeeper authkeeper.AccountKeeper
|
||||||
DIDKeeper didkeeper.Keeper
|
DIDKeeper didkeeper.Keeper
|
||||||
MacaroonKeeper macaroonkeeper.Keeper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewKeeper creates a new Keeper instance
|
// NewKeeper creates a new Keeper instance
|
||||||
@@ -49,7 +47,6 @@ func NewKeeper(
|
|||||||
authority string,
|
authority string,
|
||||||
authKeeper authkeeper.AccountKeeper,
|
authKeeper authkeeper.AccountKeeper,
|
||||||
didKeeper didkeeper.Keeper,
|
didKeeper didkeeper.Keeper,
|
||||||
macaroonKeeper macaroonkeeper.Keeper,
|
|
||||||
) Keeper {
|
) Keeper {
|
||||||
var hasIpfs bool
|
var hasIpfs bool
|
||||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||||
@@ -80,13 +77,12 @@ func NewKeeper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
k := Keeper{
|
k := Keeper{
|
||||||
cdc: cdc,
|
cdc: cdc,
|
||||||
logger: logger,
|
logger: logger,
|
||||||
DIDKeeper: didKeeper,
|
DIDKeeper: didKeeper,
|
||||||
MacaroonKeeper: macaroonKeeper,
|
AccountKeeper: authKeeper,
|
||||||
AccountKeeper: authKeeper,
|
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
||||||
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
OrmDB: store,
|
||||||
OrmDB: store,
|
|
||||||
|
|
||||||
ipfsClient: ipfsClient,
|
ipfsClient: ipfsClient,
|
||||||
hasIpfsConn: hasIpfs,
|
hasIpfsConn: hasIpfs,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user