From e21c012dcbfd1c9132309b0cbc257857bd933018 Mon Sep 17 00:00:00 2001 From: tobiasbp Date: Thu, 2 May 2024 17:33:09 +0000 Subject: [PATCH] Get fields loginName & SourceID for users (#654) This _PR_ adds the following fields to the _User_ struct: - _LoginName_: Currently returned by the Gitea API. - _SourceID_: [Scheduled to be returned by the Gitea API as of version 1.22.0](https://github.com/go-gitea/gitea/pull/29718). The fields are used for users with non-local Authentication Sources (LDAP, oAuth etc.). Co-authored-by: tobias.petersen Co-authored-by: appleboy Co-authored-by: techknowlogick Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/654 Reviewed-by: appleboy Reviewed-by: techknowlogick Co-authored-by: tobiasbp Co-committed-by: tobiasbp --- forgejo/user.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/forgejo/user.go b/forgejo/user.go index c838c97..a3fed5b 100644 --- a/forgejo/user.go +++ b/forgejo/user.go @@ -21,6 +21,10 @@ type User struct { ID int64 `json:"id"` // the user's username UserName string `json:"login"` + // The login_name of non local users (e.g. LDAP / OAuth / SMTP) + LoginName string `json:"login_name"` + // The ID of the Authentication Source for non local users. + SourceID int64 `json:"source_id"` // the user's full name FullName string `json:"full_name"` Email string `json:"email"`