-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: NetCore-Library | ||
|
||
# Run this workflow every time a new commit pushed to your repository | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/heads | ||
branches: | ||
# Push events on main branch | ||
- master | ||
- develop | ||
|
||
jobs: | ||
# Set the job key. The key is displayed as the job name | ||
# when a job name is not provided | ||
build-and-publish: | ||
# Name the Job | ||
name: Build and Publish Library | ||
# Set the type of machine to run on | ||
runs-on: ubuntu-latest | ||
env: | ||
MAINAPP_ASP_PROJECT_PATH: "src/Monq.Core.Authorization.Models" | ||
|
||
steps: | ||
# Checks out a copy of your repository on the ubuntu-latest machine | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: | | ||
dotnet build -c Release --no-restore | ||
echo "APP_VERSION=v$(cat ${MAINAPP_ASP_PROJECT_PATH}/*.csproj | grep '<Version>' | head -n 1 | awk -F '>' '{print $2;}' | awk -F '<' '{print $1;}' | sed 's/\-\*//g')" >> $GITHUB_ENV | ||
- name: Test | ||
if: env.TEST_MAINAPP_ASP_PROJECT_PATH | ||
run: | | ||
dotnet add $TEST_MAINAPP_ASP_PROJECT_PATH package coverlet.msbuild --version ${coverletMsbuildVersion:-3.0.3} > /dev/null 2>&1 | ||
dotnet test $TEST_MAINAPP_ASP_PROJECT_PATH -c Release --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../../build_report/opencover.xml | ||
- name: Pack Alpha | ||
if: github.ref == 'refs/heads/develop' | ||
run: dotnet pack -c Release --no-restore $MAINAPP_ASP_PROJECT_PATH -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg --version-suffix "rev-$GITHUB_RUN_ID" | ||
- name: Pack Release | ||
if: github.ref == 'refs/heads/master' | ||
run: dotnet pack -c Release --no-restore $MAINAPP_ASP_PROJECT_PATH -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | ||
- name: Publish | ||
run: | ||
dotnet nuget push $MAINAPP_ASP_PROJECT_PATH/bin/Release/*.nupkg -k $NUGET_TOKEN -s $NUGET_SERVER | ||
env: | ||
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} | ||
NUGET_SERVER: "https://api.nuget.org/v3/index.json" | ||
- name: Create GitHub Release | ||
if: github.ref == 'refs/heads/master' | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.APP_VERSION }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/.project | ||
/.vs/ | ||
**/bin/ | ||
**/obj/ | ||
**/artifacts/ | ||
**/project.lock.json | ||
**/appsettings.Development.json | ||
**/.vscode/ | ||
**/wwwroot/lib/ | ||
**/*.xproj.user | ||
**/*.csproj.user | ||
**/aspnet_consul_config.json | ||
.cr/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29424.173 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1180E82B-E9A6-456F-926B-83D257A393EB}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6D276C85-729F-4862-8924-F83D1A0095DE}" | ||
ProjectSection(SolutionItems) = preProject | ||
.gitignore = .gitignore | ||
README.md = README.md | ||
EndProjectSection | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monq.Core.Authorization.Models", "src\Monq.Core.Authorization.Models\Monq.Core.Authorization.Models.csproj", "{34F2024A-57C0-41BB-9BA5-307857D66B6E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{34F2024A-57C0-41BB-9BA5-307857D66B6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{34F2024A-57C0-41BB-9BA5-307857D66B6E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{34F2024A-57C0-41BB-9BA5-307857D66B6E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{34F2024A-57C0-41BB-9BA5-307857D66B6E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{34F2024A-57C0-41BB-9BA5-307857D66B6E} = {1180E82B-E9A6-456F-926B-83D257A393EB} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5EB4907A-C897-4574-AF52-082D1261961A} | ||
EndGlobalSection | ||
EndGlobal |
30 changes: 30 additions & 0 deletions
30
src/Monq.Core.Authorization.Models/Monq.Core.Authorization.Models.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Version>5.0</Version> | ||
<VersionSuffix>$(VersionSuffix)</VersionSuffix> | ||
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version> | ||
<IsPackable>true</IsPackable> | ||
<TargetFrameworks>net5.0</TargetFrameworks> | ||
<Authors>Dmitry Fokin</Authors> | ||
<Company>MONQ Digital lab</Company> | ||
<Title>Monq.Core.Authorization.Models</Title> | ||
<PackageId>Monq.Core.Authorization.Models</PackageId> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PackageTags>library monq abstract model</PackageTags> | ||
<PackageProjectUrl>https://github.com/MONQDL/Monq.Core.Authorization.Models</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/MONQDL/Monq.Core.Authorization.Models</RepositoryUrl> | ||
<Description>Models library for the Monq.Core.Authorization library.</Description> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>9.0</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
31 changes: 31 additions & 0 deletions
31
src/Monq.Core.Authorization.Models/PacketOwnerViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Monq.Core.Authorization.Models | ||
{ | ||
/// <summary> | ||
/// Модель представления владельцев пакета пользовательских прав. | ||
/// </summary> | ||
public sealed class PacketOwnerViewModel | ||
{ | ||
/// <summary> | ||
/// Идентификатор пакета прав. | ||
/// </summary> | ||
public long PacketId { get; set; } | ||
|
||
/// <summary> | ||
/// Идентификатор рабочей группы-владельца пакета. | ||
/// </summary> | ||
public long WorkGroupId { get; set; } | ||
|
||
/// <summary> | ||
/// Идентификатор пользовательского пространства. | ||
/// </summary> | ||
public long UserspaceId { get; set; } | ||
|
||
/// <summary> | ||
/// Коллекция идентификаторов пользователей пакета. | ||
/// </summary> | ||
public IEnumerable<long> Users { get; set; } = Array.Empty<long>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Monq.Core.Authorization.Models | ||
{ | ||
/// <summary> | ||
/// Тип пакета. | ||
/// </summary> | ||
public enum PacketTypes | ||
{ | ||
/// <summary> | ||
/// Администратор пространства. | ||
/// </summary> | ||
UserspaceAdmin, | ||
|
||
/// <summary> | ||
/// Пользователь пространства. | ||
/// </summary> | ||
UserspaceUser, | ||
|
||
/// <summary> | ||
/// Менеджер РГ. | ||
/// </summary> | ||
WorkgroupManager, | ||
|
||
/// <summary> | ||
/// Пользователь РГ. | ||
/// </summary> | ||
WorkgroupUser, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Monq.Core.Authorization.Models | ||
{ | ||
/// <summary> | ||
/// Модель представления пакета пользовательских прав. | ||
/// </summary> | ||
public sealed class PacketViewModel | ||
{ | ||
/// <summary> | ||
/// Идентификатор пакета пользовательских прав. | ||
/// </summary> | ||
public long Id { get; set; } | ||
|
||
/// <summary> | ||
/// Имя пакета пользовательских прав. | ||
/// </summary> | ||
[NotNull] | ||
public string Name { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// Описание пакета пользовательских прав. | ||
/// </summary> | ||
public string? Description { get; set; } | ||
|
||
/// <summary> | ||
/// Является ли пакет доступным только для чтения. | ||
/// </summary> | ||
public bool IsReadOnly { get; set; } | ||
|
||
/// <summary> | ||
/// Коллекция прав доступа пакета. | ||
/// </summary> | ||
public IEnumerable<string> Grants { get; set; } = Array.Empty<string>(); | ||
|
||
/// <summary> | ||
/// Коллекция владельцев пакета. | ||
/// </summary> | ||
public IEnumerable<PacketOwnerViewModel> Owners { get; set; } = Array.Empty<PacketOwnerViewModel>(); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Monq.Core.Authorization.Models/SystemPacketMapViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Monq.Core.Authorization.Models | ||
{ | ||
/// <summary> | ||
/// Представление модели соответствия системных пакетов прав. | ||
/// </summary> | ||
public sealed class SystemPacketMapViewModel | ||
{ | ||
/// <summary> | ||
/// Идентификатор записи соответствия. | ||
/// </summary> | ||
public long Id { get; set; } | ||
|
||
/// <summary> | ||
/// Идентификатор пространства. | ||
/// </summary> | ||
public long UserspaceId { get; set; } | ||
|
||
/// <summary> | ||
/// Идентификатор системного пакета. | ||
/// </summary> | ||
public long PacketId { get; set; } | ||
|
||
/// <summary> | ||
/// Тип пакета. | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public PacketTypes PacketType { get; set; } | ||
} | ||
} |