From e9b91ff4e30f5320b34326ae1cf2d7e8afdd7d16 Mon Sep 17 00:00:00 2001 From: Vasya Ryzhkoff Date: Sat, 27 Jul 2024 06:10:32 +0000 Subject: [PATCH] squashed Update dev_pipeline.yaml updated db settings cleaned up project Update Yuna.sln --- .gitea/workflows/dev_pipeline.yaml | 39 +- .idea/dataSources.xml | 7 + Db/_localhost-2024_07_27_12_51_02-dump.sql | 371 ------------------ Db/init.sql | Bin 0 -> 11210 bytes Yuna.OauthServer/Dockerfile | 24 -- .../Endpoints/Auth/AuthEndpoints.cs | 19 - .../Endpoints/Auth/DTO/AuthRequest.cs | 14 - .../Endpoints/Auth/DTO/AuthResponse.cs | 9 - Yuna.OauthServer/Model/Client.cs | 25 -- Yuna.OauthServer/Model/GrantType.cs | 5 - Yuna.OauthServer/Program.cs | 42 -- .../Properties/launchSettings.json | 40 -- Yuna.OauthServer/Storage/ClientsList.cs | 12 - Yuna.OauthServer/Yuna.OauthServer.csproj | 17 - Yuna.OauthServer/Yuna.OauthServer.http | 6 - Yuna.OauthServer/appsettings.Development.json | 8 - Yuna.OauthServer/appsettings.json | 9 - .../Yuna.Website.Server/GlobalSettings.json | 2 +- Yuna.sln | 8 +- 19 files changed, 20 insertions(+), 637 deletions(-) delete mode 100644 Db/_localhost-2024_07_27_12_51_02-dump.sql create mode 100644 Db/init.sql delete mode 100644 Yuna.OauthServer/Dockerfile delete mode 100644 Yuna.OauthServer/Endpoints/Auth/AuthEndpoints.cs delete mode 100644 Yuna.OauthServer/Endpoints/Auth/DTO/AuthRequest.cs delete mode 100644 Yuna.OauthServer/Endpoints/Auth/DTO/AuthResponse.cs delete mode 100644 Yuna.OauthServer/Model/Client.cs delete mode 100644 Yuna.OauthServer/Model/GrantType.cs delete mode 100644 Yuna.OauthServer/Program.cs delete mode 100644 Yuna.OauthServer/Properties/launchSettings.json delete mode 100644 Yuna.OauthServer/Storage/ClientsList.cs delete mode 100644 Yuna.OauthServer/Yuna.OauthServer.csproj delete mode 100644 Yuna.OauthServer/Yuna.OauthServer.http delete mode 100644 Yuna.OauthServer/appsettings.Development.json delete mode 100644 Yuna.OauthServer/appsettings.json diff --git a/.gitea/workflows/dev_pipeline.yaml b/.gitea/workflows/dev_pipeline.yaml index a74f527..3603c40 100644 --- a/.gitea/workflows/dev_pipeline.yaml +++ b/.gitea/workflows/dev_pipeline.yaml @@ -4,44 +4,27 @@ on: push: branches: - dev - jobs: BuildAndTest: runs-on: ubuntu-latest steps: - name: List Base info 👓 - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - run: echo "${{ gitea.workspace }} is a workspace folder" - + run: | + echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + echo "${{ gitea.workspace }} is a workspace folder" - name: Check out repo code 📝 - uses: actions/checkout@v3 - - - name: Set up PostgreSQL 🐘 - uses: postgres-actions/setup-postgres@v1 - with: - postgres-version: '15' - postgres-user: 'developer' - postgres-password: 'magazinchik_forever' - postgres-port: '5432' - - - name: Init db 📜 - env: - PGPSSWORD: magazinchik_forever - run: | - psql -h localhost -U developer -p 5432 -f ${{ gitea.workspace }}/Db/_localhost-2024_07_27_12_51_02-dump.sql - + uses: actions/checkout@v4 - name: Setup .NET 🛠️ uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' - + dotnet-version: "8.0.x" - name: Restore dependencies 🔪 run: dotnet restore - - name: Build debug app ☢️ - run: donet build -c Debug --no-restore - + run: | + dotnet build -c Debug --no-restore + cp ${{gitea.workspace}}/Yuna.Website/Yuna.Website.Server/GlobalSettings.json ${{gitea.workspace}}/Yuna.Tests/bin/Debug/net8.0/globalSettings.json - name: Run unit tests 💊 - run: dotnet test -c Debug --no-build \ No newline at end of file + run: dotnet test -c Debug --no-build diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index f4f086b..7b4948b 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -8,5 +8,12 @@ jdbc:postgresql://localhost:5432/ $ProjectFileDir$ + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://eva00.vasich:5432/postgres + $ProjectFileDir$ + \ No newline at end of file diff --git a/Db/_localhost-2024_07_27_12_51_02-dump.sql b/Db/_localhost-2024_07_27_12_51_02-dump.sql deleted file mode 100644 index 8e9245c..0000000 --- a/Db/_localhost-2024_07_27_12_51_02-dump.sql +++ /dev/null @@ -1,371 +0,0 @@ --- --- PostgreSQL database dump --- - --- Dumped from database version 15.2 --- Dumped by pg_dump version 15.2 - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- Name: Yuna; Type: DATABASE; Schema: -; Owner: developer --- - -CREATE DATABASE "Yuna" WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'Russian_Russia.1251'; - - -ALTER DATABASE "Yuna" OWNER TO developer; - -\connect "Yuna" - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - -SET default_tablespace = ''; - -SET default_table_access_method = heap; - --- --- Name: Yuna_Devices; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Yuna_Devices" ( - "Id" bigint NOT NULL, - "Name" character varying(128) NOT NULL, - "Description" character varying(255), - "DeviceUrl" character varying(255), - "UserId" bigint NOT NULL, - "IsDeleted" boolean DEFAULT false NOT NULL -); - - -ALTER TABLE public."Yuna_Devices" OWNER TO postgres; - --- --- Name: Yuna_Devices_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public."Yuna_Devices_Id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public."Yuna_Devices_Id_seq" OWNER TO postgres; - --- --- Name: Yuna_Devices_Id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public."Yuna_Devices_Id_seq" OWNED BY public."Yuna_Devices"."Id"; - - --- --- Name: Yuna_Props; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Yuna_Props" ( - "Id" bigint NOT NULL, - "Name" character varying(100) NOT NULL, - "MeasureName" character varying(255), - "JsonValueName" character varying(255), - "Type" smallint -); - - -ALTER TABLE public."Yuna_Props" OWNER TO postgres; - --- --- Name: Yuna_Props_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public."Yuna_Props_Id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public."Yuna_Props_Id_seq" OWNER TO postgres; - --- --- Name: Yuna_Props_Id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public."Yuna_Props_Id_seq" OWNED BY public."Yuna_Props"."Id"; - - --- --- Name: Yuna_Props_In_Devices; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Yuna_Props_In_Devices" ( - "Id" bigint NOT NULL, - "PropId" bigint NOT NULL, - "DeviceId" bigint NOT NULL -); - - -ALTER TABLE public."Yuna_Props_In_Devices" OWNER TO postgres; - --- --- Name: Yuna_Props_In_Devices_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public."Yuna_Props_In_Devices_Id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public."Yuna_Props_In_Devices_Id_seq" OWNER TO postgres; - --- --- Name: Yuna_Props_In_Devices_Id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public."Yuna_Props_In_Devices_Id_seq" OWNED BY public."Yuna_Props_In_Devices"."Id"; - - --- --- Name: Yuna_Users; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."Yuna_Users" ( - "Id" bigint NOT NULL, - "Username" character varying(32) NOT NULL, - "HashedPassword" character varying(255) NOT NULL, - "IsAdmin" boolean NOT NULL -); - - -ALTER TABLE public."Yuna_Users" OWNER TO postgres; - --- --- Name: Yuna_Users_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public."Yuna_Users_Id_seq" - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public."Yuna_Users_Id_seq" OWNER TO postgres; - --- --- Name: Yuna_Users_Id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public."Yuna_Users_Id_seq" OWNED BY public."Yuna_Users"."Id"; - - --- --- Name: Yuna_Devices Id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Devices" ALTER COLUMN "Id" SET DEFAULT nextval('public."Yuna_Devices_Id_seq"'::regclass); - - --- --- Name: Yuna_Props Id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Props" ALTER COLUMN "Id" SET DEFAULT nextval('public."Yuna_Props_Id_seq"'::regclass); - - --- --- Name: Yuna_Props_In_Devices Id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Props_In_Devices" ALTER COLUMN "Id" SET DEFAULT nextval('public."Yuna_Props_In_Devices_Id_seq"'::regclass); - - --- --- Name: Yuna_Users Id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Users" ALTER COLUMN "Id" SET DEFAULT nextval('public."Yuna_Users_Id_seq"'::regclass); - - --- --- Data for Name: Yuna_Devices; Type: TABLE DATA; Schema: public; Owner: postgres --- - -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (9, 'Test Device', 'Test descr', 'sdfsdfsdfsdf', 8, false); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (6, 'TenkiChan', 'Supa Weather', 'http://192.168.1.89/sensors', 8, false); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (3, 'Test Device', 'Test Description', 'Test Urldfg', 1, true); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (8, 'Test Devicedfgdfgdfgf', 'Test Description', 'Test Url11111111', 1, true); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (11, 'string', 'string', 'ffffffffffdgghfghfghfgfghfgfghfg', 8, true); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (12, 'Test Device', 'Test Description', 'Test Url', 1, true); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (13, 'Test Device', 'Test Description', 'Test Url', 1, true); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (10, 'string', 'string', 'fffdg', 8, true); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (4, 'Test Device', 'Nyanyanyadfgdfgfdgfdg', 'Test Urldfgdfgdfgdf', 1, false); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (1, 'strin111', 'strin', 'strindddd', 1, false); -INSERT INTO public."Yuna_Devices" ("Id", "Name", "Description", "DeviceUrl", "UserId", "IsDeleted") VALUES (14, 'Test Device', 'Test Description', 'Test Url', 1, false); - - --- --- Data for Name: Yuna_Props; Type: TABLE DATA; Schema: public; Owner: postgres --- - -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (1, 'test', 'test', 'test', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (2, 'test', 'test', 'test', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (3, 'Temp', 'C', 'string', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (4, 'string', 'string', 'string', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (5, 'strding', 'strding', 'strding', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (6, 'SupaTest', 'testing', 'sssss', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (7, 'test', 'test', 'test', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (8, 'Температура', '°C', 'temperature', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (9, 'Влажность', '%', 'humidity', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (10, 'Концентрация CO2', 'см³/м³', 'ppm', 0); -INSERT INTO public."Yuna_Props" ("Id", "Name", "MeasureName", "JsonValueName", "Type") VALUES (11, 'test', 'test', 'test', 0); - - --- --- Data for Name: Yuna_Props_In_Devices; Type: TABLE DATA; Schema: public; Owner: postgres --- - -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (1, 1, 1); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (21, 4, 1); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (22, 5, 1); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (32, 6, 1); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (39, 3, 1); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (40, 8, 6); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (41, 9, 6); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (42, 10, 6); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (43, 1, 9); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (44, 2, 9); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (45, 3, 9); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (46, 4, 9); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (47, 5, 10); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (48, 6, 10); -INSERT INTO public."Yuna_Props_In_Devices" ("Id", "PropId", "DeviceId") VALUES (49, 5, 11); - - --- --- Data for Name: Yuna_Users; Type: TABLE DATA; Schema: public; Owner: postgres --- - -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (1, 'asd1', '2', true); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (2, 'test', '123', false); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (3, 'test', '123', false); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (4, 'test', '123', false); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (5, 'test', '123', false); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (6, 'test', '123', false); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (8, 'test1', 'EbvfS/o9GSL7wkbnix+BzMpCLJqfWqeTgimj3u9CknA=', false); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (7, 'vasich', 'V64zSeugpX/I4ZSqot7K0NQBOGdMNYNclXButwoXasI=', true); -INSERT INTO public."Yuna_Users" ("Id", "Username", "HashedPassword", "IsAdmin") VALUES (9, 'test', '123', false); - - --- --- Name: Yuna_Devices_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public."Yuna_Devices_Id_seq"', 14, true); - - --- --- Name: Yuna_Props_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public."Yuna_Props_Id_seq"', 11, true); - - --- --- Name: Yuna_Props_In_Devices_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public."Yuna_Props_In_Devices_Id_seq"', 49, true); - - --- --- Name: Yuna_Users_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public."Yuna_Users_Id_seq"', 9, true); - - --- --- Name: Yuna_Devices Yuna_Devices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Devices" - ADD CONSTRAINT "Yuna_Devices_pkey" PRIMARY KEY ("Id"); - - --- --- Name: Yuna_Props_In_Devices Yuna_Props_In_Devices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Props_In_Devices" - ADD CONSTRAINT "Yuna_Props_In_Devices_pkey" PRIMARY KEY ("Id"); - - --- --- Name: Yuna_Props Yuna_Props_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Props" - ADD CONSTRAINT "Yuna_Props_pkey" PRIMARY KEY ("Id"); - - --- --- Name: Yuna_Users_index_1; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE UNIQUE INDEX "Yuna_Users_index_1" ON public."Yuna_Users" USING btree ("Id"); - - --- --- Name: Yuna_Props_In_Devices Yuna_Props_In_Devices_relation_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Props_In_Devices" - ADD CONSTRAINT "Yuna_Props_In_Devices_relation_2" FOREIGN KEY ("DeviceId") REFERENCES public."Yuna_Devices"("Id") ON DELETE CASCADE; - - --- --- Name: Yuna_Props_In_Devices Yuna_Props_In_Devices_relation_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Props_In_Devices" - ADD CONSTRAINT "Yuna_Props_In_Devices_relation_3" FOREIGN KEY ("PropId") REFERENCES public."Yuna_Props"("Id") ON DELETE CASCADE; - - --- --- Name: Yuna_Devices fk_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."Yuna_Devices" - ADD CONSTRAINT fk_user_id FOREIGN KEY ("UserId") REFERENCES public."Yuna_Users"("Id"); - - --- --- PostgreSQL database dump complete --- - diff --git a/Db/init.sql b/Db/init.sql new file mode 100644 index 0000000000000000000000000000000000000000..727de0333fd83cf0fbc528667aef7bc229664daf GIT binary patch literal 11210 zcmc&)dvFx>9bW{eHfW-}n37^~|%idPaPU7&Ugph!F&|B6RsKy4-~>lhNf4bXkKgxQ&AA z;?5XNpnnW?HAeBDX=uRYVsu3ft*Ga(W8r_h%j&i{T=R&Gn*ua+D*XBEeliq|FtJpS ziG||fNUWV~Br5{`riO|K3Nd|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glc8aQL-cjI!CWRKtFSB_PncSN{{?^v+cJf9fjY2^@!n#>9Z0m&TTeq8277*8wV?U>n6>-vJ`LaCKuJUfFcnS?w}huDw+KQNg9ZUMg`}r-e?{ z)`Y^_?=&92drxR%|LX)h&a!mpiGl7fuHQfS#M=Ioy*vMHyzh7WUs+SMZ|&QKXO0y4 ztOF*tcU#N-`+KiX=~(wczvX1fR?|*X!+ZVCSGs*IXNq*6H?}_CU39&r|8Vh*g8erJ reQUnaeY1nr?VI0n;`+3bt&JV)t{t?!@j%m0wr(vV7B94XjA{KJRTDWl literal 0 HcmV?d00001 diff --git a/Yuna.OauthServer/Dockerfile b/Yuna.OauthServer/Dockerfile deleted file mode 100644 index ec31acc..0000000 --- a/Yuna.OauthServer/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base -USER app -WORKDIR /app -EXPOSE 8080 - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["Yuna.OauthServer/Yuna.OauthServer.csproj", "Yuna.OauthServer/"] -RUN dotnet restore "./Yuna.OauthServer/Yuna.OauthServer.csproj" -COPY . . -WORKDIR "/src/Yuna.OauthServer" -RUN dotnet build "./Yuna.OauthServer.csproj" -c $BUILD_CONFIGURATION -o /app/build - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./Yuna.OauthServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Yuna.OauthServer.dll"] \ No newline at end of file diff --git a/Yuna.OauthServer/Endpoints/Auth/AuthEndpoints.cs b/Yuna.OauthServer/Endpoints/Auth/AuthEndpoints.cs deleted file mode 100644 index aaf7ec3..0000000 --- a/Yuna.OauthServer/Endpoints/Auth/AuthEndpoints.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Yuna.OauthServer.Endpoints.Auth.DTO; - -namespace Yuna.OauthServer.Endpoints.Auth -{ - public class AuthEndpoints - { - public void Define(WebApplication app) - { - app.MapGet("oauth/auth", Authorize) - } - - public IResult Authorize([AsParameters] AuthRequest request) - { - - } - - } -} diff --git a/Yuna.OauthServer/Endpoints/Auth/DTO/AuthRequest.cs b/Yuna.OauthServer/Endpoints/Auth/DTO/AuthRequest.cs deleted file mode 100644 index d984c57..0000000 --- a/Yuna.OauthServer/Endpoints/Auth/DTO/AuthRequest.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.AspNetCore.Components; -using System.Text.Json.Serialization; - -namespace Yuna.OauthServer.Endpoints.Auth.DTO -{ - - public class AuthRequest - { - public string response_type { get; set; } = null!; - public string client_id { get; set; } = null!; - public string redirect_uri { get; set; } = null!; - - } -} diff --git a/Yuna.OauthServer/Endpoints/Auth/DTO/AuthResponse.cs b/Yuna.OauthServer/Endpoints/Auth/DTO/AuthResponse.cs deleted file mode 100644 index 31934bf..0000000 --- a/Yuna.OauthServer/Endpoints/Auth/DTO/AuthResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Yuna.OauthServer.Endpoints.Auth.DTO -{ - public class AuthResponse - { - public string ResponseType { get;} = "code"; - public string Code { get; set; } = null!; - public string RedirectUri { get; set; } = null!; - } -} diff --git a/Yuna.OauthServer/Model/Client.cs b/Yuna.OauthServer/Model/Client.cs deleted file mode 100644 index c7fa1b8..0000000 --- a/Yuna.OauthServer/Model/Client.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Yuna.OauthServer.Model -{ - public class Client - { - - public Client(string clientName, int clientId, string secret, string clientUri, string redirectUri) - { - ClientName = clientName; - ClientId = clientId; - ClientSecret = secret; - ClientUri = clientUri; - RedirectUri = redirectUri; - } - - public string ClientName { get; set; } - public int ClientId { get; set; } - public string ClientSecret { get; set; } - //public string ClientType { get; set; } - //public List GrantType { get; set; } - public bool IsActive { get; set; } = false; - //public List AllowedScopes { get; set; } - public string? ClientUri { get; set; } - public string RedirectUri { get; set; } - } -} diff --git a/Yuna.OauthServer/Model/GrantType.cs b/Yuna.OauthServer/Model/GrantType.cs deleted file mode 100644 index 792a7ac..0000000 --- a/Yuna.OauthServer/Model/GrantType.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Text.Json.Serialization; - -namespace Yuna.OauthServer.Model -{ -} diff --git a/Yuna.OauthServer/Program.cs b/Yuna.OauthServer/Program.cs deleted file mode 100644 index 284b700..0000000 --- a/Yuna.OauthServer/Program.cs +++ /dev/null @@ -1,42 +0,0 @@ -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); - -var app = builder.Build(); - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -var summaries = new[] -{ - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" -}; - -app.MapGet("/weatherforecast", () => -{ - var forecast = Enumerable.Range(1, 5).Select(index => - new WeatherForecast - ( - DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - Random.Shared.Next(-20, 55), - summaries[Random.Shared.Next(summaries.Length)] - )) - .ToArray(); - return forecast; -}) -.WithName("GetWeatherForecast") -.WithOpenApi(); - -app.Run(); - -internal record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) -{ - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); -} diff --git a/Yuna.OauthServer/Properties/launchSettings.json b/Yuna.OauthServer/Properties/launchSettings.json deleted file mode 100644 index e715335..0000000 --- a/Yuna.OauthServer/Properties/launchSettings.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "profiles": { - "http": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5026" - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Container (Dockerfile)": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", - "environmentVariables": { - "ASPNETCORE_HTTP_PORTS": "8080" - }, - "publishAllPorts": true - } - }, - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:47304", - "sslPort": 0 - } - } -} \ No newline at end of file diff --git a/Yuna.OauthServer/Storage/ClientsList.cs b/Yuna.OauthServer/Storage/ClientsList.cs deleted file mode 100644 index 423ff30..0000000 --- a/Yuna.OauthServer/Storage/ClientsList.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Yuna.OauthServer.Model; - -namespace Yuna.OauthServer.Storage -{ - public class ClientsList - { - public List Clients = new() - { - new Client("yandex", 0, "5aS3dFgH7jK9lM1nO5pQrT",) - } - } -} diff --git a/Yuna.OauthServer/Yuna.OauthServer.csproj b/Yuna.OauthServer/Yuna.OauthServer.csproj deleted file mode 100644 index 6ee4f5c..0000000 --- a/Yuna.OauthServer/Yuna.OauthServer.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net8.0 - enable - enable - Linux - - - - - - - - - - diff --git a/Yuna.OauthServer/Yuna.OauthServer.http b/Yuna.OauthServer/Yuna.OauthServer.http deleted file mode 100644 index dddd241..0000000 --- a/Yuna.OauthServer/Yuna.OauthServer.http +++ /dev/null @@ -1,6 +0,0 @@ -@Yuna.OauthServer_HostAddress = http://localhost:5026 - -GET {{Yuna.OauthServer_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/Yuna.OauthServer/appsettings.Development.json b/Yuna.OauthServer/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/Yuna.OauthServer/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/Yuna.OauthServer/appsettings.json b/Yuna.OauthServer/appsettings.json deleted file mode 100644 index 10f68b8..0000000 --- a/Yuna.OauthServer/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/Yuna.Website/Yuna.Website.Server/GlobalSettings.json b/Yuna.Website/Yuna.Website.Server/GlobalSettings.json index 21855de..beaa1f3 100644 --- a/Yuna.Website/Yuna.Website.Server/GlobalSettings.json +++ b/Yuna.Website/Yuna.Website.Server/GlobalSettings.json @@ -7,7 +7,7 @@ }, "ConnectionStrings": { "BarcodeService": "http://localhost:7799/barcode", - "Db": "User ID=developer;Password=magazinchik_forever;Server=localhost;Port=5432;Database=Yuna;Pooling=true;IncludeErrorDetail=true;", + "Db": "User ID=developer;Password=vasich_dev_pg;Server=eva00.vasich;Port=5432;Database=Yuna;Pooling=true;IncludeErrorDetail=true;", "UserDb": "User ID=developer;Password=magazinchik_forever;Server=localhost;Port=5432;Database=UserKeeper;Pooling=true;", "RabbitMq": "host=localhost;username=guest;password=guest", "Redis": "localhost:5002" diff --git a/Yuna.sln b/Yuna.sln index fa874cd..8002359 100644 --- a/Yuna.sln +++ b/Yuna.sln @@ -3,13 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34607.119 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yuna.OauthServer", "Yuna.OauthServer\Yuna.OauthServer.csproj", "{28C99E60-5614-47D9-9640-CFF3F1B1A81F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yuna.Website.Server", "Yuna.Website\Yuna.Website.Server\Yuna.Website.Server.csproj", "{52C97D16-8D70-4E62-8038-A6137C5268E3}" EndProject Project("{54A90642-561A-4BB1-A94E-469ADEE60C69}") = "yuna.website.client", "Yuna.Website\yuna.website.client\yuna.website.client.esproj", "{12C022B1-3125-49DA-9E41-DD2FEAABBB11}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yuna.Tests", "Yuna.Tests\Yuna.Tests.csproj", "{47ECE6AC-C195-4EDF-B40C-AA44DBF8E107}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yuna.Tests", "Yuna.Tests\Yuna.Tests.csproj", "{47ECE6AC-C195-4EDF-B40C-AA44DBF8E107}" ProjectSection(ProjectDependencies) = postProject {52C97D16-8D70-4E62-8038-A6137C5268E3} = {52C97D16-8D70-4E62-8038-A6137C5268E3} EndProjectSection @@ -20,10 +18,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {28C99E60-5614-47D9-9640-CFF3F1B1A81F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28C99E60-5614-47D9-9640-CFF3F1B1A81F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28C99E60-5614-47D9-9640-CFF3F1B1A81F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28C99E60-5614-47D9-9640-CFF3F1B1A81F}.Release|Any CPU.Build.0 = Release|Any CPU {52C97D16-8D70-4E62-8038-A6137C5268E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {52C97D16-8D70-4E62-8038-A6137C5268E3}.Debug|Any CPU.Build.0 = Debug|Any CPU {52C97D16-8D70-4E62-8038-A6137C5268E3}.Release|Any CPU.ActiveCfg = Release|Any CPU