0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-21 08:04:54 +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 2025 The Gitea Authors. All rights reserved.
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
package structs package structs
@ -7,7 +6,6 @@ package structs
type AuthOauth2Option struct { type AuthOauth2Option struct {
ID int64 `json:"id"` ID int64 `json:"id"`
AuthenticationName string `json:"authentication_name" binding:"Required"` AuthenticationName string `json:"authentication_name" binding:"Required"`
Type int `json:"type"`
TypeName string `json:"type_name"` TypeName string `json:"type_name"`
IsActive bool `json:"is_active"` IsActive bool `json:"is_active"`

View File

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

View File

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