docs(marketing): improve section data model and section rendering

This commit is contained in:
Prad Nukala
2024-10-24 16:11:30 -04:00
parent c8657022a2
commit f14f6ff536
9 changed files with 97 additions and 1007 deletions
+32 -303
View File
@@ -293,60 +293,6 @@ func (m *Caveats) GetSupportedThirdParty() []*Caveat {
return nil
}
// Transactions defines the allowlist,denylist for transactions which can be
// broadcasted to the network with the Sonr DWN Signed macaroon.
type Transactions struct {
Allowlist []string `protobuf:"bytes,1,rep,name=allowlist,proto3" json:"allowlist,omitempty"`
Denylist []string `protobuf:"bytes,2,rep,name=denylist,proto3" json:"denylist,omitempty"`
}
func (m *Transactions) Reset() { *m = Transactions{} }
func (m *Transactions) String() string { return proto.CompactTextString(m) }
func (*Transactions) ProtoMessage() {}
func (*Transactions) Descriptor() ([]byte, []int) {
return fileDescriptor_06e0b5dfdf5e52ba, []int{5}
}
func (m *Transactions) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Transactions.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 *Transactions) XXX_Merge(src proto.Message) {
xxx_messageInfo_Transactions.Merge(m, src)
}
func (m *Transactions) XXX_Size() int {
return m.Size()
}
func (m *Transactions) XXX_DiscardUnknown() {
xxx_messageInfo_Transactions.DiscardUnknown(m)
}
var xxx_messageInfo_Transactions proto.InternalMessageInfo
func (m *Transactions) GetAllowlist() []string {
if m != nil {
return m.Allowlist
}
return nil
}
func (m *Transactions) GetDenylist() []string {
if m != nil {
return m.Denylist
}
return nil
}
type Caveat struct {
Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3" json:"scopes,omitempty"`
Caveat string `protobuf:"bytes,2,opt,name=caveat,proto3" json:"caveat,omitempty"`
@@ -357,7 +303,7 @@ func (m *Caveat) Reset() { *m = Caveat{} }
func (m *Caveat) String() string { return proto.CompactTextString(m) }
func (*Caveat) ProtoMessage() {}
func (*Caveat) Descriptor() ([]byte, []int) {
return fileDescriptor_06e0b5dfdf5e52ba, []int{6}
return fileDescriptor_06e0b5dfdf5e52ba, []int{5}
}
func (m *Caveat) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -413,47 +359,43 @@ func init() {
proto.RegisterType((*Methods)(nil), "macaroon.v1.Methods")
proto.RegisterType((*Scopes)(nil), "macaroon.v1.Scopes")
proto.RegisterType((*Caveats)(nil), "macaroon.v1.Caveats")
proto.RegisterType((*Transactions)(nil), "macaroon.v1.Transactions")
proto.RegisterType((*Caveat)(nil), "macaroon.v1.Caveat")
}
func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) }
var fileDescriptor_06e0b5dfdf5e52ba = []byte{
// 517 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6a, 0xdb, 0x40,
0x10, 0xb6, 0xec, 0x20, 0x57, 0xe3, 0x40, 0xda, 0xcd, 0x0f, 0x8a, 0x09, 0xb2, 0xd1, 0xa5, 0xa1,
0x05, 0x09, 0xb7, 0x37, 0xdf, 0x92, 0x42, 0x73, 0x2a, 0x84, 0x8d, 0x4f, 0xa1, 0x10, 0xd6, 0xd2,
0xc6, 0x16, 0x58, 0x5a, 0xb1, 0xbb, 0x76, 0xe3, 0x57, 0xe8, 0xa9, 0xc7, 0x1e, 0xf3, 0x08, 0x85,
0x42, 0x9f, 0x21, 0xc7, 0x1c, 0x7b, 0x2a, 0xc5, 0x3e, 0xb4, 0x8f, 0x51, 0xb4, 0xbb, 0x92, 0x1d,
0x62, 0x68, 0x2e, 0xcb, 0xce, 0x7c, 0xf3, 0x7d, 0xf3, 0xed, 0x68, 0x04, 0x87, 0x29, 0x89, 0x08,
0x67, 0x2c, 0x0b, 0x67, 0xbd, 0x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e, 0xbd, 0xda, 0xe5, 0xcb, 0x51, 0x22, 0xc7,
0xd3, 0x61, 0x10, 0xb1, 0x34, 0x64, 0x99, 0x60, 0x19, 0x0f, 0xd5, 0x71, 0x13, 0xae, 0x5c, 0xce,
0x73, 0x2a, 0x86, 0xb6, 0xfa, 0xeb, 0xde, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x50, 0xa1, 0x26,
0x49, 0xd9, 0x03, 0x00, 0x00,
// 471 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6a, 0xdb, 0x30,
0x18, 0xb7, 0x92, 0xe2, 0xe0, 0x2f, 0x83, 0x6e, 0x6a, 0x57, 0xdc, 0x52, 0x9c, 0xe0, 0xcb, 0xca,
0x06, 0x36, 0xd9, 0x6e, 0xbd, 0xb5, 0x83, 0xf5, 0x34, 0x28, 0x6a, 0x4f, 0x65, 0x50, 0x14, 0x5b,
0x4d, 0x0c, 0xb3, 0x25, 0x24, 0x25, 0xb4, 0xaf, 0xb0, 0xd3, 0x8e, 0x3b, 0xf6, 0x11, 0x06, 0x83,
0x3d, 0x43, 0x8f, 0x3d, 0xee, 0x34, 0x46, 0x72, 0xd8, 0x1e, 0x63, 0x58, 0x92, 0xbd, 0x96, 0x06,
0xd6, 0x8b, 0x90, 0xbe, 0xdf, 0x1f, 0xfd, 0xf4, 0x7d, 0x36, 0x6c, 0x97, 0x34, 0xa3, 0x92, 0xf3,
0x2a, 0x9d, 0x8f, 0xd2, 0x09, 0xab, 0x98, 0x2a, 0x54, 0x22, 0x24, 0xd7, 0x1c, 0xf7, 0x1b, 0x28,
0x99, 0x8f, 0x76, 0x9e, 0xd1, 0xb2, 0xa8, 0x78, 0x6a, 0x56, 0x8b, 0xef, 0xac, 0xe7, 0x45, 0x5e,
0xab, 0xf4, 0xa5, 0x2b, 0x6c, 0x4e, 0xf8, 0x84, 0x9b, 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c1, 0xf3, 0x56, 0x72, 0x7e, 0x51, 0x48, 0xa5, 0xcf, 0x05, 0x95, 0xfa, 0x2a, 0x44, 0xc3, 0xee,
0x83, 0x4e, 0x5a, 0x11, 0xd9, 0x68, 0x15, 0xef, 0x6a, 0xc1, 0x71, 0xcd, 0xbf, 0x6f, 0xa4, 0xa7,
0x85, 0xcc, 0x9d, 0x51, 0xe7, 0x31, 0x46, 0xa7, 0xb5, 0xc0, 0x18, 0xad, 0x6a, 0x87, 0x1b, 0x45,
0x7c, 0x06, 0xbe, 0x55, 0xe2, 0xad, 0x76, 0xe2, 0xc8, 0xbc, 0xbb, 0x19, 0xee, 0x16, 0xf8, 0x96,
0x6c, 0xbe, 0x84, 0x80, 0xb8, 0x13, 0x1e, 0x42, 0x3f, 0x67, 0x2a, 0x93, 0x85, 0xd0, 0x05, 0xaf,
0xcc, 0xe0, 0x03, 0x72, 0xb7, 0x74, 0x78, 0x70, 0xb3, 0x88, 0xd0, 0xed, 0x22, 0x42, 0xbf, 0x16,
0x11, 0xfa, 0xbc, 0x8c, 0xbc, 0xdb, 0x65, 0xe4, 0xfd, 0x58, 0x46, 0xde, 0xd9, 0x8b, 0x49, 0xa1,
0xa7, 0xb3, 0x71, 0x92, 0xf1, 0x32, 0xe5, 0x95, 0xe2, 0x95, 0x4c, 0xcd, 0x72, 0x99, 0xb6, 0x01,
0xf5, 0x95, 0x60, 0x6a, 0xec, 0x9b, 0x7f, 0xe1, 0xcd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8a,
0x01, 0xb7, 0x87, 0x6f, 0x03, 0x00, 0x00,
}
func (this *Params) Equal(that interface{}) bool {
@@ -587,43 +529,6 @@ func (this *Caveats) Equal(that interface{}) bool {
}
return true
}
func (this *Transactions) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Transactions)
if !ok {
that2, ok := that.(Transactions)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if len(this.Allowlist) != len(that1.Allowlist) {
return false
}
for i := range this.Allowlist {
if this.Allowlist[i] != that1.Allowlist[i] {
return false
}
}
if len(this.Denylist) != len(that1.Denylist) {
return false
}
for i := range this.Denylist {
if this.Denylist[i] != that1.Denylist[i] {
return false
}
}
return true
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -845,47 +750,6 @@ func (m *Caveats) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *Transactions) 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 *Transactions) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Transactions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Denylist) > 0 {
for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Denylist[iNdEx])
copy(dAtA[i:], m.Denylist[iNdEx])
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denylist[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if len(m.Allowlist) > 0 {
for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Allowlist[iNdEx])
copy(dAtA[i:], m.Allowlist[iNdEx])
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Allowlist[iNdEx])))
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *Caveat) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -1034,27 +898,6 @@ func (m *Caveats) Size() (n int) {
return n
}
func (m *Transactions) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Allowlist) > 0 {
for _, s := range m.Allowlist {
l = len(s)
n += 1 + l + sovGenesis(uint64(l))
}
}
if len(m.Denylist) > 0 {
for _, s := range m.Denylist {
l = len(s)
n += 1 + l + sovGenesis(uint64(l))
}
}
return n
}
func (m *Caveat) Size() (n int) {
if m == nil {
return 0
@@ -1671,120 +1514,6 @@ func (m *Caveats) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *Transactions) 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 ErrIntOverflowGenesis
}
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: Transactions: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Transactions: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Caveat) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0