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.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. // swagger:strfmt date-time
  21. Created time.Time `json:"created_at,omitempty"`
  22. // swagger:strfmt date-time
  23. Expires time.Time `json:"expires_at,omitempty"`
  24. }
  25. // GPGKeyEmail an email attached to a GPGKey
  26. // swagger:model GPGKeyEmail
  27. type GPGKeyEmail struct {
  28. Email string `json:"email"`
  29. Verified bool `json:"verified"`
  30. }
  31. // CreateGPGKeyOption options create user GPG key
  32. type CreateGPGKeyOption struct {
  33. // An armored GPG key to add
  34. //
  35. // required: true
  36. // unique: true
  37. ArmoredKey string `json:"armored_public_key" binding:"Required"`
  38. }