mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
Accept simpler response from OPA (#7637)
This commit is contained in:
parent
3eb7a8bde8
commit
502456db91
@ -123,14 +123,12 @@ func (o *Opa) IsAllowed(args Args) bool {
|
|||||||
|
|
||||||
// Handle OPA response
|
// Handle OPA response
|
||||||
type opaResponse struct {
|
type opaResponse struct {
|
||||||
Result struct {
|
Allow bool `json:"allow"`
|
||||||
Allow bool `json:"allow"`
|
|
||||||
} `json:"result"`
|
|
||||||
}
|
}
|
||||||
var result opaResponse
|
var result opaResponse
|
||||||
if err = json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
if err = json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.Result.Allow
|
return result.Allow
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user