Skip to content

Commit

Permalink
feat!: make grant expiration optional
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Jan 28, 2022
1 parent 2251739 commit 932bb6d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
9 changes: 6 additions & 3 deletions api/cosmos/authz/v1beta1/authz.pulsar.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,11 @@ type Grant struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

Authorization *anypb.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"`
Expiration *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration,omitempty"`
Authorization *anypb.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"`
// time when the grant will expire and will be pruned. If null, then the grant
// doesn't have a time expiration (other conditions in `authorization`
// may apply to invalidate the grant)
Expiration *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration,omitempty"`
}

func (x *Grant) Reset() {
Expand Down Expand Up @@ -1073,7 +1076,7 @@ var file_cosmos_authz_v1beta1_authz_proto_rawDesc = []byte{
0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f,
0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x01, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x42, 0xe0, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a,
0x41, 0x75, 0x74, 0x68, 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, 0x67, 0x69,
Expand Down
7 changes: 5 additions & 2 deletions proto/cosmos/authz/v1beta1/authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ message GenericAuthorization {
// Grant gives permissions to execute
// the provide method with expiration time.
message Grant {
google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
// time when the grant will expire and will be pruned. If null, then the grant
// doesn't have a time expiration (other conditions in `authorization`
// may apply to invalidate the grant)
google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true];
}
36 changes: 23 additions & 13 deletions x/authz/authz.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 932bb6d

Please sign in to comment.