-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathauth.go
More file actions
40 lines (33 loc) · 1.18 KB
/
auth.go
File metadata and controls
40 lines (33 loc) · 1.18 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
package api
// AuthRegisterRequest is the definition of POST /v1/auth/register/.
type AuthRegisterRequest struct {
Username string `json:"username"`
Password string `json:"password"`
Email string `json:"email"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
}
// AuthLoginRequest is the definition of POST /v1/auth/login/.
type AuthLoginRequest struct {
Username string `json:"username"`
Password string `json:"password"`
}
// AuthLoginResponse is the definition of /v1/auth/login/.
type AuthLoginResponse tokenResponse
// AuthPasswdRequest is the definition of POST /v1/auth/passwd/.
type AuthPasswdRequest struct {
Username string `json:"username,omitempty"`
Password string `json:"password"`
NewPassword string `json:"new_password"`
}
// AuthRegenerateRequest is the definition of POST /v1/auth/tokens/.
type AuthRegenerateRequest struct {
Name string `json:"username,omitempty"`
All bool `json:"all,omitempty"`
}
// AuthRegenerateResponse is the definition of /v1/auth/tokens/.
type AuthRegenerateResponse tokenResponse
// A generic defenition of a token response.
type tokenResponse struct {
Token string `json:"token"`
}