0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-20 23:28:28 +02:00

Update copyright year to 2025 in OAuth2 related files

This commit is contained in:
Tim Riedl 2025-04-21 17:58:29 +02:00
parent 8377386608
commit cb7b35945f
No known key found for this signature in database
GPG Key ID: 172D6410FC4F844E
3 changed files with 6 additions and 11 deletions

View File

@ -1,5 +1,4 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
// Copyright 2019 The Gitea Authors. All rights reserved.
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
@ -7,7 +6,6 @@ package structs
type AuthOauth2Option struct {
ID int64 `json:"id"`
AuthenticationName string `json:"authentication_name" binding:"Required"`
Type int `json:"type"`
TypeName string `json:"type_name"`
IsActive bool `json:"is_active"`

View File

@ -1,5 +1,4 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
// Copyright 2019 The Gitea Authors. All rights reserved.
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package admin

View File

@ -1,5 +1,5 @@
// // Copyright 2020 The Gitea Authors. All rights reserved.
// // SPDX-License-Identifier: MIT
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package convert
@ -10,8 +10,7 @@ import (
api "code.gitea.io/gitea/modules/structs"
)
// ToUser convert user_model.User to api.User
// if doer is set, private information is added if the doer has the permission to see it
// ToOauthProvider convert auth_model.Source≤ to api.AuthOauth2Option
func ToOauthProvider(ctx context.Context, provider *auth_model.Source) *api.AuthOauth2Option {
if provider == nil {
return nil
@ -20,7 +19,7 @@ func ToOauthProvider(ctx context.Context, provider *auth_model.Source) *api.Auth
return toOauthProvider(provider)
}
// ToUsers convert list of user_model.User to list of api.User
// ToOauthProviders convert list of auth_model.Source to list of api.AuthOauth2Option
func ToOauthProviders(ctx context.Context, provider []*auth_model.Source) []*api.AuthOauth2Option {
result := make([]*api.AuthOauth2Option, len(provider))
for i := range provider {
@ -33,7 +32,6 @@ func toOauthProvider(provider *auth_model.Source) *api.AuthOauth2Option {
return &api.AuthOauth2Option{
ID: provider.ID,
AuthenticationName: provider.Name,
Type: provider.Type.Int(),
TypeName: provider.Type.String(),
IsActive: provider.IsActive,