Skip to content

feat: HTTPS deploy keys#37306

Draft
ToastyTheBot wants to merge 6 commits intogo-gitea:mainfrom
ToastyTheBot:feat/https-deploy-keys
Draft

feat: HTTPS deploy keys#37306
ToastyTheBot wants to merge 6 commits intogo-gitea:mainfrom
ToastyTheBot:feat/https-deploy-keys

Conversation

@ToastyTheBot
Copy link
Copy Markdown

@ToastyTheBot ToastyTheBot commented Apr 20, 2026

Fixes #2051

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 20, 2026
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 20, 2026
@silverwind silverwind requested a review from Copilot April 20, 2026 07:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “HTTPS deploy keys” (per-repository bearer tokens usable as the Basic Auth password) to enable Git clone/push over HTTPS without SSH keys, addressing #2051.

Changes:

  • Adds a new HTTPSDeployKey model + DB migration and fixtures.
  • Implements creation/deletion UI and routes in repo settings, with flash-based one-time token display.
  • Extends Basic auth + git HTTP handling to authenticate and authorize Git operations using these tokens, plus adds integration/model/router tests.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/integration/https_deploy_key_test.go End-to-end git HTTP auth behavior tests for read/write/cross-repo/invalid token cases
templates/repo/settings/deploy_keys.tmpl Adds HTTPS deploy keys section to repo settings UI
services/forms/repo_form.go Adds form binding/validation for creating HTTPS deploy keys
services/auth/basic.go Adds HTTPS deploy token verification to Basic auth flow
routers/web/web.go Wires new settings routes for create/delete HTTPS deploy keys
routers/web/repo/setting/settings_test.go Tests create/delete flow from settings handlers
routers/web/repo/setting/deploy_key.go Loads HTTPS keys for display and implements create/delete handlers
routers/web/repo/githttp.go Enforces repo binding + mode restrictions for deploy-token-authenticated git HTTP requests
options/locale/locale_en-US.json Adds English UI strings for HTTPS deploy keys
models/migrations/v1_26/v331.go / v331_test.go Adds + tests migration creating https_deploy_key table
models/migrations/migrations.go Registers migration 331
models/fixtures/https_deploy_key.yml Adds empty fixture placeholder for HTTPS deploy keys
models/asymkey/main_test.go Includes new fixture in asymkey test suite
models/asymkey/https_deploy_key.go / _test.go Implements token generation/storage/verification + unit tests
models/asymkey/error.go Adds HTTPS deploy key error types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread routers/web/repo/githttp.go
Comment thread templates/repo/settings/deploy_keys.tmpl
Comment thread templates/repo/settings/deploy_keys.tmpl
Comment thread services/auth/basic.go Outdated
Comment thread routers/web/repo/githttp.go
@silverwind
Copy link
Copy Markdown
Member

silverwind commented Apr 21, 2026

Make sure to "Resolve" all addressed Copilot comments, ideally with a comment.

@bircni
Copy link
Copy Markdown
Member

bircni commented Apr 21, 2026

Make sure to "Resolve" all addressed Copilot comments, ideally with a comment.

seems like it is a bot so I don't think we will ever have a discussion here

@ToastyTheBot
Copy link
Copy Markdown
Author

ToastyTheBot commented Apr 21, 2026

Make sure to "Resolve" all addressed Copilot comments, ideally with a comment.

seems like it is a bot so I don't think we will ever have a discussion here

I do not intend to hide the nature of the code, but this is a feature I think many people, including myself, would like to see implemented, for an issue that is almost 9 years old. I am open to human discussions.

@bircni
Copy link
Copy Markdown
Member

bircni commented Apr 21, 2026

Would be interesting what @wxiaoguang says

@ToastyTheBot ToastyTheBot force-pushed the feat/https-deploy-keys branch from 7becad6 to 527a6ef Compare April 21, 2026 20:07
@bircni
Copy link
Copy Markdown
Member

bircni commented Apr 21, 2026

Please have a look at contributing
Also please provide UI examples when changing UI

@ToastyTheBot
Copy link
Copy Markdown
Author

Please have a look at contributing Also please provide UI examples when changing UI

This PR is still a draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: HTTPS based deploy keys

6 participants