Skip to content

Commit cb98242

Browse files
authored
Merge branch 'main' into issue-34870
2 parents 9d20f6f + f74a136 commit cb98242

27 files changed

+131
-112
lines changed

modules/structs/admin_user.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import "time"
88

99
// CreateUserOption create user options
1010
type CreateUserOption struct {
11-
SourceID int64 `json:"source_id"`
11+
SourceID int64 `json:"source_id"`
12+
// identifier of the user, provided by the external authenticator (if configured)
13+
// default: empty
1214
LoginName string `json:"login_name"`
15+
// username of the user
1316
// required: true
1417
Username string `json:"username" binding:"Required;Username;MaxSize(40)"`
1518
FullName string `json:"full_name" binding:"MaxSize(100)"`
@@ -32,6 +35,8 @@ type CreateUserOption struct {
3235
type EditUserOption struct {
3336
// required: true
3437
SourceID int64 `json:"source_id"`
38+
// identifier of the user, provided by the external authenticator (if configured)
39+
// default: empty
3540
// required: true
3641
LoginName string `json:"login_name" binding:"Required"`
3742
// swagger:strfmt email

modules/structs/hook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ type PayloadUser struct {
7171
// Full name of the commit author
7272
Name string `json:"name"`
7373
// swagger:strfmt email
74-
Email string `json:"email"`
74+
Email string `json:"email"`
75+
// username of the user
7576
UserName string `json:"username"`
7677
}
7778

modules/structs/issue_tracked_time.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type AddTimeOption struct {
1414
Time int64 `json:"time" binding:"Required"`
1515
// swagger:strfmt date-time
1616
Created time.Time `json:"created"`
17-
// User who spent the time (optional)
17+
// username of the user who spent the time working on the issue (optional)
1818
User string `json:"user_name"`
1919
}
2020

@@ -26,7 +26,8 @@ type TrackedTime struct {
2626
// Time in seconds
2727
Time int64 `json:"time"`
2828
// deprecated (only for backwards compatibility)
29-
UserID int64 `json:"user_id"`
29+
UserID int64 `json:"user_id"`
30+
// username of the user
3031
UserName string `json:"user_name"`
3132
// deprecated (only for backwards compatibility)
3233
IssueID int64 `json:"issue_id"`

modules/structs/org.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type Organization struct {
1515
Location string `json:"location"`
1616
Visibility string `json:"visibility"`
1717
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
18+
// username of the organization
1819
// deprecated
1920
UserName string `json:"username"`
2021
}
@@ -30,6 +31,7 @@ type OrganizationPermissions struct {
3031

3132
// CreateOrgOption options for creating an organization
3233
type CreateOrgOption struct {
34+
// username of the organization
3335
// required: true
3436
UserName string `json:"username" binding:"Required;Username;MaxSize(40)"`
3537
FullName string `json:"full_name" binding:"MaxSize(100)"`

modules/structs/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
type User struct {
1616
// the user's id
1717
ID int64 `json:"id"`
18-
// the user's username
18+
// login of the user, same as `username`
1919
UserName string `json:"login"`
20-
// the user's authentication sign-in name.
20+
// identifier of the user, provided by the external authenticator (if configured)
2121
// default: empty
2222
LoginName string `json:"login_name"`
2323
// The ID of the user's Authentication Source

modules/structs/user_email.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Email struct {
1111
Verified bool `json:"verified"`
1212
Primary bool `json:"primary"`
1313
UserID int64 `json:"user_id"`
14+
// username of the user
1415
UserName string `json:"username"`
1516
}
1617

routers/api/v1/admin/org.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func CreateOrg(ctx *context.APIContext) {
2929
// parameters:
3030
// - name: username
3131
// in: path
32-
// description: username of the user that will own the created organization
32+
// description: username of the user who will own the created organization
3333
// type: string
3434
// required: true
3535
// - name: organization

routers/api/v1/admin/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func CreateRepo(ctx *context.APIContext) {
2222
// parameters:
2323
// - name: username
2424
// in: path
25-
// description: username of the user. This user will own the created repository
25+
// description: username of the user who will own the created repository
2626
// type: string
2727
// required: true
2828
// - name: repository

routers/api/v1/admin/user.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func EditUser(ctx *context.APIContext) {
175175
// parameters:
176176
// - name: username
177177
// in: path
178-
// description: username of user to edit
178+
// description: username of the user whose data is to be edited
179179
// type: string
180180
// required: true
181181
// - name: body
@@ -272,7 +272,7 @@ func DeleteUser(ctx *context.APIContext) {
272272
// parameters:
273273
// - name: username
274274
// in: path
275-
// description: username of user to delete
275+
// description: username of the user to delete
276276
// type: string
277277
// required: true
278278
// - name: purge
@@ -328,7 +328,7 @@ func CreatePublicKey(ctx *context.APIContext) {
328328
// parameters:
329329
// - name: username
330330
// in: path
331-
// description: username of the user
331+
// description: username of the user who is to receive a public key
332332
// type: string
333333
// required: true
334334
// - name: key
@@ -358,7 +358,7 @@ func DeleteUserPublicKey(ctx *context.APIContext) {
358358
// parameters:
359359
// - name: username
360360
// in: path
361-
// description: username of user
361+
// description: username of the user whose public key is to be deleted
362362
// type: string
363363
// required: true
364364
// - name: id
@@ -405,7 +405,7 @@ func SearchUsers(ctx *context.APIContext) {
405405
// format: int64
406406
// - name: login_name
407407
// in: query
408-
// description: user's login name to search for
408+
// description: identifier of the user, provided by the external authenticator
409409
// type: string
410410
// - name: page
411411
// in: query
@@ -456,7 +456,7 @@ func RenameUser(ctx *context.APIContext) {
456456
// parameters:
457457
// - name: username
458458
// in: path
459-
// description: existing username of user
459+
// description: current username of the user
460460
// type: string
461461
// required: true
462462
// - name: body

routers/api/v1/admin/user_badge.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func ListUserBadges(ctx *context.APIContext) {
2222
// parameters:
2323
// - name: username
2424
// in: path
25-
// description: username of user
25+
// description: username of the user whose badges are to be listed
2626
// type: string
2727
// required: true
2828
// responses:
@@ -53,7 +53,7 @@ func AddUserBadges(ctx *context.APIContext) {
5353
// parameters:
5454
// - name: username
5555
// in: path
56-
// description: username of user
56+
// description: username of the user to whom a badge is to be added
5757
// type: string
5858
// required: true
5959
// - name: body
@@ -87,7 +87,7 @@ func DeleteUserBadges(ctx *context.APIContext) {
8787
// parameters:
8888
// - name: username
8989
// in: path
90-
// description: username of user
90+
// description: username of the user whose badge is to be deleted
9191
// type: string
9292
// required: true
9393
// - name: body

routers/api/v1/org/block.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func CheckUserBlock(ctx *context.APIContext) {
4747
// required: true
4848
// - name: username
4949
// in: path
50-
// description: user to check
50+
// description: username of the user to check
5151
// type: string
5252
// required: true
5353
// responses:
@@ -71,7 +71,7 @@ func BlockUser(ctx *context.APIContext) {
7171
// required: true
7272
// - name: username
7373
// in: path
74-
// description: user to block
74+
// description: username of the user to block
7575
// type: string
7676
// required: true
7777
// - name: note
@@ -101,7 +101,7 @@ func UnblockUser(ctx *context.APIContext) {
101101
// required: true
102102
// - name: username
103103
// in: path
104-
// description: user to unblock
104+
// description: username of the user to unblock
105105
// type: string
106106
// required: true
107107
// responses:

routers/api/v1/org/member.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func IsMember(ctx *context.APIContext) {
133133
// required: true
134134
// - name: username
135135
// in: path
136-
// description: username of the user
136+
// description: username of the user to check for an organization membership
137137
// type: string
138138
// required: true
139139
// responses:
@@ -186,7 +186,7 @@ func IsPublicMember(ctx *context.APIContext) {
186186
// required: true
187187
// - name: username
188188
// in: path
189-
// description: username of the user
189+
// description: username of the user to check for a public organization membership
190190
// type: string
191191
// required: true
192192
// responses:
@@ -240,7 +240,7 @@ func PublicizeMember(ctx *context.APIContext) {
240240
// required: true
241241
// - name: username
242242
// in: path
243-
// description: username of the user
243+
// description: username of the user whose membership is to be publicized
244244
// type: string
245245
// required: true
246246
// responses:
@@ -282,7 +282,7 @@ func ConcealMember(ctx *context.APIContext) {
282282
// required: true
283283
// - name: username
284284
// in: path
285-
// description: username of the user
285+
// description: username of the user whose membership is to be concealed
286286
// type: string
287287
// required: true
288288
// responses:
@@ -324,7 +324,7 @@ func DeleteMember(ctx *context.APIContext) {
324324
// required: true
325325
// - name: username
326326
// in: path
327-
// description: username of the user
327+
// description: username of the user to remove from the organization
328328
// type: string
329329
// required: true
330330
// responses:

routers/api/v1/org/org.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func ListUserOrgs(ctx *context.APIContext) {
8282
// parameters:
8383
// - name: username
8484
// in: path
85-
// description: username of user
85+
// description: username of the user whose organizations are to be listed
8686
// type: string
8787
// required: true
8888
// - name: page
@@ -112,7 +112,7 @@ func GetUserOrgsPermissions(ctx *context.APIContext) {
112112
// parameters:
113113
// - name: username
114114
// in: path
115-
// description: username of user
115+
// description: username of the user whose permissions are to be obtained
116116
// type: string
117117
// required: true
118118
// - name: org

routers/api/v1/org/team.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func GetTeamMember(ctx *context.APIContext) {
426426
// required: true
427427
// - name: username
428428
// in: path
429-
// description: username of the member to list
429+
// description: username of the user whose data is to be listed
430430
// type: string
431431
// required: true
432432
// responses:
@@ -467,7 +467,7 @@ func AddTeamMember(ctx *context.APIContext) {
467467
// required: true
468468
// - name: username
469469
// in: path
470-
// description: username of the user to add
470+
// description: username of the user to add to a team
471471
// type: string
472472
// required: true
473473
// responses:
@@ -509,7 +509,7 @@ func RemoveTeamMember(ctx *context.APIContext) {
509509
// required: true
510510
// - name: username
511511
// in: path
512-
// description: username of the user to remove
512+
// description: username of the user to remove from a team
513513
// type: string
514514
// required: true
515515
// responses:

routers/api/v1/repo/collaborators.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func IsCollaborator(ctx *context.APIContext) {
9393
// required: true
9494
// - name: collaborator
9595
// in: path
96-
// description: username of the collaborator
96+
// description: username of the user to check for being a collaborator
9797
// type: string
9898
// required: true
9999
// responses:
@@ -145,7 +145,7 @@ func AddOrUpdateCollaborator(ctx *context.APIContext) {
145145
// required: true
146146
// - name: collaborator
147147
// in: path
148-
// description: username of the collaborator to add
148+
// description: username of the user to add or update as a collaborator
149149
// type: string
150150
// required: true
151151
// - name: body
@@ -264,7 +264,7 @@ func GetRepoPermissions(ctx *context.APIContext) {
264264
// required: true
265265
// - name: collaborator
266266
// in: path
267-
// description: username of the collaborator
267+
// description: username of the collaborator whose permissions are to be obtained
268268
// type: string
269269
// required: true
270270
// responses:

routers/api/v1/repo/issue_subscription.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func AddIssueSubscription(ctx *context.APIContext) {
4343
// required: true
4444
// - name: user
4545
// in: path
46-
// description: user to subscribe
46+
// description: username of the user to subscribe the issue to
4747
// type: string
4848
// required: true
4949
// responses:
@@ -87,7 +87,7 @@ func DelIssueSubscription(ctx *context.APIContext) {
8787
// required: true
8888
// - name: user
8989
// in: path
90-
// description: user witch unsubscribe
90+
// description: username of the user to unsubscribe from an issue
9191
// type: string
9292
// required: true
9393
// responses:

routers/api/v1/repo/issue_tracked_time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func ListTrackedTimesByUser(ctx *context.APIContext) {
405405
// required: true
406406
// - name: user
407407
// in: path
408-
// description: username of user
408+
// description: username of the user whose tracked times are to be listed
409409
// type: string
410410
// required: true
411411
// responses:

routers/api/v1/user/app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func ListAccessTokens(ctx *context.APIContext) {
3030
// parameters:
3131
// - name: username
3232
// in: path
33-
// description: username of user
33+
// description: username of to user whose access tokens are to be listed
3434
// type: string
3535
// required: true
3636
// - name: page
@@ -83,7 +83,7 @@ func CreateAccessToken(ctx *context.APIContext) {
8383
// parameters:
8484
// - name: username
8585
// in: path
86-
// description: username of user
86+
// description: username of the user whose token is to be created
8787
// required: true
8888
// type: string
8989
// - name: body
@@ -149,7 +149,7 @@ func DeleteAccessToken(ctx *context.APIContext) {
149149
// parameters:
150150
// - name: username
151151
// in: path
152-
// description: username of user
152+
// description: username of the user whose token is to be deleted
153153
// type: string
154154
// required: true
155155
// - name: token

0 commit comments

Comments
 (0)