Compare commits
4 Commits
6f17b5918f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f2d0041e4 | |||
| ef7099b75e | |||
| 736326fce4 | |||
| c6c04814b0 |
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
flake-profile-1-link
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
/nix/store/vzln48bkbr09fm9rzgqm8jcqdyyr4lzg-dotnet-fhs-shell-shell-env-env
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# EditorConfig for .NET template
|
||||||
|
root = true
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
+6
-1
@@ -2,4 +2,9 @@ bin/
|
|||||||
obj/
|
obj/
|
||||||
/packages/
|
/packages/
|
||||||
riderModule.iml
|
riderModule.iml
|
||||||
/_ReSharper.Caches/
|
/_ReSharper.Caches/
|
||||||
|
|
||||||
|
# SQLite database files
|
||||||
|
*.db
|
||||||
|
*.db-shm
|
||||||
|
*.db-wal
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.4.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-added-large-files
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
Thank you for considering contributing!
|
||||||
|
|
||||||
|
- Please follow the project coding style and directory structure.
|
||||||
|
- Submit issues or pull requests for bugs, features, or improvements.
|
||||||
|
- Add tests for new features where possible.
|
||||||
|
- Ensure your code builds and passes tests before submitting.
|
||||||
|
- Contributions are licensed under CC BY-SA 4.0.
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="DBE_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
Generated
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="app.db" uuid="46f3a414-1ab6-4e0f-a868-e42e9befde11">
|
||||||
|
<driver-ref>sqlite.xerial</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/app.db</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredIdentifiers">
|
||||||
|
<list>
|
||||||
|
<option value="neopixel" />
|
||||||
|
<option value="board" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/DBProject.iml" filepath="$PROJECT_DIR$/.idea/DBProject.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
Creative Commons Attribution-ShareAlike 4.0 International
|
||||||
|
|
||||||
|
<https://creativecommons.org/licenses/by-sa/4.0/>
|
||||||
|
|
||||||
|
You are free to:
|
||||||
|
|
||||||
|
- Share — copy and redistribute the material in any medium or format
|
||||||
|
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||||
|
|
||||||
|
Under the following terms:
|
||||||
|
|
||||||
|
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
|
||||||
|
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
|
||||||
|
|
||||||
|
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||||
|
|
||||||
|
See the full license at the link above.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Makefile for .NET template
|
||||||
|
.PHONY: build run clean
|
||||||
|
|
||||||
|
build:
|
||||||
|
dotnet build
|
||||||
|
|
||||||
|
run:
|
||||||
|
dotnet run
|
||||||
|
|
||||||
|
clean:
|
||||||
|
dotnet clean
|
||||||
|
|
||||||
|
|
||||||
|
# Flatpak build target
|
||||||
|
.PHONY: flatpak-build
|
||||||
|
flatpak-build:
|
||||||
|
flatpak-builder --force-clean build-flatpak flatpak/app.flatpak.json
|
||||||
+4
-2
@@ -2,6 +2,8 @@
|
|||||||
<Folder Name="/Solution Items/">
|
<Folder Name="/Solution Items/">
|
||||||
<File Path="compose.yaml" />
|
<File Path="compose.yaml" />
|
||||||
</Folder>
|
</Folder>
|
||||||
<Project Path="PolyComm/PolyComm.Client/PolyComm.Client.csproj" />
|
<Project Path="PolyComm.Client/PolyComm.Client.csproj" />
|
||||||
<Project Path="PolyComm/PolyComm/PolyComm.csproj" />
|
<Project Path="PolyComm/PolyComm.csproj" />
|
||||||
|
<Documentation Path="docs"/>
|
||||||
|
|
||||||
</Solution>
|
</Solution>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,14 +0,0 @@
|
|||||||
@page "/auth"
|
|
||||||
|
|
||||||
@using Microsoft.AspNetCore.Authorization
|
|
||||||
|
|
||||||
@attribute [Authorize]
|
|
||||||
@rendermode InteractiveAuto
|
|
||||||
|
|
||||||
<PageTitle>Auth</PageTitle>
|
|
||||||
|
|
||||||
<h1>You are authenticated</h1>
|
|
||||||
|
|
||||||
<AuthorizeView>
|
|
||||||
Hello @context.User.Identity?.Name!
|
|
||||||
</AuthorizeView>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
@page "/counter"
|
|
||||||
@rendermode InteractiveAuto
|
|
||||||
|
|
||||||
<PageTitle>Counter</PageTitle>
|
|
||||||
|
|
||||||
<h1>Counter</h1>
|
|
||||||
|
|
||||||
<p role="status">Current count: @currentCount</p>
|
|
||||||
|
|
||||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private int currentCount = 0;
|
|
||||||
|
|
||||||
private void IncrementCount()
|
|
||||||
{
|
|
||||||
currentCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using System.Security.Claims;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
|
||||||
|
|
||||||
namespace Polycomm.Client;
|
|
||||||
|
|
||||||
// This is a client-side AuthenticationStateProvider that determines the user's authentication state by
|
|
||||||
// looking for data persisted in the page when it was rendered on the server. This authentication state will
|
|
||||||
// be fixed for the lifetime of the WebAssembly application. So, if the user needs to log in or out, a full
|
|
||||||
// page reload is required.
|
|
||||||
//
|
|
||||||
// This only provides a user name and email for display purposes. It does not actually include any tokens
|
|
||||||
// that authenticate to the server when making subsequent requests. That works separately using a
|
|
||||||
// cookie that will be included on HttpClient requests to the server.
|
|
||||||
internal class PersistentAuthenticationStateProvider : AuthenticationStateProvider
|
|
||||||
{
|
|
||||||
private static readonly Task<AuthenticationState> defaultUnauthenticatedTask =
|
|
||||||
Task.FromResult(new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity())));
|
|
||||||
|
|
||||||
private readonly Task<AuthenticationState> authenticationStateTask = defaultUnauthenticatedTask;
|
|
||||||
|
|
||||||
public PersistentAuthenticationStateProvider(PersistentComponentState state)
|
|
||||||
{
|
|
||||||
if (!state.TryTakeFromJson<UserInfo>(nameof(UserInfo), out var userInfo) || userInfo is null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Claim[] claims = [
|
|
||||||
new Claim(ClaimTypes.NameIdentifier, userInfo.UserId),
|
|
||||||
new Claim(ClaimTypes.Name, userInfo.Email),
|
|
||||||
new Claim(ClaimTypes.Email, userInfo.Email) ];
|
|
||||||
|
|
||||||
authenticationStateTask = Task.FromResult(
|
|
||||||
new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity(claims,
|
|
||||||
authenticationType: nameof(PersistentAuthenticationStateProvider)))));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Task<AuthenticationState> GetAuthenticationStateAsync() => authenticationStateTask;
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
|
||||||
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.27" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.27" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user