mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
SessionSv1.AuthorizeEventWithDigest returning MaxUsage as float64 instead of duration, thanks @razvanc
This commit is contained in:
@@ -210,7 +210,7 @@ func TestSSv1ItAuthWithDigest(t *testing.T) {
|
||||
if err := sSv1BiRpc.Call(utils.SessionSv1AuthorizeEventWithDigest, args, &rply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if *rply.MaxUsage != authUsage {
|
||||
if *rply.MaxUsage != authUsage.Seconds() {
|
||||
t.Errorf("Unexpected MaxUsage: %v", rply.MaxUsage)
|
||||
}
|
||||
if *rply.ResourceAllocation == "" {
|
||||
|
||||
@@ -1456,7 +1456,7 @@ func (smg *SMGeneric) BiRPCv1AuthorizeEvent(clnt rpcclient.RpcClientConnection,
|
||||
type V1AuthorizeReplyWithDigest struct {
|
||||
AttributesDigest *string
|
||||
ResourceAllocation *string
|
||||
MaxUsage *time.Duration
|
||||
MaxUsage *float64 // special treat returning time.Duration.Seconds()
|
||||
SuppliersDigest *string
|
||||
}
|
||||
|
||||
@@ -1479,7 +1479,7 @@ func (smg *SMGeneric) BiRPCv1AuthorizeEventWithDigest(clnt rpcclient.RpcClientCo
|
||||
authReply.ResourceAllocation = initAuthRply.ResourceAllocation
|
||||
}
|
||||
if args.GetMaxUsage {
|
||||
authReply.MaxUsage = initAuthRply.MaxUsage
|
||||
authReply.MaxUsage = utils.Float64Pointer(initAuthRply.MaxUsage.Seconds())
|
||||
}
|
||||
if args.GetSuppliers {
|
||||
authReply.SuppliersDigest = utils.StringPointer(initAuthRply.Suppliers.Digest())
|
||||
|
||||
Reference in New Issue
Block a user