1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-26 00:33:03 +02:00

Add tests for users, slightly change API a bit

This commit is contained in:
binwiederhier 2023-05-15 10:42:24 -04:00
parent 4f4165f46f
commit f14f0aaa26
5 changed files with 181 additions and 16 deletions
server

View file

@ -251,13 +251,25 @@ type apiUserAddRequest struct {
// Do not add 'role' here. We don't want to add admins via the API.
}
type apiUserResponse struct {
Username string `json:"username"`
Role string `json:"role"`
Tier string `json:"tier,omitempty"`
Grants []*apiUserGrantResponse `json:"grants,omitempty"`
}
type apiUserGrantResponse struct {
Topic string `json:"topic"` // This may be a pattern
Permission string `json:"permission"`
}
type apiUserDeleteRequest struct {
Username string `json:"username"`
}
type apiAccessAllowRequest struct {
Username string `json:"username"`
Topic string `json:"topic"`
Topic string `json:"topic"` // This may be a pattern
Permission string `json:"permission"`
}