[PR #710] [MERGED] Implement GPG api #15536

Closed
opened 2025-11-02 11:48:51 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/710
Author: @sapk
Created: 1/20/2017
Status: Merged
Merged: 3/16/2017
Merged by: @lunny

Base: masterHead: add-gpg-api


📝 Commits (4)

  • 44c85b9 Implement GPG API
  • 46c43cd Better handle error
  • 8ed52ed Apply review recommendation + simplify database operations
  • 47f46c4 Remove useless comments

📊 Changes

36 files changed (+7931 additions, -0 deletions)

View changed files

📝 models/error.go (+48 -0)
models/gpg_key.go (+276 -0)
models/gpg_key_test.go (+48 -0)
📝 models/models.go (+1 -0)
📝 routers/api/v1/api.go (+8 -0)
📝 routers/api/v1/convert/convert.go (+45 -0)
routers/api/v1/user/gpg_key.go (+102 -0)
vendor/golang.org/x/crypto/cast5/cast5.go (+526 -0)
vendor/golang.org/x/crypto/openpgp/armor/armor.go (+219 -0)
vendor/golang.org/x/crypto/openpgp/armor/encode.go (+160 -0)
vendor/golang.org/x/crypto/openpgp/canonical_text.go (+59 -0)
vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go (+122 -0)
vendor/golang.org/x/crypto/openpgp/errors/errors.go (+72 -0)
vendor/golang.org/x/crypto/openpgp/keys.go (+637 -0)
vendor/golang.org/x/crypto/openpgp/packet/compressed.go (+123 -0)
vendor/golang.org/x/crypto/openpgp/packet/config.go (+91 -0)
vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go (+199 -0)
vendor/golang.org/x/crypto/openpgp/packet/literal.go (+89 -0)
vendor/golang.org/x/crypto/openpgp/packet/ocfb.go (+143 -0)
vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go (+73 -0)

...and 16 more files

📄 Description

In order to implement go-gitea/gitea#425.

I added all the api call that gitea should implement.
This is this a WIP. I will change the db format to extract all data and registrer sub-keys in db in order to not have to rely on parsing again the armored key after. For the moment the armored key is stored in db and parse at presentation.

For the last part (validation of commit ), I will do it in a separate PR.

Related to go-gitea/go-sdk#36

  • GET /users/:username/gpg_keys
  • GET /user/gpg_keys
  • GET /user/gpg_keys/:id
  • POST /user/gpg_keys
  • DELETE /user/gpg_keys/:id

Bug : The public_key part in the respond is not in the good format.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/710 **Author:** [@sapk](https://github.com/sapk) **Created:** 1/20/2017 **Status:** ✅ Merged **Merged:** 3/16/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `add-gpg-api` --- ### 📝 Commits (4) - [`44c85b9`](https://github.com/go-gitea/gitea/commit/44c85b945d332781afb5cbbd75d6cec0745ebf0d) Implement GPG API - [`46c43cd`](https://github.com/go-gitea/gitea/commit/46c43cd9946eceb419dfbd21f7f680b042ccc003) Better handle error - [`8ed52ed`](https://github.com/go-gitea/gitea/commit/8ed52ed1777dc8c217458705b635bcacce7acb7d) Apply review recommendation + simplify database operations - [`47f46c4`](https://github.com/go-gitea/gitea/commit/47f46c4a5ef34577d6b00ebebf936dd787640749) Remove useless comments ### 📊 Changes **36 files changed** (+7931 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `models/error.go` (+48 -0) ➕ `models/gpg_key.go` (+276 -0) ➕ `models/gpg_key_test.go` (+48 -0) 📝 `models/models.go` (+1 -0) 📝 `routers/api/v1/api.go` (+8 -0) 📝 `routers/api/v1/convert/convert.go` (+45 -0) ➕ `routers/api/v1/user/gpg_key.go` (+102 -0) ➕ `vendor/golang.org/x/crypto/cast5/cast5.go` (+526 -0) ➕ `vendor/golang.org/x/crypto/openpgp/armor/armor.go` (+219 -0) ➕ `vendor/golang.org/x/crypto/openpgp/armor/encode.go` (+160 -0) ➕ `vendor/golang.org/x/crypto/openpgp/canonical_text.go` (+59 -0) ➕ `vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go` (+122 -0) ➕ `vendor/golang.org/x/crypto/openpgp/errors/errors.go` (+72 -0) ➕ `vendor/golang.org/x/crypto/openpgp/keys.go` (+637 -0) ➕ `vendor/golang.org/x/crypto/openpgp/packet/compressed.go` (+123 -0) ➕ `vendor/golang.org/x/crypto/openpgp/packet/config.go` (+91 -0) ➕ `vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go` (+199 -0) ➕ `vendor/golang.org/x/crypto/openpgp/packet/literal.go` (+89 -0) ➕ `vendor/golang.org/x/crypto/openpgp/packet/ocfb.go` (+143 -0) ➕ `vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go` (+73 -0) _...and 16 more files_ </details> ### 📄 Description In order to implement go-gitea/gitea#425. I added all the api call that gitea should implement. This is this a WIP. I will change the db format to extract all data and registrer sub-keys in db in order to not have to rely on parsing again the armored key after. For the moment the armored key is stored in db and parse at presentation. For the last part (validation of commit ), I will do it in a separate PR. Related to go-gitea/go-sdk#36 - [x] GET /users/:username/gpg_keys - [X] GET /user/gpg_keys - [X] GET /user/gpg_keys/:id - [X] POST /user/gpg_keys - [X] DELETE /user/gpg_keys/:id Bug : ~~The public_key part in the respond is not in the good format.~~ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:48:51 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15536