authentication/struct.go

80 lines
1.9 KiB
Go
Raw Normal View History

2022-05-23 07:04:01 +00:00
package authentication
2022-05-24 03:14:51 +00:00
import (
"github.com/Selly-Modules/natsio"
)
// Staff ...
type Staff struct {
Reference string `json:"reference"` // ObjectID
Name string `json:"name"`
2022-05-26 02:30:35 +00:00
Email string `json:"email"`
Phone string `json:"phone"`
Active bool `json:"active"`
IsRoot bool `json:"isRoot"`
Permissions []string `json:"permissions"`
Source string `json:"source"`
2022-05-24 03:14:51 +00:00
}
// ListStaff ...
type ListStaff struct {
Staffs []Staff `json:"staffs"`
}
2022-05-23 07:04:01 +00:00
// Config int client elasticsearch
type Config struct {
ApiKey string
Nats natsio.Config
}
// StaffCheckPermissionBody ...
type StaffCheckPermissionBody struct {
StaffID string `json:"staffId"`
2022-05-26 03:25:43 +00:00
Token string `json:"token"`
2022-05-26 14:33:30 +00:00
Permission []string `json:"permission"`
Action string `json:"action"`
Source string `json:"source"`
Code string `json:"code,omitempty"`
Payload PayloadCheckPermission `json:"payload"`
2022-05-26 03:25:43 +00:00
IsRoot string `json:"isRoot"`
}
// PayloadCheckPermission ...
type PayloadCheckPermission struct {
URL string `json:"url"`
Body string `json:"body"`
Method string `json:"method"`
2022-05-23 07:04:01 +00:00
}
// StaffCheckPermissionResponse ...
type StaffCheckPermissionResponse struct {
Message string `json:"message"`
IsValid bool `json:"isValid"`
}
// StaffGetPermissions ...
type StaffGetPermissions struct {
StaffID string `json:"staffId"`
Source string `json:"source"`
2022-05-26 02:30:35 +00:00
Prefix string `json:"prefix"`
2022-05-23 07:04:01 +00:00
}
// StaffGetPermissionsResponse ...
type StaffGetPermissionsResponse struct {
Permissions []string `json:"permissions"`
}
// RequestBody ...
type RequestBody struct {
Body []byte `json:"body"`
ApiKey string `json:"apiKey"`
}
// Response
// response to service es
type Response struct {
Success bool `json:"success"`
Data []byte `json:"data,omitempty"`
Message string `json:"message"`
}