add subjectaccessreviews resource
This commit is contained in:
@@ -2328,6 +2328,26 @@ __EOF__
|
||||
kubectl create -f test/fixtures/pkg/kubectl/cmd/create/tokenreview.json --validate=false
|
||||
|
||||
|
||||
|
||||
########################
|
||||
# authorization.k8s.io #
|
||||
########################
|
||||
|
||||
# check remote authorization endpoint, kubectl doesn't actually display the returned object so this isn't super useful
|
||||
# but it proves that works
|
||||
kubectl create -f test/fixtures/pkg/kubectl/cmd/create/sar.json --validate=false
|
||||
|
||||
SAR_RESULT_FILE="${KUBE_TEMP}/sar-result.json"
|
||||
curl -k -H "Content-Type:" http://localhost:8080/apis/authorization.k8s.io/v1beta1/subjectaccessreviews -XPOST -d @test/fixtures/pkg/kubectl/cmd/create/sar.json > "${SAR_RESULT_FILE}"
|
||||
if grep -q '"allowed": true' "${SAR_RESULT_FILE}"; then
|
||||
kube::log::status "\"authorization.k8s.io/subjectaccessreviews\" returns as expected: $(cat "${SAR_RESULT_FILE}")"
|
||||
else
|
||||
kube::log::status "\"authorization.k8s.io/subjectaccessreviews\" does not return as expected: $(cat "${SAR_RESULT_FILE}")"
|
||||
exit 1
|
||||
fi
|
||||
rm "${SAR_RESULT_FILE}"
|
||||
|
||||
|
||||
#####################
|
||||
# Retrieve multiple #
|
||||
#####################
|
||||
|
Reference in New Issue
Block a user