{"id":21893229,"url":"https://github.com/rjw57/pydantic-gitlab-webhooks","last_synced_at":"2026-02-19T00:12:51.916Z","repository":{"id":262997615,"uuid":"888977762","full_name":"rjw57/pydantic-gitlab-webhooks","owner":"rjw57","description":"Pydantic models for GitLab webhook events","archived":false,"fork":false,"pushed_at":"2026-02-18T22:27:45.000Z","size":338,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T23:44:00.740Z","etag":null,"topics":["gitlab","pydantic","pydantic-models","python","webhook"],"latest_commit_sha":null,"homepage":"https://rjw57.github.io/pydantic-gitlab-webhooks/","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/rjw57.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-15T11:20:49.000Z","updated_at":"2026-02-18T22:27:50.000Z","dependencies_parsed_at":"2026-01-08T13:08:11.155Z","dependency_job_id":null,"html_url":"https://github.com/rjw57/pydantic-gitlab-webhooks","commit_stats":null,"previous_names":["rjw57/pydantic-gitlab-webhooks"],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/rjw57/pydantic-gitlab-webhooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjw57%2Fpydantic-gitlab-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjw57%2Fpydantic-gitlab-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjw57%2Fpydantic-gitlab-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjw57%2Fpydantic-gitlab-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjw57","download_url":"https://codeload.github.com/rjw57/pydantic-gitlab-webhooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjw57%2Fpydantic-gitlab-webhooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29599339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T22:25:43.180Z","status":"ssl_error","status_checked_at":"2026-02-18T22:25:42.766Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["gitlab","pydantic","pydantic-models","python","webhook"],"created_at":"2024-11-28T13:12:56.973Z","updated_at":"2026-02-19T00:12:51.886Z","avatar_url":"https://github.com/rjw57.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pydantic models for GitLab Webhooks\n\n[![PyPI - Version](https://img.shields.io/pypi/v/pydantic-gitlab-webhooks)](https://pypi.org/p/pydantic-gitlab-webhooks/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pydantic-gitlab-webhooks)\n[![GitHub Release](https://img.shields.io/github/v/release/rjw57/pydantic-gitlab-webhooks)](https://github.com/rjw57/pydantic-gitlab-webhooks/releases)\n[![Test suite status](https://github.com/rjw57/pydantic-gitlab-webhooks/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/rjw57/pydantic-gitlab-webhooks/actions/workflows/main.yml?query=branch%3Amain)\n\nModule containing Pydantic models for validating bodies from [GitLab webhook\nrequests](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html).\n\n## Documentation\n\nThe project documentation including an API reference can be found at\n[https://rjw57.github.io/pydantic-gitlab-webhooks/](https://rjw57.github.io/pydantic-gitlab-webhooks/).\n\n## Usage example\n\nIntended usage is via a single `validate_event_header_and_body` function which will\nvalidate an incoming webhook's `X-Gitlab-Event` header and the body after being parsed\ninto a Python dict.\n\n```py\nfrom pydantic import ValidationError\nfrom pydantic_gitlab_webhooks import (\n    validate_event_body_dict,\n    validate_event_header_and_body_dict,\n)\n\nevent_body = {\n    \"object_kind\": \"access_token\",\n    \"group\": {\n        \"group_name\": \"Twitter\",\n        \"group_path\": \"twitter\",\n        \"group_id\": 35,\n        \"full_path\": \"twitter\"\n    },\n    \"object_attributes\": {\n        \"user_id\": 90,\n        \"created_at\": \"2024-01-24 16:27:40 UTC\",\n        \"id\": 25,\n        \"name\": \"acd\",\n        \"expires_at\": \"2024-01-26\"\n    },\n    \"event_name\": \"expiring_access_token\"\n}\n\n# Use the value of the \"X-Gitlab-Event\" header and event body to validate\n# the incoming event.\nparsed_event = validate_event_header_and_body_dict(\n    \"Resource Access Token Hook\",\n    event_body\n)\nassert parsed_event.group.full_path == \"twitter\"\n\n# Invalid event bodies or hook headers raise Pydantic validation errors\ntry:\n    validate_event_header_and_body_dict(\"invalid hook\", event_body)\nexcept ValidationError:\n    pass  # ok - expected error raised\nelse:\n    assert False, \"ValidationError was not raised\"\n\n# Event bodies can be parsed without the header hook if necessary although using\n# the hook header is more efficient.\nparsed_event = validate_event_body_dict(event_body)\nassert parsed_event.group.full_path == \"twitter\"\n\n# Event models may be imported individually. For example:\nfrom pydantic_gitlab_webhooks.events import GroupAccessTokenEvent\n\nparsed_event = GroupAccessTokenEvent.model_validate(event_body)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjw57%2Fpydantic-gitlab-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjw57%2Fpydantic-gitlab-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjw57%2Fpydantic-gitlab-webhooks/lists"}