forked from Shiloh/githaven
Update API to return 'source_id' for users (#29718)
Using the API, a user's _source_id_ can be set in the _CreateUserOption_ model, but the field is not returned in the _User_ model. This PR updates the _User_ model to include the field _source_id_ (The ID of the Authentication Source).
This commit is contained in:
parent
6ba0c371c2
commit
58b204b813
@ -20,6 +20,8 @@ type User struct {
|
|||||||
// the user's authentication sign-in name.
|
// the user's authentication sign-in name.
|
||||||
// default: empty
|
// default: empty
|
||||||
LoginName string `json:"login_name"`
|
LoginName string `json:"login_name"`
|
||||||
|
// The ID of the user's Authentication Source
|
||||||
|
SourceID int64 `json:"source_id"`
|
||||||
// the user's full name
|
// the user's full name
|
||||||
FullName string `json:"full_name"`
|
FullName string `json:"full_name"`
|
||||||
// swagger:strfmt email
|
// swagger:strfmt email
|
||||||
|
@ -75,6 +75,7 @@ func toUser(ctx context.Context, user *user_model.User, signed, authed bool) *ap
|
|||||||
if authed {
|
if authed {
|
||||||
result.IsAdmin = user.IsAdmin
|
result.IsAdmin = user.IsAdmin
|
||||||
result.LoginName = user.LoginName
|
result.LoginName = user.LoginName
|
||||||
|
result.SourceID = user.LoginSource
|
||||||
result.LastLogin = user.LastLoginUnix.AsTime()
|
result.LastLogin = user.LastLoginUnix.AsTime()
|
||||||
result.Language = user.Language
|
result.Language = user.Language
|
||||||
result.IsActive = user.IsActive
|
result.IsActive = user.IsActive
|
||||||
|
6
templates/swagger/v1_json.tmpl
generated
6
templates/swagger/v1_json.tmpl
generated
@ -24260,6 +24260,12 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"x-go-name": "Restricted"
|
"x-go-name": "Restricted"
|
||||||
},
|
},
|
||||||
|
"source_id": {
|
||||||
|
"description": "The ID of the user's Authentication Source",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "SourceID"
|
||||||
|
},
|
||||||
"starred_repos_count": {
|
"starred_repos_count": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
|
Loading…
Reference in New Issue
Block a user