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

gitea webhook 403 #5798

Closed
withlin opened this issue Oct 14, 2019 · 3 comments
Closed

gitea webhook 403 #5798

withlin opened this issue Oct 14, 2019 · 3 comments

Comments

@withlin
Copy link

withlin commented Oct 14, 2019

[root@localhost ~]# jx version
NAME               VERSION
jx                 2.0.842
jenkins x platform 2.0.1435
Kubernetes cluster v1.15.3
kubectl            v1.16.0
helm client        Client: v2.14.3+g0e7f3b6
git                1.8.3.1
Operating System   CentOS Linux release 7.6.1810 (Core) 

Gitea version

  • Gitea Version: 1.10.0+dev-415-g0a96e5988

Request Headers

Request URL: http://hook.jx.10.200.100.200.nip.io/hook
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: 8a140d1f-8c97-4ec4-9b50-04babc299326
X-GitHub-Event: push
X-Gitea-Delivery: 8a140d1f-8c97-4ec4-9b50-04babc299326
X-Gitea-Event: push
X-Gitea-Signature: 684ff68021bbf61a34b2998ad507fd6dc6b6160870a859513f4a389eeba27e21
X-Gogs-Delivery: 8a140d1f-8c97-4ec4-9b50-04babc299326
X-Gogs-Event: push
X-Gogs-Signature: 684ff68021bbf61a34b2998ad507fd6dc6b6160870a859513f4a389eeba27e21

Request Content

{
  "secret": "baf6fee6e134b3595deb13b44640c0bafab37a435",
  "ref": "refs/heads/tekton-custom-steps",
  "before": "0000000000000000000000000000000000000000",
  "after": "7960a07c6562a086015835db56c5eb4d7a9a7fd2",
  "compare_url": "http://localhost:3000/",
  "commits": [
    {
      "id": "7960a07c6562a086015835db56c5eb4d7a9a7fd2",
      "message": "added custom tekton step\n",
      "url": "http://localhost:3000/withlin/gg/commit/7960a07c6562a086015835db56c5eb4d7a9a7fd2",
      "author": {
        "name": "withlin",
        "email": "[email protected]",
        "username": "withlin"
      },
      "committer": {
        "name": "withlin",
        "email": "[email protected]",
        "username": "withlin"
      },
      "verification": null,
      "timestamp": "2019-10-13T09:10:36-04:00",
      "added": [],
      "removed": [],
      "modified": [
        "jenkins-x.yml"
      ]
    }
  ],
  "head_commit": null,
  "repository": {
    "id": 1,
    "owner": {
      "id": 1,
      "login": "withlin",
      "full_name": "",
      "email": "[email protected]",
      "avatar_url": "http://localhost:3000/user/avatar/withlin/-1",
      "language": "en-US",
      "is_admin": true,
      "last_login": "2019-10-13T13:05:30Z",
      "created": "2019-10-13T13:05:30Z",
      "username": "withlin"
    },
    "name": "gg",
    "full_name": "withlin/gg",
    "description": "",
    "empty": false,
    "private": false,
    "fork": false,
    "parent": null,
    "mirror": false,
    "size": 144,
    "html_url": "http://localhost:3000/withlin/gg",
    "ssh_url": "git@localhost:withlin/gg.git",
    "clone_url": "http://localhost:3000/withlin/gg.git",
    "original_url": "",
    "website": "",
    "stars_count": 0,
    "forks_count": 0,
    "watchers_count": 1,
    "open_issues_count": 0,
    "default_branch": "master",
    "archived": false,
    "created_at": "2019-10-13T13:06:05Z",
    "updated_at": "2019-10-13T13:10:50Z",
    "permissions": {
      "admin": false,
      "push": false,
      "pull": false
    },
    "has_issues": true,
    "internal_tracker": {
      "enable_time_tracker": true,
      "allow_only_contributors_to_track_time": true,
      "enable_issue_dependencies": true
    },
    "has_wiki": true,
    "has_pull_requests": true,
    "ignore_whitespace_conflicts": false,
    "allow_merge_commits": true,
    "allow_rebase": true,
    "allow_rebase_explicit": true,
    "allow_squash_merge": true,
    "avatar_url": ""
  },
  "pusher": {
    "id": 1,
    "login": "withlin",
    "full_name": "",
    "email": "[email protected]",
    "avatar_url": "http://localhost:3000/user/avatar/withlin/-1",
    "language": "en-US",
    "is_admin": true,
    "last_login": "2019-10-13T13:05:30Z",
    "created": "2019-10-13T13:05:30Z",
    "username": "withlin"
  },
  "sender": {
    "id": 1,
    "login": "withlin",
    "full_name": "",
    "email": "[email protected]",
    "avatar_url": "http://localhost:3000/user/avatar/withlin/-1",
    "language": "en-US",
    "is_admin": true,
    "last_login": "2019-10-13T13:05:30Z",
    "created": "2019-10-13T13:05:30Z",
    "username": "withlin"
  }
}

Response Headers

Connection: keep-alive
Content-Length: 39
Content-Type: text/plain; charset=utf-8
Date: Sun, 13 Oct 2019 13:10:50 GMT
Server: openresty/1.15.8.2
X-Content-Type-Options: nosniff

Response body

403 Forbidden: Missing X-Hub-Signature

@withlin
Copy link
Author

withlin commented Oct 14, 2019

ref:gitea issue #7788
ref:gitea pr #8473

@withlin
Copy link
Author

withlin commented Oct 14, 2019

Can I change jenkins x hook source code to be compatible with gitea old version?

ref:k8s-prow-hook

@withlin
Copy link
Author

withlin commented Oct 14, 2019

alredy fix : update gitea source code to support X-Hub-Signature headers.

@withlin withlin closed this as completed Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant