mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feat(macaroon): add transaction allowlist/denylist caveats
This commit is contained in:
+300
-27
@@ -8,6 +8,7 @@ import (
|
||||
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
|
||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||
proto "github.com/cosmos/gogoproto/proto"
|
||||
_ "github.com/onsonr/sonr/x/did/types"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
@@ -292,44 +293,103 @@ func (m *Caveats) GetSupportedThirdParty() []string {
|
||||
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
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GenesisState)(nil), "macaroon.v1.GenesisState")
|
||||
proto.RegisterType((*Params)(nil), "macaroon.v1.Params")
|
||||
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")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) }
|
||||
|
||||
var fileDescriptor_06e0b5dfdf5e52ba = []byte{
|
||||
// 414 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0xcb, 0xd3, 0x30,
|
||||
0x18, 0xc7, 0x9b, 0xbd, 0x2f, 0x2d, 0xcb, 0x2b, 0xa8, 0xd9, 0x84, 0x6e, 0x8c, 0x6e, 0xf4, 0xe2,
|
||||
0x50, 0x68, 0xd9, 0xbc, 0xed, 0xb6, 0x09, 0x7a, 0x12, 0x46, 0xb7, 0x93, 0x08, 0x23, 0x6b, 0xb3,
|
||||
0xae, 0x60, 0x9b, 0x92, 0x64, 0xc3, 0x7d, 0x05, 0xbd, 0x78, 0xf4, 0xb8, 0x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b, 0xd7, 0x02, 0x00, 0x00,
|
||||
// 470 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x6a, 0xdb, 0x30,
|
||||
0x18, 0xc7, 0xad, 0xb4, 0x38, 0x8b, 0x5a, 0xe8, 0xa6, 0xb6, 0xe0, 0x86, 0xe2, 0x14, 0x5f, 0x56,
|
||||
0x36, 0xb0, 0x49, 0x77, 0xcb, 0xad, 0x1d, 0x6c, 0xa7, 0x41, 0x71, 0x73, 0x1a, 0x83, 0xa2, 0xd8,
|
||||
0xaa, 0x2d, 0xb0, 0x25, 0x23, 0x29, 0x59, 0xf3, 0x0a, 0x63, 0x87, 0x1d, 0x77, 0xec, 0x23, 0x0c,
|
||||
0xf6, 0x12, 0x3d, 0xf6, 0xb8, 0xd3, 0x18, 0xc9, 0x61, 0x7b, 0x8c, 0x61, 0x49, 0x76, 0xda, 0x2d,
|
||||
0xd0, 0x8b, 0x91, 0xbe, 0xdf, 0xf7, 0xff, 0x7f, 0xff, 0x4f, 0x18, 0x1e, 0x94, 0x38, 0xc1, 0x82,
|
||||
0x73, 0x16, 0xcd, 0x86, 0x51, 0x46, 0x18, 0x91, 0x54, 0x86, 0x95, 0xe0, 0x8a, 0xa3, 0xad, 0x06,
|
||||
0x85, 0xb3, 0x61, 0xff, 0x19, 0x2e, 0x29, 0xe3, 0x91, 0xfe, 0x1a, 0xde, 0xdf, 0xcb, 0x78, 0xc6,
|
||||
0xf5, 0x31, 0xaa, 0x4f, 0xb6, 0xba, 0x93, 0xd2, 0xb4, 0xf6, 0x52, 0xd7, 0xa6, 0x10, 0x9c, 0xc2,
|
||||
0xed, 0xb7, 0xc6, 0xf7, 0x42, 0x61, 0x45, 0xd0, 0x10, 0xba, 0x15, 0x16, 0xb8, 0x94, 0x1e, 0x38,
|
||||
0x02, 0xc7, 0x5b, 0x27, 0xbb, 0xe1, 0xbd, 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, 0x9b, 0x9a, 0x9d, 0xd7, 0xe8, 0xa1, 0x46, 0xe5, 0x54, 0xa4, 0x56, 0xd3,
|
||||
0xf9, 0x47, 0x33, 0xae, 0x99, 0xd6, 0xac, 0x5b, 0xd2, 0x3e, 0x70, 0x90, 0xc3, 0xed, 0xb1, 0xc0,
|
||||
0x4c, 0xe2, 0x44, 0x51, 0xce, 0x64, 0xbd, 0x16, 0x2e, 0x0a, 0xfe, 0xb1, 0xa0, 0x52, 0xd9, 0x18,
|
||||
0xab, 0x02, 0xea, 0xc3, 0x27, 0x29, 0x61, 0x73, 0x0d, 0xcd, 0xbc, 0xf6, 0x3e, 0xf2, 0x9b, 0x21,
|
||||
0xfb, 0xed, 0x10, 0x75, 0xcf, 0xf9, 0xec, 0xf4, 0x76, 0xe1, 0x83, 0xbb, 0x85, 0x0f, 0x7e, 0x2d,
|
||||
0x7c, 0xf0, 0x65, 0xe9, 0x3b, 0x77, 0x4b, 0xdf, 0xf9, 0xb1, 0xf4, 0x9d, 0xf7, 0xcf, 0x33, 0xaa,
|
||||
0xf2, 0xe9, 0x24, 0x4c, 0x78, 0x19, 0x71, 0x26, 0x39, 0x13, 0x91, 0xfe, 0x5c, 0x47, 0x2b, 0xa7,
|
||||
0x79, 0x45, 0xe4, 0xc4, 0xd5, 0xff, 0xfb, 0xab, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x19, 0xb5,
|
||||
0x2c, 0xe7, 0x53, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *Params) Equal(that interface{}) bool {
|
||||
@@ -463,6 +523,43 @@ 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)
|
||||
@@ -674,6 +771,47 @@ 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 encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovGenesis(v)
|
||||
base := offset
|
||||
@@ -776,6 +914,27 @@ 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 sovGenesis(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -1365,6 +1524,120 @@ 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 skipGenesis(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
Reference in New Issue
Block a user