2017-02-22 16:53:33 -07:00
|
|
|
// Copyright 2017 Gitea Authors. All rights reserved.
|
2022-11-27 11:20:29 -07:00
|
|
|
// SPDX-License-Identifier: MIT
|
2017-02-22 16:53:33 -07:00
|
|
|
|
2019-05-11 04:21:34 -06:00
|
|
|
package structs
|
2017-02-22 16:53:33 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// GPGKey a user GPG key to sign commit and tag in repository
|
|
|
|
type GPGKey struct {
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
PrimaryKeyID string `json:"primary_key_id"`
|
|
|
|
KeyID string `json:"key_id"`
|
|
|
|
PublicKey string `json:"public_key"`
|
|
|
|
Emails []*GPGKeyEmail `json:"emails"`
|
|
|
|
SubsKey []*GPGKey `json:"subkeys"`
|
|
|
|
CanSign bool `json:"can_sign"`
|
|
|
|
CanEncryptComms bool `json:"can_encrypt_comms"`
|
|
|
|
CanEncryptStorage bool `json:"can_encrypt_storage"`
|
|
|
|
CanCertify bool `json:"can_certify"`
|
2021-07-13 07:28:07 -06:00
|
|
|
Verified bool `json:"verified"`
|
2017-11-13 00:02:25 -07:00
|
|
|
// swagger:strfmt date-time
|
2018-03-05 18:22:16 -07:00
|
|
|
Created time.Time `json:"created_at,omitempty"`
|
2017-11-13 00:02:25 -07:00
|
|
|
// swagger:strfmt date-time
|
2018-03-05 18:22:16 -07:00
|
|
|
Expires time.Time `json:"expires_at,omitempty"`
|
2017-02-22 16:53:33 -07:00
|
|
|
}
|
|
|
|
|
2017-08-21 05:13:47 -06:00
|
|
|
// GPGKeyEmail an email attached to a GPGKey
|
2017-05-02 07:35:59 -06:00
|
|
|
// swagger:model GPGKeyEmail
|
2017-02-22 16:53:33 -07:00
|
|
|
type GPGKeyEmail struct {
|
|
|
|
Email string `json:"email"`
|
|
|
|
Verified bool `json:"verified"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateGPGKeyOption options create user GPG key
|
|
|
|
type CreateGPGKeyOption struct {
|
2017-05-02 07:35:59 -06:00
|
|
|
// An armored GPG key to add
|
|
|
|
//
|
|
|
|
// required: true
|
|
|
|
// unique: true
|
2017-02-22 16:53:33 -07:00
|
|
|
ArmoredKey string `json:"armored_public_key" binding:"Required"`
|
2021-07-13 07:28:07 -06:00
|
|
|
Signature string `json:"armored_signature,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// VerifyGPGKeyOption options verifies user GPG key
|
|
|
|
type VerifyGPGKeyOption struct {
|
|
|
|
// An Signature for a GPG key token
|
|
|
|
//
|
|
|
|
// required: true
|
|
|
|
KeyID string `json:"key_id" binding:"Required"`
|
|
|
|
Signature string `json:"armored_signature" binding:"Required"`
|
2017-02-22 16:53:33 -07:00
|
|
|
}
|