1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add a login/login-name/username disambiguation to affected endpoint parameters and response/request models (#34901)

Issue: [link](https://github.com/go-gitea/gitea/issues/9637)

Changes introduced: I have clarified the problematic terms (`login`,
`login_name`, and `username`) in all affected endpoints.

The changes were made to relevant:
- HTTP endpoint parameters' descriptions 
- response/request models' fields
This commit is contained in:
AlexMaryW
2025-06-30 06:17:45 +02:00
committed by GitHub
parent 662db4a69c
commit f74a13610d
27 changed files with 131 additions and 112 deletions

View File

@@ -8,8 +8,11 @@ import "time"
// CreateUserOption create user options
type CreateUserOption struct {
SourceID int64 `json:"source_id"`
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)"`
FullName string `json:"full_name" binding:"MaxSize(100)"`
@@ -32,6 +35,8 @@ type CreateUserOption struct {
type EditUserOption struct {
// required: true
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

View File

@@ -71,7 +71,8 @@ type PayloadUser struct {
// Full name of the commit author
Name string `json:"name"`
// swagger:strfmt email
Email string `json:"email"`
Email string `json:"email"`
// username of the user
UserName string `json:"username"`
}

View File

@@ -14,7 +14,7 @@ type AddTimeOption struct {
Time int64 `json:"time" binding:"Required"`
// swagger:strfmt date-time
Created time.Time `json:"created"`
// User who spent the time (optional)
// username of the user who spent the time working on the issue (optional)
User string `json:"user_name"`
}
@@ -26,7 +26,8 @@ type TrackedTime struct {
// Time in seconds
Time int64 `json:"time"`
// deprecated (only for backwards compatibility)
UserID int64 `json:"user_id"`
UserID int64 `json:"user_id"`
// username of the user
UserName string `json:"user_name"`
// deprecated (only for backwards compatibility)
IssueID int64 `json:"issue_id"`

View File

@@ -15,6 +15,7 @@ type Organization struct {
Location string `json:"location"`
Visibility string `json:"visibility"`
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
// username of the organization
// deprecated
UserName string `json:"username"`
}
@@ -30,6 +31,7 @@ type OrganizationPermissions struct {
// CreateOrgOption options for creating an organization
type CreateOrgOption struct {
// username of the organization
// required: true
UserName string `json:"username" binding:"Required;Username;MaxSize(40)"`
FullName string `json:"full_name" binding:"MaxSize(100)"`

View File

@@ -15,9 +15,9 @@ import (
type User struct {
// the user's id
ID int64 `json:"id"`
// the user's username
// login of the user, same as `username`
UserName string `json:"login"`
// the user's authentication sign-in name.
// identifier of the user, provided by the external authenticator (if configured)
// default: empty
LoginName string `json:"login_name"`
// The ID of the user's Authentication Source

View File

@@ -11,6 +11,7 @@ type Email struct {
Verified bool `json:"verified"`
Primary bool `json:"primary"`
UserID int64 `json:"user_id"`
// username of the user
UserName string `json:"username"`
}