{"id":34060709,"url":"https://github.com/v1c77/py_grpc_validator","last_synced_at":"2026-04-09T04:04:45.916Z","repository":{"id":57436160,"uuid":"148628347","full_name":"v1c77/py_grpc_validator","owner":"v1c77","description":"validator for python grpc service request.","archived":false,"fork":false,"pushed_at":"2018-10-10T05:41:42.000Z","size":51,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-16T04:31:01.865Z","etag":null,"topics":["grpc","proto","python","validate","validator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/v1c77.png","metadata":{"files":{"readme":"README.RST","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-13T11:33:22.000Z","updated_at":"2022-03-13T22:10:49.000Z","dependencies_parsed_at":"2022-09-06T01:11:27.761Z","dependency_job_id":null,"html_url":"https://github.com/v1c77/py_grpc_validator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/v1c77/py_grpc_validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v1c77%2Fpy_grpc_validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v1c77%2Fpy_grpc_validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v1c77%2Fpy_grpc_validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v1c77%2Fpy_grpc_validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v1c77","download_url":"https://codeload.github.com/v1c77/py_grpc_validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v1c77%2Fpy_grpc_validator/sbom","scorecard":{"id":913973,"data":{"date":"2025-08-11","repo":{"name":"github.com/v1c77/py_grpc_validator","commit":"6445061320993f2c26716ab4657eeb71ef2e8910"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.1.2-dev not signed: https://api.github.com/repos/v1c77/py_grpc_validator/releases/13325482","Warn: release artifact v0.1.2-dev does not have provenance: https://api.github.com/repos/v1c77/py_grpc_validator/releases/13325482"],"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 11 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"}}]},"last_synced_at":"2025-08-24T20:18:25.138Z","repository_id":57436160,"created_at":"2025-08-24T20:18:25.138Z","updated_at":"2025-08-24T20:18:25.138Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["grpc","proto","python","validate","validator"],"created_at":"2025-12-14T04:15:19.620Z","updated_at":"2026-04-09T04:04:45.910Z","avatar_url":"https://github.com/v1c77.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"python grpc validator\n~~~~~~~~~~~~~~~~~~~~~\nplugin of validate request field for python grpc server.\n\n.. image:: https://travis-ci.com/v1c77/py_grpc_validator.svg?branch=master\n    :target: https://travis-ci.com/v1c77/py_grpc_validator\n\nTODO:\n    - type hint for different field type.(such as only string field can do\n      a string length check.)\n    - test case \u0026 Makefile.\n    - a cli to help protoc with `validator.proto`.\n    - anymore bugs or improves?\n\n\n\nHow To\n######\n\n1. install\n\n.. code-block:: bash\n\n    pip install grpc-proto-validator\n\n2. copy **validator.proto** to your project proto path and do protoc.(TODO a\ncli help to copy or build proto.)\n\n The **validator.proto** is included in this package, you can find it in\n python site-packages path.\n\n\nA example on how to generate the grpc files:\n\nwrite grpc request message like:\n\n.. code-block:: proto\n\n    message HelloRequest {\n        string name = 1 [(validator.field) = {string_not_empty: True}];\n        int32 age = 2 [(validator.field) = {int_gt: 50, int_lt: 100}];\n\n\n        message Child {\n        string name = 1 [(validator.field) = {length_eq: 4}];\n        float weight = 2 [(validator.field) = {float_gt: 60.4, float_lt: 100}];\n        }\n\n\n        Child child = 3 [(validator.field) = {msg_exists: True}];\n        Dau dau = 4;\n        string categray = 5;\n\n\n    }\n\ncompile:\n\n.. code-block:: bash\n\n    $ python -m grpc_tools.protoc \\\n      --proto_path={/path/to/validator/proto} \\\n      --proto_path={/path/to/your/project/proto} \\\n      --python_out={/path/to/project/src} \\\n      --grpc_python_out={/path/to/project/src} \\\n      path/to/your.proto\n\n\n\n3. change your service and \\*_pb2 code.\n\nTo avoid protobuf import error, change one line in the generated\npython file(like `hello_bro_pb2.py`).\n\nfrom:\n\n.. code-block:: python\n\n    import validator_pb2 as validator__pb2\n\nto:\n\n.. code-block:: python\n\n    import grpc_proto_validator.validator_pb2 as validator__pb2.\n\nThen create service with validator:\n\n.. code-block:: python\n\n    import six\n    from grpc_validator.validator import ValidateMetaclass\n\n    class YourService(six.with_metaclass(ValidateMetaclass,\n                             YourService_pb2_grpc.YourServiceServer)):\n\n        def behaviour1(self, request, context)\n            ...\n\n\nAlso, you can select individual service handler to do the field check:\n\n.. code-block:: python\n\n    from grpc_validator.validator import validator_wrap\n\n\n    class YourService(YourService_pb2_grpc.YourServiceServer):\n\n        def behaviour(self, request, context):\n            \"\"\"request will not be validated.\"\"\"\n            ...\n\n        @validator_wrap\n        def behaviour2(self, request, context):\n            ...\n\n\n\nNotice\n######\n\nSomeone has used go-proto-validator_ before will notice\nthat I almost reuse its proto file which make it easier\nto co-work with our golang service team.\n\nBut please don't mix these two proto files.\n**!!!THEY ARE NOT IN COMMON USE!!!**\n\nAny help or idea is favourably receive. Please just make a issue_.\n\nLICENSE\n=======\nMIT_.\n\n.. _ecosystem: https://github.com/grpc-ecosystem/go-grpc-middleware/tree/master/validator\n.. _go-proto-validator: https://github.com/mwitkow/go-proto-validators\n.. _issue: https://github.com/v1c77/py_grpc_validator/issues/new\n.. _MIT: https://github.com/v1c77/py_grpc_validator/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv1c77%2Fpy_grpc_validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv1c77%2Fpy_grpc_validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv1c77%2Fpy_grpc_validator/lists"}