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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -58,6 +59,10 @@ func mainHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var out bytes.Buffer
|
||||||
|
json.Indent(&out, body, "", " ")
|
||||||
|
fmt.Printf("Received JSON payload:\n%s\n", out.String())
|
||||||
|
|
||||||
reqMap := make(map[string]interface{})
|
reqMap := make(map[string]interface{})
|
||||||
err = json.Unmarshal(body, &reqMap)
|
err = json.Unmarshal(body, &reqMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -65,8 +70,6 @@ func mainHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// fmt.Printf("request: %#v\n", reqMap)
|
|
||||||
|
|
||||||
m := reqMap["input"].(map[string]interface{})
|
m := reqMap["input"].(map[string]interface{})
|
||||||
accountValue := m["account"].(string)
|
accountValue := m["account"].(string)
|
||||||
actionValue := m["action"].(string)
|
actionValue := m["action"].(string)
|
||||||
|
|
Loading…
Reference in New Issue