From cb7b35945f7eae39a558c61c0cda0b303de840e6 Mon Sep 17 00:00:00 2001 From: Tim Riedl Date: Mon, 21 Apr 2025 17:58:29 +0200 Subject: [PATCH] Update copyright year to 2025 in OAuth2 related files --- modules/structs/auth_oauth2.go | 4 +--- routers/api/v1/admin/auth_oauth.go | 3 +-- services/convert/auth_oauth.go | 10 ++++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/structs/auth_oauth2.go b/modules/structs/auth_oauth2.go index f7e10d7ef3..7b5ed5d4ef 100644 --- a/modules/structs/auth_oauth2.go +++ b/modules/structs/auth_oauth2.go @@ -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"` diff --git a/routers/api/v1/admin/auth_oauth.go b/routers/api/v1/admin/auth_oauth.go index 924e2c723a..c594afa9cf 100644 --- a/routers/api/v1/admin/auth_oauth.go +++ b/routers/api/v1/admin/auth_oauth.go @@ -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 diff --git a/services/convert/auth_oauth.go b/services/convert/auth_oauth.go index e76fbd1e31..93f90b0a52 100644 --- a/services/convert/auth_oauth.go +++ b/services/convert/auth_oauth.go @@ -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,