mirror of https://github.com/go-gitea/gitea.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This PR fixes inconsistencies between system and default webhooks in the Gitea API. (See also #26418) - A system webhook is a webhook that captures events for all repositories. - A default webhook is copied to a new repository when it is created. Before this PR `POST /api/v1/admin/hooks/` creates default webhooks (if not configured otherwise) and `GET /api/v1/admin/hooks/` returns system webhooks. The PR introduces an optional query parameter to `GET /api/v1/admin/hooks/` to enable selecting if either default, system or both kind of webhooks should be retrieved. By default the flag is set to return system webhooks keep current behaviour. ## Examples ### System Webhooks #### Create ``` POST /api/v1/admin/hooks/ { "type": "gitea", "active": false, "branch_filter": "*", "events": [ "create", "..." ], "config": { "url": "http://...", "content_type": "json", "secret": "secret", "is_system_webhook": true // <-- controls hook type } } ``` #### List ``` GET/api/v1/admin/hooks?type=system //type argument is optional here since it's the default ``` #### Others The other relevant endpoints work as expected by referencing the hook by id ``` GET /api/v1/admin/hooks/:id PATCH /api/v1/admin/hooks/:id DELETE /api/v1/admin/hooks/:id ``` ### Default Webhooks #### Create ``` POST /api/v1/admin/hooks/ { "type": "gitea", "active": false, "branch_filter": "*", "events": [ "create", "..." ], "config": { "url": "http://...", "content_type": "json", "secret": "secret", "is_system_webhook": false // optional, as false is the default value } } ``` #### List ``` GET/api/v1/admin/hooks?type=default ``` #### Others The other relevant endpoints work as expected by referencing the hook by id ``` GET /api/v1/admin/hooks/:id PATCH /api/v1/admin/hooks/:id DELETE /api/v1/admin/hooks/:id ``` |
4 weeks ago | |
---|---|---|
.. | ||
access.yml | 11 months ago | |
access_token.yml | 1 year ago | |
action.yml | 2 years ago | |
action_artifact.yml | 3 months ago | |
action_run.yml | 2 months ago | |
action_run_job.yml | 1 month ago | |
action_runner_token.yml | 1 year ago | |
action_task.yml | 2 months ago | |
action_task_output.yml | 2 months ago | |
attachment.yml | 1 year ago | |
branch.yml | 2 months ago | |
collaboration.yml | 11 months ago | |
comment.yml | 4 months ago | |
commit_status.yml | ||
commit_status_index.yml | 1 year ago | |
deploy_key.yml | ||
email_address.yml | 12 months ago | |
external_login_user.yml | 3 years ago | |
follow.yml | 2 years ago | |
gpg_key.yml | 1 year ago | |
gpg_key_import.yml | ||
hook_task.yml | 11 months ago | |
issue.yml | 12 months ago | |
issue_assignees.yml | 11 months ago | |
issue_index.yml | 9 months ago | |
issue_label.yml | ||
issue_user.yml | ||
issue_watch.yml | ||
label.yml | 1 month ago | |
lfs_meta_object.yml | 3 months ago | |
login_source.yml | ||
milestone.yml | 2 years ago | |
mirror.yml | 2 years ago | |
notice.yml | ||
notification.yml | ||
oauth2_application.yml | 2 years ago | |
oauth2_authorization_code.yml | 2 years ago | |
oauth2_grant.yml | 2 years ago | |
org_user.yml | 3 months ago | |
project.yml | 11 months ago | |
project_board.yml | 11 months ago | |
project_issue.yml | ||
protected_branch.yml | ||
protected_tag.yml | 1 month ago | |
public_key.yml | 1 year ago | |
pull_request.yml | 10 months ago | |
reaction.yml | 1 year ago | |
release.yml | 1 year ago | |
renamed_branch.yml | 3 years ago | |
repo_archiver.yml | ||
repo_indexer_status.yml | ||
repo_license.yml | 4 months ago | |
repo_redirect.yml | ||
repo_topic.yml | ||
repo_transfer.yml | 11 months ago | |
repo_unit.yml | 4 months ago | |
repository.yml | 3 months ago | |
review.yml | 2 months ago | |
star.yml | 11 months ago | |
stopwatch.yml | ||
system_setting.yml | 3 months ago | |
team.yml | 9 months ago | |
team_repo.yml | 12 months ago | |
team_unit.yml | 9 months ago | |
team_user.yml | 9 months ago | |
topic.yml | 2 years ago | |
tracked_time.yml | ||
two_factor.yml | ||
user.yml | 3 months ago | |
user_blocking.yml | 11 months ago | |
user_open_id.yml | ||
user_redirect.yml | ||
watch.yml | 11 months ago | |
webauthn_credential.yml | 2 years ago | |
webhook.yml | 4 weeks ago |