-
Notifications
You must be signed in to change notification settings - Fork 4.7k
add what-can-i-do endpoint #8675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The call returns policy rules. So PolicyRulesReview or SubjectRulesReview On Thu, Apr 28, 2016 at 4:40 PM, David Eads [email protected]
|
|
Yeah those make sense. On Thu, Apr 28, 2016 at 5:13 PM, David Eads [email protected]
|
58e13c2
to
3a03dfd
Compare
@smarterclayton updated to @pweil- got a reviewer in mind? |
@sgallagher you're interested in RESTStorage, clients, and cli commands, right? :) |
[test] |
@sgallagher loves this kind of stuff 😄 @sdminonne if you have some time since this is probably similar to the SCC checks you're looking at. |
Evaluated for origin test up to 257ecaa |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3521/) |
Request: {"kind":"SelfSubjectRulesReview","apiVersion":"v1","status":{"rules":null}} Response {
"kind": "SelfSubjectRulesReview",
"apiVersion": "v1",
"status": {
"rules": [{
"verbs": ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"],
"attributeRestrictions": null,
"apiGroups": [""],
"resources": ["configmaps", "endpoints", "persistentvolumeclaims", "pods", "pods/attach", "pods/exec", "pods/log", "pods/portforward", "pods/proxy", "replicationcontrollers", "replicationcontrollers/scale", "secrets", "serviceaccounts", "services", "services/proxy"]
}, {
"verbs": ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"],
"attributeRestrictions": null,
"apiGroups": [""],
"resources": ["buildconfigs", "buildconfigs/instantiate", "buildconfigs/instantiatebinary", "buildconfigs/webhooks", "buildlogs", "builds", "builds/clone", "builds/log", "deploymentconfigrollbacks", "deploymentconfigs", "deploymentconfigs/log", "deploymentconfigs/scale", "deployments", "generatedeploymentconfigs", "imagestreamimages", "imagestreamimports", "imagestreammappings", "imagestreams", "imagestreams/secrets", "imagestreamtags", "localresourceaccessreviews", "localsubjectaccessreviews", "processedtemplates", "projects", "resourceaccessreviews", "rolebindings", "roles", "routes", "subjectaccessreviews", "templateconfigs", "templates"]
}, {
"verbs": ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"],
"attributeRestrictions": null,
"apiGroups": ["autoscaling"],
"resources": ["horizontalpodautoscalers"]
}, {
"verbs": ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"],
"attributeRestrictions": null,
"apiGroups": ["batch"],
"resources": ["jobs"]
}, {
"verbs": ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"],
"attributeRestrictions": null,
"apiGroups": ["extensions"],
"resources": ["horizontalpodautoscalers", "jobs", "replicationcontrollers/scale"]
}, {
"verbs": ["get", "list", "watch"],
"attributeRestrictions": null,
"apiGroups": ["extensions"],
"resources": ["daemonsets"]
}, {
"verbs": ["get", "list", "watch"],
"attributeRestrictions": null,
"apiGroups": null,
"resources": ["bindings", "configmaps", "endpoints", "events", "imagestreams/status", "limitranges", "minions", "namespaces", "namespaces/status", "nodes", "persistentvolumeclaims", "persistentvolumes", "pods", "pods/log", "pods/status", "policies", "policybindings", "replicationcontrollers", "replicationcontrollers/status", "resourcequotas", "resourcequotas/status", "resourcequotausages", "routes/status", "securitycontextconstraints", "serviceaccounts", "services"]
}, {
"verbs": ["get", "update"],
"attributeRestrictions": null,
"apiGroups": null,
"resources": ["imagestreams/layers"]
}, {
"verbs": ["update"],
"attributeRestrictions": null,
"apiGroups": null,
"resources": ["routes/status"]
}]
}
} |
sample response LGTM, this is what the UI needs On Mon, May 2, 2016 at 9:45 AM, David Eads [email protected] wrote:
|
Not sure whether I like "what-can-I-do" as a command name but it's fine for On Mon, May 2, 2016 at 10:07 AM, Jessica Forrester <[email protected]
|
And the API object names? |
"list-authorized-actions"? |
API was approved On May 2, 2016, at 1:05 PM, David Eads [email protected] wrote: Not sure whether I like "what-can-I-do" as a command name but it's fine for And the API object names? — |
We get until the next tag to pin the command down. I was leaning towards @sgallagher any other comments? |
LGTM I built it and played around with setting some policy roles on a user and can verify that they appear to work properly. |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5795/) (Image: devenv-rhel7_4088) |
@jwforres I don't think I touched bindata, but I'm getting this:
|
known issue, fixed in #8725 |
re[merge] |
Evaluated for origin merge up to 257ecaa |
Let's argue about names. This as a REST endpoint and a command (
oc policy can-i --list
) that gives back a list of all the policy rules that a given user has in namespace. I need a good name for the resource and kind.I want one endpoint for determining it about yourself (with scopes properly applied) and one for determining it about someone else. Having two endpoints makes it easier to write policy rules without introspection.
Things that are missing:
@jwforres @spadgett you both asked for this. I don't intend to associate the list in any particular way.
@openshift/api-review
PertinentPermissions
andPersonalPertinentPermissions
?