mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 09:57:47 +08:00
feat(security): harden gateway boundaries and usage policies
Consolidate subscription usage policy enforcement, privacy-safe persistence, and gateway security hardening into one reviewable change. Includes bounded HTTP and execution envelopes, header and protocol guards, DNS and relay validation, authentication and secret projection hardening, secure backup/install paths, and regression coverage.
This commit is contained in:
@@ -40,11 +40,13 @@ export interface SendVerificationCodeResponse {
|
||||
message: string
|
||||
success: boolean
|
||||
expire_minutes?: number
|
||||
verification_token: string
|
||||
}
|
||||
|
||||
export interface VerifyEmailRequest {
|
||||
email: string
|
||||
code: string
|
||||
verification_token: string
|
||||
}
|
||||
|
||||
export interface VerifyEmailResponse {
|
||||
@@ -54,6 +56,7 @@ export interface VerifyEmailResponse {
|
||||
|
||||
export interface VerificationStatusRequest {
|
||||
email: string
|
||||
verification_token: string
|
||||
}
|
||||
|
||||
export interface VerificationStatusResponse {
|
||||
@@ -72,6 +75,7 @@ export interface RegisterRequest {
|
||||
invite_code?: string
|
||||
privacy_policy_accepted?: boolean
|
||||
privacy_policy_version?: string
|
||||
email_verification_token?: string
|
||||
}
|
||||
|
||||
export interface RegisterResponse {
|
||||
@@ -141,7 +145,7 @@ export interface User {
|
||||
export const authApi = {
|
||||
async login(credentials: LoginRequest): Promise<LoginResponse> {
|
||||
const response = await apiClient.post<LoginResponse>('/api/auth/login', credentials)
|
||||
apiClient.setToken(response.data.access_token)
|
||||
apiClient.setToken(response.data.access_token, true)
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -184,10 +188,14 @@ export const authApi = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
async verifyEmail(email: string, code: string): Promise<VerifyEmailResponse> {
|
||||
async verifyEmail(
|
||||
email: string,
|
||||
code: string,
|
||||
verificationToken: string
|
||||
): Promise<VerifyEmailResponse> {
|
||||
const response = await apiClient.post<VerifyEmailResponse>(
|
||||
'/api/auth/verify-email',
|
||||
{ email, code }
|
||||
{ email, code, verification_token: verificationToken }
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
@@ -204,10 +212,13 @@ export const authApi = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
async getVerificationStatus(email: string): Promise<VerificationStatusResponse> {
|
||||
async getVerificationStatus(
|
||||
email: string,
|
||||
verificationToken: string
|
||||
): Promise<VerificationStatusResponse> {
|
||||
const response = await apiClient.post<VerificationStatusResponse>(
|
||||
'/api/auth/verification-status',
|
||||
{ email }
|
||||
{ email, verification_token: verificationToken }
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user