Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable function input size #792

Merged
merged 5 commits into from
Jan 20, 2023
Merged

Conversation

Ivo-Yankov
Copy link
Collaborator

@Ivo-Yankov Ivo-Yankov commented Dec 23, 2022

Description:
Adds an env variable to control the maximum allowed input size (in mb). By default it is 1mb

Related issue(s):

Fixes #765

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@Ivo-Yankov Ivo-Yankov added the enhancement New feature or request label Dec 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2022

Codecov Report

Base: 72.60% // Head: 72.62% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (9fd85f5) compared to base (32ee497).
Patch coverage: 50.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #792      +/-   ##
==========================================
+ Coverage   72.60%   72.62%   +0.01%     
==========================================
  Files          29       29              
  Lines        1734     1735       +1     
  Branches      318      319       +1     
==========================================
+ Hits         1259     1260       +1     
+ Misses        385      384       -1     
- Partials       90       91       +1     
Impacted Files Coverage Δ
packages/server/src/server.ts 76.88% <50.00%> (-0.39%) ⬇️
packages/server/src/koaJsonRpc/index.ts 61.53% <0.00%> (+1.53%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Ivo-Yankov Ivo-Yankov self-assigned this Dec 23, 2022
@Ivo-Yankov Ivo-Yankov marked this pull request as ready for review December 23, 2022 13:55
@@ -52,7 +52,8 @@ export default class KoaJsonRpc {

constructor(logger: Logger, register: Registry, opts?) {
this.koaApp = new Koa();
this.limit = '1mb';
const limit = process.env.INPUT_SIZE_LIMIT || 1;
this.limit = limit + 'mb';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of weird that this.limit can be overwritten if you send in opts and it has a limit below in line 62. We should probably only use one potential mechanism for setting this configuration value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree with @lukelee-sl

lukelee-sl
lukelee-sl previously approved these changes Jan 3, 2023
Copy link
Member

@lukelee-sl lukelee-sl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Nana-EC
Nana-EC previously approved these changes Jan 20, 2023
@Nana-EC Nana-EC added this to the 0.17.0 milestone Jan 20, 2023
@Ivo-Yankov Ivo-Yankov dismissed stale reviews from Nana-EC and lukelee-sl via ec5340a January 20, 2023 09:36
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@georgi-l95 georgi-l95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ivo-Yankov Ivo-Yankov merged commit 05707af into main Jan 20, 2023
@Ivo-Yankov Ivo-Yankov deleted the 765-configurable-input-limit branch January 20, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

function call with long input data length fails
5 participants