(ctx context.Context, httpClient *http.Client, managementEndpoints []string, username, password string)
| 2061 | } |
| 2062 | |
| 2063 | func cbRBACWhoAmI(ctx context.Context, httpClient *http.Client, managementEndpoints []string, username, password string) (response *WhoAmIResponse, statusCode int, err error) { |
| 2064 | statusCode, bodyResponse, err := doHTTPAuthRequest(ctx, httpClient, username, password, "GET", "/whoami", managementEndpoints, nil) |
| 2065 | if err != nil { |
| 2066 | return nil, http.StatusInternalServerError, err |
| 2067 | } |
| 2068 | |
| 2069 | if statusCode != http.StatusOK { |
| 2070 | return nil, statusCode, nil |
| 2071 | } |
| 2072 | |
| 2073 | err = base.JSONUnmarshal(bodyResponse, &response) |
| 2074 | if err != nil { |
| 2075 | return nil, http.StatusInternalServerError, err |
| 2076 | } |
| 2077 | |
| 2078 | return response, statusCode, nil |
| 2079 | } |
| 2080 | |
| 2081 | func CheckRoles(ctx context.Context, httpClient *http.Client, managementEndpoints []string, username, password string, requestedRoles []RouteRole, bucketName string) (statusCode int, err error) { |
| 2082 | whoAmIResults, statusCode, err := cbRBACWhoAmI(ctx, httpClient, managementEndpoints, username, password) |
no test coverage detected