{"id":37177194,"url":"https://github.com/rafpe/serverless-reqvalidator-plugin","last_synced_at":"2026-01-14T20:39:56.289Z","repository":{"id":48104308,"uuid":"114486384","full_name":"RafPe/serverless-reqvalidator-plugin","owner":"RafPe","description":"Serverless plugin to attach AWS API Gateway Basic Request Validation https://rafpe.ninja/2017/12/18/serverless-own-plugin-to-attach-aws-api-gateway-basic-request-validation/","archived":false,"fork":false,"pushed_at":"2023-10-18T15:37:05.000Z","size":162,"stargazers_count":61,"open_issues_count":3,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T13:28:44.101Z","etag":null,"topics":["serverless","serverless-framework","serverless-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RafPe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-16T19:52:34.000Z","updated_at":"2023-04-14T09:13:14.000Z","dependencies_parsed_at":"2024-06-18T15:37:22.032Z","dependency_job_id":"69c71b9e-754b-47ce-875b-c79aba943d93","html_url":"https://github.com/RafPe/serverless-reqvalidator-plugin","commit_stats":{"total_commits":17,"total_committers":8,"mean_commits":2.125,"dds":0.5882352941176471,"last_synced_commit":"c430579247c92e1e3dfb610d80a5da9f2f83781a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RafPe/serverless-reqvalidator-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafPe%2Fserverless-reqvalidator-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafPe%2Fserverless-reqvalidator-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafPe%2Fserverless-reqvalidator-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafPe%2Fserverless-reqvalidator-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RafPe","download_url":"https://codeload.github.com/RafPe/serverless-reqvalidator-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafPe%2Fserverless-reqvalidator-plugin/sbom","scorecard":{"id":117210,"data":{"date":"2025-08-11","repo":{"name":"github.com/RafPe/serverless-reqvalidator-plugin","commit":"c430579247c92e1e3dfb610d80a5da9f2f83781a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":4,"reason":"Found 6/14 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T01:38:55.172Z","repository_id":48104308,"created_at":"2025-08-16T01:38:55.172Z","updated_at":"2025-08-16T01:38:55.172Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["serverless","serverless-framework","serverless-plugin"],"created_at":"2026-01-14T20:39:55.477Z","updated_at":"2026-01-14T20:39:56.239Z","avatar_url":"https://github.com/RafPe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-reqvalidator-plugin\nServerless plugin to set specific validator request on method\n\n## Installation \n```\nnpm install serverless-reqvalidator-plugin\n```\n\n## Requirements\nThis require you to have documentation plugin installed\n```\nserverless-aws-documentation\n```\n\n\n## Using plugin\nSpecify plugin \n```\nplugins:\n  - serverless-reqvalidator-plugin\n  - serverless-aws-documentation\n```\n\n\nIn `serverless.yml` create custom resource for request validators \n\n```\n    xMyRequestValidator:  \n      Type: \"AWS::ApiGateway::RequestValidator\"\n      Properties:\n        Name: 'my-req-validator'\n        RestApiId: \n          Ref: ApiGatewayRestApi\n        ValidateRequestBody: true\n        ValidateRequestParameters: false  \n```\n\nFor every function you wish to use the validator set property `reqValidatorName: 'xMyRequestValidator'` to match resource you described \n\n```\n  debug:\n    handler: apis/admin/debug/debug.debug\n    timeout: 10\n    events:\n      - http:\n          path: admin/debug\n          method: get\n          cors: true\n          private: true \n          reqValidatorName: 'xMyRequestValidator'\n```\n\n### Use Validator specified in different Stack\nThe serverless framework allows us to share resources among several stacks. Therefore a CloudFormation Output has to be specified in one stack. This Output can be imported in another stack to make use of it. For more information see\n[here](https://serverless.com/framework/docs/providers/aws/guide/variables/#reference-cloudformation-outputs).\n\nSpecify a request validator in a different stack:\n\n```\nplugins:\n  - serverless-reqvalidator-plugin\nservice: my-service-a\nfunctions:\n  hello:\n    handler: handler.myHandler\n    events:\n      - http:\n          path: hello\n          reqValidatorName: 'myReqValidator'\n\nresources:\n  Resources:\n    xMyRequestValidator:\n      Type: \"AWS::ApiGateway::RequestValidator\"\n      Properties:\n        Name: 'my-req-validator'\n        RestApiId: \n          Ref: ApiGatewayRestApi\n        ValidateRequestBody: true\n        ValidateRequestParameters: false\n  Outputs:\n    xMyRequestValidator:\n      Value:\n        Ref: my-req-validator\n      Export:\n        Name: myReqValidator\n\n\n```\n\nMake use of the exported request validator in stack b:\n```\nplugins:\n  - serverless-reqvalidator-plugin\nservice: my-service-b\nfunctions:\n  hello:\n    handler: handler.myHandler\n    events:\n      - http:\n          path: hello\n          reqValidatorName:\n            Fn::ImportValue: 'myReqValidator'\n```\n\n### Use an external validator by ID\nIf you have an existing request validator defined outside of CloudFormation e.g. Terraform, you can reference it by id.\n\n```\nplugins:\n  - serverless-reqvalidator-plugin\nservice: my-service-a\nfunctions:\n  hello:\n    handler: handler.myHandler\n    events:\n      - http:\n          path: hello\n          reqValidatorName:\n            id: 'g5ch0h'\n```\n\n### Full example \n```\nservice:\n  name: my-service\n\nplugins:\n  - serverless-webpack\n  - serverless-reqvalidator-plugin\n  - serverless-aws-documentation\n\nprovider:\n  name: aws\n  runtime: nodejs6.10\n  region: eu-west-2\n  environment:\n    NODE_ENV: ${self:provider.stage}\ncustom:\n  documentation:\n    api:\n      info:\n        version: '1.0.0'\n        title: My API\n        description: This is my API\n      tags:\n        -\n          name: User\n          description: User Management\n    models:\n      - name: MessageResponse\n        contentType: \"application/json\"\n        schema:\n          type: object\n          properties:\n            message:\n              type: string\n      - name: RegisterUserRequest\n        contentType: \"application/json\"\n        schema:\n          required: \n            - email\n            - password\n          properties:\n            email:\n              type: string\n            password:\n              type: string\n      - name: RegisterUserResponse\n        contentType: \"application/json\"\n        schema:\n          type: object\n          properties:\n            result:\n              type: string\n      - name: 400JsonResponse\n        contentType: \"application/json\"\n        schema:\n          type: object\n          properties:\n            message:\n              type: string\n            statusCode:\n              type: number\n  commonModelSchemaFragments:\n    MethodResponse400Json:\n      statusCode: '400'\n      responseModels:\n        \"application/json\": 400JsonResponse\n\nfunctions:\n  signUp:\n    handler: handler.signUp\n    events:\n      - http:\n          documentation:\n            summary: \"Register user\"\n            description: \"Registers new user\"\n            tags:\n              - User\n            requestModels:\n              \"application/json\": RegisterUserRequest\n          method: post\n          path: signup\n          reqValidatorName: onlyBody\n          methodResponses:\n              - statusCode: '200'\n                responseModels:\n                  \"application/json\": RegisterUserResponse\n              - ${self:custom.commonModelSchemaFragments.MethodResponse400Json}\n\npackage:\n  include:\n    handler.ts\n\nresources:\n  Resources:\n    onlyBody:  \n      Type: \"AWS::ApiGateway::RequestValidator\"\n      Properties:\n        Name: 'only-body'\n        RestApiId: \n          Ref: ApiGatewayRestApi\n        ValidateRequestBody: true\n        ValidateRequestParameters: false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafpe%2Fserverless-reqvalidator-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafpe%2Fserverless-reqvalidator-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafpe%2Fserverless-reqvalidator-plugin/lists"}