Files
foxhunt/proto/auth.proto
jgrusewski 84877e5146 feat: add auth gRPC service + migrate dashboard from REST/WS to grpc-web
Backend (Rust):
- Create proto/auth.proto with Login and RefreshToken RPCs
- Implement AuthGrpcService in services/api with JWT issuance
- Register as unauthenticated service in main.rs (pre-auth)
- Update JWT issuer from foxhunt-api-gateway to foxhunt-api

Dashboard (TypeScript):
- Install @connectrpc/connect-web + @bufbuild/protobuf
- Generate TypeScript proto clients via buf (src/gen/)
- Create grpc.ts transport with JWT interceptor
- Rewrite all useApi hooks to typed gRPC calls
- Replace WebSocket with useGrpcStream server-streaming hooks
- Migrate all 6 pages + 6 components to grpc-web
- Delete api.ts, websocket.ts, useWebSocket.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:05:18 +01:00

36 lines
848 B
Protocol Buffer

syntax = "proto3";
package auth;
// Authentication service — token issuance and refresh.
// This service is exposed WITHOUT the auth interceptor (pre-authentication).
service AuthService {
// Authenticate with username/password, receive JWT tokens.
rpc Login(LoginRequest) returns (LoginResponse);
// Exchange a refresh token for a new access token.
rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse);
}
message LoginRequest {
string username = 1;
string password = 2;
}
message LoginResponse {
string access_token = 1;
string refresh_token = 2;
// Unix timestamp (seconds) when the access token expires.
int64 expires_at = 3;
}
message RefreshTokenRequest {
string refresh_token = 1;
}
message RefreshTokenResponse {
string access_token = 1;
string refresh_token = 2;
int64 expires_at = 3;
}