Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/[email protected]
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.32.3
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@717e3cb29becaaf00e56953556c6d80f8a01b286
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module code.gitea.io/gitea

go 1.24.6
go 1.25.0

// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
// But some CAs use negative serial number, just relax the check. related:
Expand Down
12 changes: 12 additions & 0 deletions modules/structs/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,32 @@
import "time"

type Activity struct {
// The unique identifier of the activity
ID int64 `json:"id"`

Check failure on line 10 in modules/structs/activity.go

View workflow job for this annotation

GitHub Actions / lint-backend

File is not properly formatted (gofmt)

Check failure on line 10 in modules/structs/activity.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

File is not properly formatted (gofmt)

Check failure on line 10 in modules/structs/activity.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

File is not properly formatted (gofmt)
// The ID of the user who receives/sees this activity
UserID int64 `json:"user_id"` // Receiver user
// the type of action
//
// enum: create_repo,rename_repo,star_repo,watch_repo,commit_repo,create_issue,create_pull_request,transfer_repo,push_tag,comment_issue,merge_pull_request,close_issue,reopen_issue,close_pull_request,reopen_pull_request,delete_tag,delete_branch,mirror_sync_push,mirror_sync_create,mirror_sync_delete,approve_pull_request,reject_pull_request,comment_pull,publish_release,pull_review_dismissed,pull_request_ready_for_review,auto_merge_pull_request
OpType string `json:"op_type"`
// The ID of the user who performed the action
ActUserID int64 `json:"act_user_id"`
// The user who performed the action
ActUser *User `json:"act_user"`
// The ID of the repository associated with the activity
RepoID int64 `json:"repo_id"`
// The repository associated with the activity
Repo *Repository `json:"repo"`
// The ID of the comment associated with the activity (if applicable)
CommentID int64 `json:"comment_id"`
// The comment associated with the activity (if applicable)
Comment *Comment `json:"comment"`
// The name of the git reference (branch/tag) associated with the activity
RefName string `json:"ref_name"`
// Whether this activity is from a private repository
IsPrivate bool `json:"is_private"`
// Additional content or details about the activity
Content string `json:"content"`
// The date and time when the activity occurred
Created time.Time `json:"created"`
}
1 change: 1 addition & 0 deletions modules/structs/activitypub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ package structs

// ActivityPub type
type ActivityPub struct {
// Context defines the JSON-LD context for ActivityPub
Context string `json:"@context"`
}
68 changes: 46 additions & 22 deletions modules/structs/admin_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,29 @@ import "time"

// CreateUserOption create user options
type CreateUserOption struct {
// The authentication source ID to associate with the user
SourceID int64 `json:"source_id"`
// identifier of the user, provided by the external authenticator (if configured)
// default: empty
LoginName string `json:"login_name"`
// username of the user
// required: true
Username string `json:"username" binding:"Required;Username;MaxSize(40)"`
// The full display name of the user
FullName string `json:"full_name" binding:"MaxSize(100)"`
// required: true
// swagger:strfmt email
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
Password string `json:"password" binding:"MaxSize(255)"`
MustChangePassword *bool `json:"must_change_password"`
SendNotify bool `json:"send_notify"`
Restricted *bool `json:"restricted"`
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
// The plain text password for the user
Password string `json:"password" binding:"MaxSize(255)"`
// Whether the user must change password on first login
MustChangePassword *bool `json:"must_change_password"`
// Whether to send welcome notification email to the user
SendNotify bool `json:"send_notify"`
// Whether the user has restricted access privileges
Restricted *bool `json:"restricted"`
// User visibility level: public, limited, or private
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`

// For explicitly setting the user creation timestamp. Useful when users are
// migrated from other systems. When omitted, the user's creation timestamp
Expand All @@ -34,26 +41,43 @@ type CreateUserOption struct {
// EditUserOption edit user options
type EditUserOption struct {
// required: true
// The authentication source ID to associate with the user
SourceID int64 `json:"source_id"`
// identifier of the user, provided by the external authenticator (if configured)
// default: empty
// required: true
LoginName string `json:"login_name" binding:"Required"`
// swagger:strfmt email
Email *string `json:"email" binding:"MaxSize(254)"`
FullName *string `json:"full_name" binding:"MaxSize(100)"`
Password string `json:"password" binding:"MaxSize(255)"`
MustChangePassword *bool `json:"must_change_password"`
Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
Location *string `json:"location" binding:"MaxSize(50)"`
Description *string `json:"description" binding:"MaxSize(255)"`
Active *bool `json:"active"`
Admin *bool `json:"admin"`
AllowGitHook *bool `json:"allow_git_hook"`
AllowImportLocal *bool `json:"allow_import_local"`
MaxRepoCreation *int `json:"max_repo_creation"`
ProhibitLogin *bool `json:"prohibit_login"`
AllowCreateOrganization *bool `json:"allow_create_organization"`
Restricted *bool `json:"restricted"`
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
// The email address of the user
Email *string `json:"email" binding:"MaxSize(254)"`
// The full display name of the user
FullName *string `json:"full_name" binding:"MaxSize(100)"`
// The plain text password for the user
Password string `json:"password" binding:"MaxSize(255)"`
// Whether the user must change password on next login
MustChangePassword *bool `json:"must_change_password"`
// The user's personal website URL
Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
// The user's location or address
Location *string `json:"location" binding:"MaxSize(50)"`
// The user's personal description or bio
Description *string `json:"description" binding:"MaxSize(255)"`
// Whether the user account is active
Active *bool `json:"active"`
// Whether the user has administrator privileges
Admin *bool `json:"admin"`
// Whether the user can use Git hooks
AllowGitHook *bool `json:"allow_git_hook"`
// Whether the user can import local repositories
AllowImportLocal *bool `json:"allow_import_local"`
// Maximum number of repositories the user can create
MaxRepoCreation *int `json:"max_repo_creation"`
// Whether the user is prohibited from logging in
ProhibitLogin *bool `json:"prohibit_login"`
// Whether the user can create organizations
AllowCreateOrganization *bool `json:"allow_create_organization"`
// Whether the user has restricted access privileges
Restricted *bool `json:"restricted"`
// User visibility level: public, limited, or private
Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
}
8 changes: 8 additions & 0 deletions modules/structs/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@
// Attachment a generic attachment
// swagger:model
type Attachment struct {
// ID is the unique identifier for the attachment
ID int64 `json:"id"`

Check failure on line 14 in modules/structs/attachment.go

View workflow job for this annotation

GitHub Actions / lint-backend

File is not properly formatted (gofmt)

Check failure on line 14 in modules/structs/attachment.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

File is not properly formatted (gofmt)

Check failure on line 14 in modules/structs/attachment.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

File is not properly formatted (gofmt)
// Name is the filename of the attachment
Name string `json:"name"`
// Size is the file size in bytes
Size int64 `json:"size"`
// DownloadCount is the number of times the attachment has been downloaded
DownloadCount int64 `json:"download_count"`
// swagger:strfmt date-time
// Created is the time when the attachment was uploaded
Created time.Time `json:"created_at"`
// UUID is the unique identifier for the attachment file
UUID string `json:"uuid"`
// DownloadURL is the URL to download the attachment
DownloadURL string `json:"browser_download_url"`
}

// EditAttachmentOptions options for editing attachments
// swagger:model
type EditAttachmentOptions struct {
// Name is the new filename for the attachment
Name string `json:"name"`
}
5 changes: 5 additions & 0 deletions modules/structs/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@

// Cron represents a Cron task
type Cron struct {
// The name of the cron task
Name string `json:"name"`

Check failure on line 11 in modules/structs/cron.go

View workflow job for this annotation

GitHub Actions / lint-backend

File is not properly formatted (gofmt)

Check failure on line 11 in modules/structs/cron.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

File is not properly formatted (gofmt)

Check failure on line 11 in modules/structs/cron.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

File is not properly formatted (gofmt)
// The cron schedule expression (e.g., "0 0 * * *")
Schedule string `json:"schedule"`
// The next scheduled execution time
Next time.Time `json:"next"`
// The previous execution time
Prev time.Time `json:"prev"`
// The total number of times this cron task has been executed
ExecTimes int64 `json:"exec_times"`
}
7 changes: 7 additions & 0 deletions modules/structs/git_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@

// GitBlobResponse represents a git blob
type GitBlobResponse struct {
// The content of the git blob (may be base64 encoded)
Content *string `json:"content"`

Check failure on line 9 in modules/structs/git_blob.go

View workflow job for this annotation

GitHub Actions / lint-backend

File is not properly formatted (gofmt)

Check failure on line 9 in modules/structs/git_blob.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

File is not properly formatted (gofmt)

Check failure on line 9 in modules/structs/git_blob.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

File is not properly formatted (gofmt)
// The encoding used for the content (e.g., "base64")
Encoding *string `json:"encoding"`
// The URL to access this git blob
URL string `json:"url"`
// The SHA hash of the git blob
SHA string `json:"sha"`
// The size of the git blob in bytes
Size int64 `json:"size"`

// The LFS object ID if this blob is stored in LFS
LfsOid *string `json:"lfs_oid,omitempty"`
// The size of the LFS object if this blob is stored in LFS
LfsSize *int64 `json:"lfs_size,omitempty"`
}
4 changes: 4 additions & 0 deletions modules/structs/git_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@

// GitHook represents a Git repository hook
type GitHook struct {
// Name is the name of the Git hook
Name string `json:"name"`

Check failure on line 9 in modules/structs/git_hook.go

View workflow job for this annotation

GitHub Actions / lint-backend

File is not properly formatted (gofmt)

Check failure on line 9 in modules/structs/git_hook.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

File is not properly formatted (gofmt)

Check failure on line 9 in modules/structs/git_hook.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

File is not properly formatted (gofmt)
// IsActive indicates if the hook is active
IsActive bool `json:"is_active"`
// Content contains the script content of the hook
Content string `json:"content,omitempty"`
}

Expand All @@ -15,5 +18,6 @@

// EditGitHookOption options when modifying one Git hook
type EditGitHookOption struct {
// Content is the new script content for the hook
Content string `json:"content"`
}
Loading
Loading