update dockerfile + wip passkey implementation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>9ffcc706-7f1b-48e3-bf30-eab69a90fded</UserSecretsId>
|
||||
@@ -9,6 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fido2" Version="4.0.0" />
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.71.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.72.0">
|
||||
@@ -33,6 +34,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="Proto\Aoba.proto"></Protobuf>
|
||||
<Protobuf Include="Proto\Account.proto" />
|
||||
<Protobuf Include="Proto\Auth.proto"></Protobuf>
|
||||
<Protobuf Include="Proto\Metrics.proto"></Protobuf>
|
||||
<Protobuf Include="Proto\Types.proto"></Protobuf>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
ARG NET_VERSION="10.0"
|
||||
ARG DX_VERSION="0.7.3"
|
||||
|
||||
# Client Side build - prep deps
|
||||
FROM rust:1 AS chef
|
||||
FROM rust:1-trixie AS chef
|
||||
RUN rustup target add wasm32-unknown-unknown
|
||||
RUN cargo install cargo-chef
|
||||
WORKDIR /app
|
||||
@@ -22,7 +25,8 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg
|
||||
|
||||
# Install `dx`
|
||||
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
RUN cargo binstall dioxus-cli@0.7.2 --root /.cargo -y --force
|
||||
ARG DX_VERSION
|
||||
RUN cargo binstall dioxus-cli@${DX_VERSION} --root /.cargo -y --force
|
||||
ENV PATH="/.cargo/bin:$PATH"
|
||||
ARG VERSION
|
||||
ENV APP_VERSION=$VERSION
|
||||
@@ -31,7 +35,7 @@ RUN dx bundle --release --platform web
|
||||
|
||||
# Server Build
|
||||
# This stage is used when running from VS in fast mode (Default for Debug configuration)
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:${NET_VERSION} AS base
|
||||
RUN apt-get update && apt-get install -y ffmpeg #libvips libvips-tools
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
@@ -39,11 +43,11 @@ EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
# This stage is used to build the service project
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:${NET_VERSION}-noble AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["AobaServer/AobaServer.csproj", "AobaServer/"]
|
||||
RUN dotnet restore "./AobaServer/AobaServer.csproj"
|
||||
RUN dotnet restore "/src/AobaServer/AobaServer.csproj"
|
||||
COPY . .
|
||||
# Copy Built bundle from client builder
|
||||
COPY --from=client-builder /app/AobaClient/target/dx/aoba-client/release/web/public /src/AobaServer/wwwroot
|
||||
|
||||
13
AobaServer/Proto/Account.proto
Normal file
13
AobaServer/Proto/Account.proto
Normal file
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option csharp_namespace = "Aoba.RPC.Account";
|
||||
package aoba;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "Proto/Types.proto";
|
||||
|
||||
service AccountRpc {
|
||||
rpc RegisterPasskey(google.protobuf.Empty) returns (PasskeyRegistrationCreds);
|
||||
rpc CompletePasskeyRegistration(PasskeyPublicKey) returns (google.protobuf.Empty);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import "Proto/Types.proto";
|
||||
|
||||
service AuthRpc {
|
||||
rpc Login(Credentials) returns (LoginResponse);
|
||||
rpc LoginPasskey(PassKeyPayload) returns (LoginResponse);
|
||||
rpc LoginPasskey(PasskeyPayload) returns (LoginResponse);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ message Credentials{
|
||||
string password = 2;
|
||||
}
|
||||
|
||||
message PassKeyPayload {
|
||||
|
||||
}
|
||||
|
||||
|
||||
message Jwt{
|
||||
@@ -110,4 +108,15 @@ message SearchQuery {
|
||||
message Filter {
|
||||
string key = 1;
|
||||
repeated string values = 2;
|
||||
}
|
||||
|
||||
message PasskeyPayload {
|
||||
|
||||
}
|
||||
|
||||
message PasskeyRegistrationCreds{
|
||||
|
||||
}
|
||||
message PasskeyPublicKey{
|
||||
|
||||
}
|
||||
22
AobaServer/Services/AccountRpcService.cs
Normal file
22
AobaServer/Services/AccountRpcService.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Aoba.RPC;
|
||||
using Aoba.RPC.Account;
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
using Grpc.Core;
|
||||
|
||||
namespace AobaServer.Services;
|
||||
|
||||
public class AccountRpcService : AccountRpc.AccountRpcBase
|
||||
{
|
||||
public override Task<PasskeyRegistrationCreds> RegisterPasskey(Empty request, ServerCallContext context)
|
||||
{
|
||||
return base.RegisterPasskey(request, context);
|
||||
}
|
||||
|
||||
public override Task<Empty> CompletePasskeyRegistration(PasskeyPublicKey request, ServerCallContext context)
|
||||
{
|
||||
return base.CompletePasskeyRegistration(request, context);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user