diff --git a/backend/cmd/main.go b/backend/cmd/main.go index 1fb5fb1..b1c1b82 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -1,7 +1,24 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + // @title Easywish client API // @version 1.0 // @description Easy and feature-rich wishlist. -// @license.name GPL 3.0 +// @license.name GPL-3.0 // @BasePath /api/ // @Schemes http @@ -90,4 +107,3 @@ func main() { ).Run() } - diff --git a/backend/config/config.go b/backend/config/config.go index ff3b42b..35814ba 100644 --- a/backend/config/config.go +++ b/backend/config/config.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package config import ( diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 137d474..c1ebf38 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -299,6 +299,10 @@ const docTemplate = `{ }, "models.LoginRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { "password": { "type": "string" @@ -324,6 +328,10 @@ const docTemplate = `{ }, "models.RegistrationBeginRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { "email": { "type": "string" @@ -333,7 +341,9 @@ const docTemplate = `{ "type": "string" }, "username": { - "type": "string" + "type": "string", + "maxLength": 20, + "minLength": 3 } } } diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index b1d469a..8868dde 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -295,6 +295,10 @@ }, "models.LoginRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { "password": { "type": "string" @@ -320,6 +324,10 @@ }, "models.RegistrationBeginRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { "email": { "type": "string" @@ -329,7 +337,9 @@ "type": "string" }, "username": { - "type": "string" + "type": "string", + "maxLength": 20, + "minLength": 3 } } } diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 66a9a37..eebc2bf 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -13,6 +13,9 @@ definitions: type: string username: type: string + required: + - password + - username type: object models.LoginResponse: properties: @@ -29,7 +32,12 @@ definitions: description: 'TODO: password checking' type: string username: + maxLength: 20 + minLength: 3 type: string + required: + - password + - username type: object info: contact: {} diff --git a/backend/internal/controllers/account.go b/backend/internal/controllers/account.go index 210c562..3f2e1d3 100644 --- a/backend/internal/controllers/account.go +++ b/backend/internal/controllers/account.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package controllers import ( @@ -15,4 +32,3 @@ import ( func ChangePassword(c *gin.Context) { c.Status(http.StatusNotImplemented) } - diff --git a/backend/internal/controllers/auth.go b/backend/internal/controllers/auth.go index 0a6cb77..98e01f3 100644 --- a/backend/internal/controllers/auth.go +++ b/backend/internal/controllers/auth.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package controllers import ( diff --git a/backend/internal/controllers/profile.go b/backend/internal/controllers/profile.go index 08aeeaf..c1bee1a 100644 --- a/backend/internal/controllers/profile.go +++ b/backend/internal/controllers/profile.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package controllers import ( diff --git a/backend/internal/controllers/router.go b/backend/internal/controllers/router.go index 1256a3b..20731b5 100644 --- a/backend/internal/controllers/router.go +++ b/backend/internal/controllers/router.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package controllers import ( diff --git a/backend/internal/controllers/service.go b/backend/internal/controllers/service.go index 923856a..d0012a4 100644 --- a/backend/internal/controllers/service.go +++ b/backend/internal/controllers/service.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package controllers import ( diff --git a/backend/internal/controllers/setup.go b/backend/internal/controllers/setup.go index 5b64227..5f4ba0a 100644 --- a/backend/internal/controllers/setup.go +++ b/backend/internal/controllers/setup.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package controllers import ( diff --git a/backend/internal/database/dbContext.go b/backend/internal/database/dbContext.go index 08676f8..64edb54 100644 --- a/backend/internal/database/dbContext.go +++ b/backend/internal/database/dbContext.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package database import ( diff --git a/backend/internal/database/helper.go b/backend/internal/database/helper.go index 36f7722..f008b49 100644 --- a/backend/internal/database/helper.go +++ b/backend/internal/database/helper.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package database import ( diff --git a/backend/internal/database/setup.go b/backend/internal/database/setup.go index 0679236..ceef387 100644 --- a/backend/internal/database/setup.go +++ b/backend/internal/database/setup.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package database import ( @@ -9,5 +26,3 @@ var Module = fx.Module("database", NewDbContext, ), ) - - diff --git a/backend/internal/errors/auth.go b/backend/internal/errors/auth.go index 55d13cf..5d2a4f1 100644 --- a/backend/internal/errors/auth.go +++ b/backend/internal/errors/auth.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package errors import ( diff --git a/backend/internal/errors/general.go b/backend/internal/errors/general.go index cbb6213..e3bdc79 100644 --- a/backend/internal/errors/general.go +++ b/backend/internal/errors/general.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package errors import ( @@ -8,4 +25,3 @@ var ( ErrNotImplemented = errors.New("Feature is not implemented") ErrBadRequest = errors.New("Bad request") ) - diff --git a/backend/internal/logger/logger.go b/backend/internal/logger/logger.go index 5bac938..c0068a5 100644 --- a/backend/internal/logger/logger.go +++ b/backend/internal/logger/logger.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package logger import ( diff --git a/backend/internal/middleware/auth.go b/backend/internal/middleware/auth.go index 1cca2b7..db5fd0e 100644 --- a/backend/internal/middleware/auth.go +++ b/backend/internal/middleware/auth.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package middleware import ( diff --git a/backend/internal/models/auth.go b/backend/internal/models/auth.go index b759276..df54000 100644 --- a/backend/internal/models/auth.go +++ b/backend/internal/models/auth.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package models type Tokens struct { diff --git a/backend/internal/routes/router.go b/backend/internal/routes/router.go index abda7f2..c4c0cb4 100644 --- a/backend/internal/routes/router.go +++ b/backend/internal/routes/router.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package routes import ( diff --git a/backend/internal/routes/setup.go b/backend/internal/routes/setup.go index 3bfc0c0..5a1e8f7 100644 --- a/backend/internal/routes/setup.go +++ b/backend/internal/routes/setup.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package routes import ( diff --git a/backend/internal/services/auth.go b/backend/internal/services/auth.go index bec05fd..bccaa75 100644 --- a/backend/internal/services/auth.go +++ b/backend/internal/services/auth.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package services import ( diff --git a/backend/internal/services/setup.go b/backend/internal/services/setup.go index d93e5b0..5589100 100644 --- a/backend/internal/services/setup.go +++ b/backend/internal/services/setup.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package services import ( @@ -9,4 +26,3 @@ var Module = fx.Module("services", NewAuthService, ), ) - diff --git a/backend/internal/utils/db.go b/backend/internal/utils/db.go index 3c735b9..6ebcc09 100644 --- a/backend/internal/utils/db.go +++ b/backend/internal/utils/db.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package utils import ( diff --git a/backend/internal/utils/enums/enums.go b/backend/internal/utils/enums/enums.go index 1861b2e..ca5ccd9 100644 --- a/backend/internal/utils/enums/enums.go +++ b/backend/internal/utils/enums/enums.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package enums type ConfirmationCodeType int32 diff --git a/backend/internal/utils/jwt.go b/backend/internal/utils/jwt.go index 51abdaa..bf25213 100644 --- a/backend/internal/utils/jwt.go +++ b/backend/internal/utils/jwt.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package utils import ( diff --git a/backend/internal/utils/security.go b/backend/internal/utils/security.go index 2983f02..e4f968a 100644 --- a/backend/internal/utils/security.go +++ b/backend/internal/utils/security.go @@ -1,3 +1,20 @@ +// Copyright (c) 2025 Nikolai Papin +// +// This file is part of Easywish +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +// the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package utils import (