-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.api
More file actions
111 lines (101 loc) · 2.64 KB
/
Copy pathauth.api
File metadata and controls
111 lines (101 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
syntax = "v1"
info (
title: "Amazon Monitor Authentication API"
desc: "Authentication service for Amazon seller monitoring tool"
author: "Amazon Pilot Team"
email: "team@amazon-pilot.com"
version: "v1"
)
type (
// Auth requests and responses
LoginRequest {
Email string `json:"email"`
Password string `json:"password"`
}
LoginResponse {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"`
User User `json:"user"`
}
RegisterRequest {
Email string `json:"email"`
Password string `json:"password"`
CompanyName string `json:"company_name,optional"`
Plan string `json:"plan,default=basic"`
}
RegisterResponse {
Message string `json:"message"`
UserID string `json:"user_id"`
}
LogoutResponse {
Message string `json:"message"`
}
// User types
User {
ID string `json:"id"`
Email string `json:"email"`
CompanyName string `json:"company_name,omitempty"`
Plan string `json:"plan"`
IsActive bool `json:"is_active"`
CreatedAt string `json:"created_at"`
}
// Profile management
ProfileUpdateRequest {
CompanyName string `json:"company_name,optional"`
NotificationSettings *NotificationSettings `json:"notification_settings,optional"`
}
NotificationSettings {
Email bool `json:"email"`
Push bool `json:"push"`
}
ProfileUpdateResponse {
Message string `json:"message"`
}
ProfileResponse {
User User `json:"user"`
// Settings removed - not required by questions.md
}
// Health check responses
PingResponse {
Status string `json:"status"`
Message string `json:"message"`
Timestamp int64 `json:"timestamp"`
}
HealthResponse {
Service string `json:"service"`
Status string `json:"status"`
Version string `json:"version"`
Uptime int64 `json:"uptime"`
}
)
@server (
prefix: /api/auth
middleware: RateLimitMiddleware
)
service auth-api {
// Health check endpoints (no auth required)
@handler ping
get /ping returns (PingResponse)
@handler health
get /health returns (HealthResponse)
// Authentication endpoints
@handler login
post /login (LoginRequest) returns (LoginResponse)
@handler register
post /register (RegisterRequest) returns (RegisterResponse)
@handler logout
post /logout returns (LogoutResponse)
}
@server (
prefix: /api/auth
jwt: Auth
middleware: RateLimitMiddleware
)
service auth-api {
// Protected user profile endpoints (JWT required)
@handler getProfile
get /users/profile returns (ProfileResponse)
@handler updateProfile
put /users/profile (ProfileUpdateRequest) returns (ProfileUpdateResponse)
}