External authentication support send url raw query

Do some dynamic authentication, such as token
This commit is contained in:
ShiBen
2022-01-11 11:21:18 +08:00
committed by Alessandro Ros
parent b8bf747796
commit e3f63a43c9
6 changed files with 21 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ func externalAuth(
password string,
path string,
action string,
query string,
) error {
enc, _ := json.Marshal(struct {
IP string `json:"ip"`
@@ -21,12 +22,14 @@ func externalAuth(
Password string `json:"password"`
Path string `json:"path"`
Action string `json:"action"`
Query string `json:"query"`
}{
IP: ip,
User: user,
Password: password,
Path: path,
Action: action,
Query: query,
})
res, err := http.Post(ur, "application/json", bytes.NewReader(enc))
if err != nil {