Files
forge/modules/structs/user_gpgkey.go
zeekayandHanzo Dev 9a07b4d089 legal: Hanzo AI, Inc. copyright above the upstream notices
2978 files. The fork is 2026-07-15 (rebrand: gitea.dev -> github.com/hanzoai/git),
so 2026 is the year, and "Copyright 2026 Hanzo AI, Inc." was already the form
used by the handful of files that had ours.

Shape is now:

	// Copyright 2026 Hanzo AI, Inc. All rights reserved.
	// Copyright 2015 The Gogs Authors. All rights reserved.
	// Copyright 2019 The Gitea Authors. All rights reserved.
	// SPDX-License-Identifier: MIT

Ours on top, theirs retained verbatim. Retained because MIT requires it, and
separately because they are true — those authors did write that code.

Not renamed to "The Git Authors": Git is a different project under a different
license, and putting its name here would attribute this code to people who have
nothing to do with it. Adding our line is the fix; overwriting theirs would have
been both a licence violation and a false statement.

gofmt still reports import-order drift in some of these files. It predates this
change (verified against a stash) and is left alone rather than burying a
one-line-per-file legal change under 3000 files of unrelated reordering.

Build clean.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 13:49:52 -07:00

73 lines
2.3 KiB
Go

// Copyright 2026 Hanzo AI, Inc. All rights reserved.
// Copyright 2017 Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
import (
"time"
)
// GPGKey a user GPG key to sign commit and tag in repository
type GPGKey struct {
// The unique identifier of the GPG key
ID int64 `json:"id"`
// The primary key ID of the GPG key
PrimaryKeyID string `json:"primary_key_id"`
// The key ID of the GPG key
KeyID string `json:"key_id"`
// The public key content in armored format
PublicKey string `json:"public_key"`
// List of email addresses associated with this GPG key
Emails []*GPGKeyEmail `json:"emails"`
// List of subkeys of this GPG key
SubsKey []*GPGKey `json:"subkeys"`
// Whether the key can be used for signing
CanSign bool `json:"can_sign"`
// Whether the key can be used for encrypting communications
CanEncryptComms bool `json:"can_encrypt_comms"`
// Whether the key can be used for encrypting storage
CanEncryptStorage bool `json:"can_encrypt_storage"`
// Whether the key can be used for certification
CanCertify bool `json:"can_certify"`
// Whether the GPG key has been verified
Verified bool `json:"verified"`
// swagger:strfmt date-time
// The date and time when the GPG key was created
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
// The date and time when the GPG key expires
Expires time.Time `json:"expires_at"`
}
// GPGKeyEmail an email attached to a GPGKey
// swagger:model GPGKeyEmail
type GPGKeyEmail struct {
// The email address associated with the GPG key
Email string `json:"email"`
// Whether the email address has been verified
Verified bool `json:"verified"`
}
// CreateGPGKeyOption options create user GPG key
type CreateGPGKeyOption struct {
// An armored GPG key to add
//
// required: true
// unique: true
ArmoredKey string `json:"armored_public_key" binding:"Required"`
// An optional armored signature for the GPG key
Signature string `json:"armored_signature,omitempty"`
}
// VerifyGPGKeyOption options verifies user GPG key
type VerifyGPGKeyOption struct {
// An Signature for a GPG key token
//
// required: true
// The key ID of the GPG key to verify
KeyID string `json:"key_id" binding:"Required"`
// The armored signature to verify the GPG key
Signature string `json:"armored_signature" binding:"Required"`
}