You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user_gpgkey.go 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2017 Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package structs
  5. import (
  6. "time"
  7. )
  8. // GPGKey a user GPG key to sign commit and tag in repository
  9. type GPGKey struct {
  10. ID int64 `json:"id"`
  11. PrimaryKeyID string `json:"primary_key_id"`
  12. KeyID string `json:"key_id"`
  13. PublicKey string `json:"public_key"`
  14. Emails []*GPGKeyEmail `json:"emails"`
  15. SubsKey []*GPGKey `json:"subkeys"`
  16. CanSign bool `json:"can_sign"`
  17. CanEncryptComms bool `json:"can_encrypt_comms"`
  18. CanEncryptStorage bool `json:"can_encrypt_storage"`
  19. CanCertify bool `json:"can_certify"`
  20. Verified bool `json:"verified"`
  21. // swagger:strfmt date-time
  22. Created time.Time `json:"created_at,omitempty"`
  23. // swagger:strfmt date-time
  24. Expires time.Time `json:"expires_at,omitempty"`
  25. }
  26. // GPGKeyEmail an email attached to a GPGKey
  27. // swagger:model GPGKeyEmail
  28. type GPGKeyEmail struct {
  29. Email string `json:"email"`
  30. Verified bool `json:"verified"`
  31. }
  32. // CreateGPGKeyOption options create user GPG key
  33. type CreateGPGKeyOption struct {
  34. // An armored GPG key to add
  35. //
  36. // required: true
  37. // unique: true
  38. ArmoredKey string `json:"armored_public_key" binding:"Required"`
  39. Signature string `json:"armored_signature,omitempty"`
  40. }
  41. // VerifyGPGKeyOption options verifies user GPG key
  42. type VerifyGPGKeyOption struct {
  43. // An Signature for a GPG key token
  44. //
  45. // required: true
  46. KeyID string `json:"key_id" binding:"Required"`
  47. Signature string `json:"armored_signature" binding:"Required"`
  48. }