mirror of https://github.com/minio/minio.git
Update IAM access manager plugin demo (#19007)
Now prints the JSON payload for easier debugging.
This commit is contained in:
parent
e104b183d8
commit
a29c66ed74
|
@ -21,6 +21,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
|
@ -58,6 +59,10 @@ func mainHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
var out bytes.Buffer
|
||||
json.Indent(&out, body, "", " ")
|
||||
fmt.Printf("Received JSON payload:\n%s\n", out.String())
|
||||
|
||||
reqMap := make(map[string]interface{})
|
||||
err = json.Unmarshal(body, &reqMap)
|
||||
if err != nil {
|
||||
|
@ -65,8 +70,6 @@ func mainHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
// fmt.Printf("request: %#v\n", reqMap)
|
||||
|
||||
m := reqMap["input"].(map[string]interface{})
|
||||
accountValue := m["account"].(string)
|
||||
actionValue := m["action"].(string)
|
||||
|
|
Loading…
Reference in New Issue