Loading CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Fix log level in Lua runtime log calls which use logger fields. - Correctly register purchase validation before/after hooks in JavaScript/Lua runtimes. - Add missing "environment" to JS ValidatedPurchases results. - Fix typos in error messages referencing empty input values. ## [3.5.0] - 2021-08-10 ### Added Loading server/api_friend.go +3 −3 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ func (s *ApiServer) AddFriends(ctx context.Context, in *api.AddFriendsRequest) ( for _, u := range in.GetUsernames() { if u == "" { return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.") return nil, status.Error(codes.InvalidArgument, "Username must not be empty.") } if username == u { return nil, status.Error(codes.InvalidArgument, "Cannot add self as friend.") Loading Loading @@ -211,7 +211,7 @@ func (s *ApiServer) DeleteFriends(ctx context.Context, in *api.DeleteFriendsRequ username := ctx.Value(ctxUsernameKey{}).(string) for _, u := range in.GetUsernames() { if u == "" { return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.") return nil, status.Error(codes.InvalidArgument, "Username must not be empty.") } if username == u { return nil, status.Error(codes.InvalidArgument, "Cannot delete self.") Loading Loading @@ -292,7 +292,7 @@ func (s *ApiServer) BlockFriends(ctx context.Context, in *api.BlockFriendsReques username := ctx.Value(ctxUsernameKey{}).(string) for _, u := range in.GetUsernames() { if u == "" { return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.") return nil, status.Error(codes.InvalidArgument, "Username must not be empty.") } if username == u { return nil, status.Error(codes.InvalidArgument, "Cannot block self.") Loading server/api_group.go +2 −2 Original line number Diff line number Diff line Loading @@ -121,13 +121,13 @@ func (s *ApiServer) UpdateGroup(ctx context.Context, in *api.UpdateGroupRequest) if in.GetName() != nil { if len(in.GetName().String()) < 1 { return nil, status.Error(codes.InvalidArgument, "Group name cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Group name cannot be empty.") } } if in.GetLangTag() != nil { if len(in.GetLangTag().String()) < 1 { return nil, status.Error(codes.InvalidArgument, "Group language cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Group language cannot be empty.") } } Loading server/api_purchase.go +4 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ func (s *ApiServer) ValidatePurchaseApple(ctx context.Context, in *api.ValidateP } if len(in.Receipt) < 1 { return nil, status.Error(codes.InvalidArgument, "Receipt cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Receipt cannot be empty.") } validation, err := ValidatePurchasesApple(ctx, s.logger, s.db, userID, s.config.GetIAP().Apple.SharedPassword, in.Receipt) Loading Loading @@ -111,7 +111,7 @@ func (s *ApiServer) ValidatePurchaseGoogle(ctx context.Context, in *api.Validate } if len(in.Purchase) < 1 { return nil, status.Error(codes.InvalidArgument, "Purchase cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Purchase cannot be empty.") } validation, err := ValidatePurchaseGoogle(ctx, s.logger, s.db, userID, s.config.GetIAP().Google, in.Purchase) Loading Loading @@ -168,11 +168,11 @@ func (s *ApiServer) ValidatePurchaseHuawei(ctx context.Context, in *api.Validate } if len(in.Purchase) < 1 { return nil, status.Error(codes.InvalidArgument, "Purchase cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Purchase cannot be empty.") } if len(in.Signature) < 1 { return nil, status.Error(codes.InvalidArgument, "Signature cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Signature cannot be empty.") } validation, err := ValidatePurchaseHuawei(ctx, s.logger, s.db, userID, s.config.GetIAP().Huawei, in.Purchase, in.Signature) Loading server/api_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ var ( protojsonUnmarshaler = &protojson.UnmarshalOptions{ DiscardUnknown: false, } metrics = NewMetrics(logger, logger, nil, cfg) metrics = NewLocalMetrics(logger, logger, nil, cfg) _ = CheckConfig(logger, cfg) ) Loading Loading
CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Fix log level in Lua runtime log calls which use logger fields. - Correctly register purchase validation before/after hooks in JavaScript/Lua runtimes. - Add missing "environment" to JS ValidatedPurchases results. - Fix typos in error messages referencing empty input values. ## [3.5.0] - 2021-08-10 ### Added Loading
server/api_friend.go +3 −3 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ func (s *ApiServer) AddFriends(ctx context.Context, in *api.AddFriendsRequest) ( for _, u := range in.GetUsernames() { if u == "" { return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.") return nil, status.Error(codes.InvalidArgument, "Username must not be empty.") } if username == u { return nil, status.Error(codes.InvalidArgument, "Cannot add self as friend.") Loading Loading @@ -211,7 +211,7 @@ func (s *ApiServer) DeleteFriends(ctx context.Context, in *api.DeleteFriendsRequ username := ctx.Value(ctxUsernameKey{}).(string) for _, u := range in.GetUsernames() { if u == "" { return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.") return nil, status.Error(codes.InvalidArgument, "Username must not be empty.") } if username == u { return nil, status.Error(codes.InvalidArgument, "Cannot delete self.") Loading Loading @@ -292,7 +292,7 @@ func (s *ApiServer) BlockFriends(ctx context.Context, in *api.BlockFriendsReques username := ctx.Value(ctxUsernameKey{}).(string) for _, u := range in.GetUsernames() { if u == "" { return nil, status.Error(codes.InvalidArgument, "Username must not be emptypb.") return nil, status.Error(codes.InvalidArgument, "Username must not be empty.") } if username == u { return nil, status.Error(codes.InvalidArgument, "Cannot block self.") Loading
server/api_group.go +2 −2 Original line number Diff line number Diff line Loading @@ -121,13 +121,13 @@ func (s *ApiServer) UpdateGroup(ctx context.Context, in *api.UpdateGroupRequest) if in.GetName() != nil { if len(in.GetName().String()) < 1 { return nil, status.Error(codes.InvalidArgument, "Group name cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Group name cannot be empty.") } } if in.GetLangTag() != nil { if len(in.GetLangTag().String()) < 1 { return nil, status.Error(codes.InvalidArgument, "Group language cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Group language cannot be empty.") } } Loading
server/api_purchase.go +4 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ func (s *ApiServer) ValidatePurchaseApple(ctx context.Context, in *api.ValidateP } if len(in.Receipt) < 1 { return nil, status.Error(codes.InvalidArgument, "Receipt cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Receipt cannot be empty.") } validation, err := ValidatePurchasesApple(ctx, s.logger, s.db, userID, s.config.GetIAP().Apple.SharedPassword, in.Receipt) Loading Loading @@ -111,7 +111,7 @@ func (s *ApiServer) ValidatePurchaseGoogle(ctx context.Context, in *api.Validate } if len(in.Purchase) < 1 { return nil, status.Error(codes.InvalidArgument, "Purchase cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Purchase cannot be empty.") } validation, err := ValidatePurchaseGoogle(ctx, s.logger, s.db, userID, s.config.GetIAP().Google, in.Purchase) Loading Loading @@ -168,11 +168,11 @@ func (s *ApiServer) ValidatePurchaseHuawei(ctx context.Context, in *api.Validate } if len(in.Purchase) < 1 { return nil, status.Error(codes.InvalidArgument, "Purchase cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Purchase cannot be empty.") } if len(in.Signature) < 1 { return nil, status.Error(codes.InvalidArgument, "Signature cannot be emptypb.") return nil, status.Error(codes.InvalidArgument, "Signature cannot be empty.") } validation, err := ValidatePurchaseHuawei(ctx, s.logger, s.db, userID, s.config.GetIAP().Huawei, in.Purchase, in.Signature) Loading
server/api_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ var ( protojsonUnmarshaler = &protojson.UnmarshalOptions{ DiscardUnknown: false, } metrics = NewMetrics(logger, logger, nil, cfg) metrics = NewLocalMetrics(logger, logger, nil, cfg) _ = CheckConfig(logger, cfg) ) Loading