{"modulePath":"github.1git.de/openshift/origin","version":"v1.5.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\nPackage api is the internal version of the API.\n\n## Constants\n\n```go\nconst (\n\tDockerBuildResource          = \"builds/docker\"\n\tSourceBuildResource          = \"builds/source\"\n\tCustomBuildResource          = \"builds/custom\"\n\tJenkinsPipelineBuildResource = \"builds/jenkinspipeline\"\n\n\tNodeMetricsResource = \"nodes/metrics\"\n\tNodeStatsResource   = \"nodes/stats\"\n\tNodeSpecResource    = \"nodes/spec\"\n\tNodeLogResource     = \"nodes/log\"\n\n\tRestrictedEndpointsResource = \"endpoints/restricted\"\n)\n```\nSynthetic authorization endpoints\n\n```go\nconst (\n\t// PolicyName is the name of Policy\n\tPolicyName     = \"default\"\n\tAPIGroupAll    = \"*\"\n\tResourceAll    = \"*\"\n\tVerbAll        = \"*\"\n\tNonResourceAll = \"*\"\n\n\tScopesKey           = \"authorization.openshift.io/scopes\"\n\tScopesAllNamespaces = \"*\"\n\n\tUserKind           = \"User\"\n\tGroupKind          = \"Group\"\n\tServiceAccountKind = \"ServiceAccount\"\n\tSystemUserKind     = \"SystemUser\"\n\tSystemGroupKind    = \"SystemGroup\"\n\n\tUserResource           = \"users\"\n\tGroupResource          = \"groups\"\n\tServiceAccountResource = \"serviceaccounts\"\n\tSystemUserResource     = \"systemusers\"\n\tSystemGroupResource    = \"systemgroups\"\n)\n```\n\n```go\nconst FutureGroupName = \"authorization.openshift.io\"\n```\n\n```go\nconst GroupName = \"\"\n```\n\n## Variables\n\n```go\nvar (\n\tSchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)\n\tAddToScheme   = SchemeBuilder.AddToScheme\n)\n```\n\n```go\nvar ClusterPolicyBindingName = GetPolicyBindingName(\"\")\n```\n\n```go\nvar DiscoveryRule = PolicyRule{\n\tVerbs: sets.NewString(\"get\"),\n\tNonResourceURLs: sets.NewString(\n\n\t\t\"/version\", \"/version/*\",\n\n\t\t\"/api\", \"/api/*\",\n\t\t\"/apis\", \"/apis/*\",\n\t\t\"/oapi\", \"/oapi/*\",\n\t\t\"/swaggerapi\", \"/swaggerapi/*\",\n\t\t\"/osapi\", \"/osapi/\",\n\t\t\"/.well-known\", \"/.well-known/*\",\n\t),\n}\n```\nDiscoveryRule is a rule that allows a client to discover the API resources available on this server\n\n```go\nvar SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}\n```\nSchemeGroupVersion is group version used to register these objects\n\n## Functions\n\n```go\nfunc BuildSubjects(users, groups []string, userNameValidator, groupNameValidator validation.ValidateNameFunc) []kapi.ObjectReference\n```\n\n```go\nfunc ClusterPolicyBindingToSelectableFields(policyBinding *ClusterPolicyBinding) fields.Set\n```\nClusterPolicyBindingToSelectableFields returns a label set that represents the object changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc\n\n```go\nfunc ClusterPolicyToSelectableFields(policy *ClusterPolicy) fields.Set\n```\nClusterPolicyToSelectableFields returns a label set that represents the object changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc\n\n```go\nfunc DeepCopy_api_Action(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterPolicy(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterPolicyBinding(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterPolicyBindingList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterRole(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterRoleBinding(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterRoleBindingList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ClusterRoleList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_GroupRestriction(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_IsPersonalSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_LocalResourceAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_LocalSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_Policy(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_PolicyBinding(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_PolicyBindingList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_PolicyList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_PolicyRule(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_PolicyRuleBuilder(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ResourceAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ResourceAccessReviewResponse(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_Role(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_RoleBinding(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_RoleBindingList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_RoleBindingRestriction(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_RoleBindingRestrictionList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_RoleBindingRestrictionSpec(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_RoleList(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SelfSubjectRulesReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SelfSubjectRulesReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ServiceAccountReference(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_ServiceAccountRestriction(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SubjectAccessReviewResponse(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SubjectRulesReview(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SubjectRulesReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_SubjectRulesReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc DeepCopy_api_UserRestriction(in interface{}, out interface{}, c *conversion.Cloner) error\n```\n\n```go\nfunc GetPolicyBindingName(policyRefNamespace string) string\n```\n\n```go\nfunc Kind(kind string) unversioned.GroupKind\n```\nKind takes an unqualified kind and returns back a Group qualified GroupKind\n\n```go\nfunc NormalizeResources(rawResources sets.String) sets.String\n```\nNormalizeResources expands all resource groups and forces all resources to lower case. If the rawResources are already normalized, it returns the original set to avoid the allocation and GC cost, since this is hit multiple times for every REST call. That means you should NEVER MODIFY THE RESULT of this call.\n\n```go\nfunc PolicyBindingToSelectableFields(policyBinding *PolicyBinding) fields.Set\n```\nPolicyBindingToSelectableFields returns a label set that represents the object changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc\n\n```go\nfunc PolicyToSelectableFields(policy *Policy) fields.Set\n```\nPolicyToSelectableFields returns a label set that represents the object changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc\n\n```go\nfunc RegisterDeepCopies(scheme *runtime.Scheme) error\n```\nRegisterDeepCopies adds deep-copy functions to the given scheme. Public to allow building arbitrary schemes.\n\n```go\nfunc Resource(resource string) unversioned.GroupResource\n```\nResource takes an unqualified resource and returns back a Group qualified GroupResource\n\n```go\nfunc RoleBindingRestrictionToSelectableFields(rbr *RoleBindingRestriction) fields.Set\n```\nRoleBindingRestrictionToSelectableFields returns a label set that be used to identify a RoleBindingRestriction object.\n\n```go\nfunc RoleBindingToSelectableFields(roleBinding *RoleBinding) fields.Set\n```\nRoleBindingToSelectableFields returns a label set that represents the object changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc\n\n```go\nfunc RoleToSelectableFields(role *Role) fields.Set\n```\nRoleToSelectableFields returns a label set that represents the object changes to the returned keys require registering conversions for existing versions using Scheme.AddFieldLabelConversionFunc\n\n```go\nfunc StringSubjectsFor(currentNamespace string, subjects []kapi.ObjectReference) ([]string, []string)\n```\nStringSubjectsFor returns users and groups for comparison against user.Info.  currentNamespace is used to to create usernames for service accounts where namespace==\"\".\n\n```go\nfunc SubjectsContainAnyGroup(subjects []kapi.ObjectReference, groups []string) bool\n```\nSubjectsContainAnyGroup returns true if the provided subjects any of the named groups.\n\n```go\nfunc SubjectsContainUser(subjects []kapi.ObjectReference, currentNamespace string, user string) bool\n```\nSubjectsContainUser returns true if the provided subjects contain the named user. currentNamespace is used to identify service accounts that are defined in a relative fashion.\n\n```go\nfunc SubjectsStrings(currentNamespace string, subjects []kapi.ObjectReference) ([]string, []string, []string, []string)\n```\nSubjectsStrings returns users, groups, serviceaccounts, unknown for display purposes.  currentNamespace is used to hide the subject.Namespace for ServiceAccounts in the currentNamespace\n\n```go\nfunc ToClusterPolicyRef(in kapi.ObjectReference) kapi.ObjectReference\n```\n\n```go\nfunc ToClusterRoleBindingMap(in map[string]*RoleBinding) map[string]*ClusterRoleBinding\n```\n\n```go\nfunc ToClusterRoleMap(in map[string]*Role) map[string]*ClusterRole\n```\n\n```go\nfunc ToClusterRoleRef(in kapi.ObjectReference) kapi.ObjectReference\n```\n\n```go\nfunc ToPolicyRef(in kapi.ObjectReference) kapi.ObjectReference\n```\n\n```go\nfunc ToRoleBindingMap(in map[string]*ClusterRoleBinding) map[string]*RoleBinding\n```\n\n```go\nfunc ToRoleMap(in map[string]*ClusterRole) map[string]*Role\n```\n\n```go\nfunc ToRoleRef(in kapi.ObjectReference) kapi.ObjectReference\n```\n\n## Types\n\n```go\ntype Action struct {\n\t// Namespace is the namespace of the action being requested.  Currently, there is no distinction between no namespace and all namespaces\n\tNamespace string\n\t// Verb is one of: get, list, watch, create, update, delete\n\tVerb string\n\t// Group is the API group of the resource\n\tGroup string\n\t// Version is the API version of the resource\n\tVersion string\n\t// Resource is one of the existing resource types\n\tResource string\n\t// ResourceName is the name of the resource being requested for a \"get\" or deleted for a \"delete\"\n\tResourceName string\n\t// Path is the path of a non resource URL\n\tPath string\n\t// IsNonResourceURL is true if this is a request for a non-resource URL (outside of the resource hieraarchy)\n\tIsNonResourceURL bool\n\t// Content is the actual content of the request for create and update\n\tContent kruntime.Object\n}\n```\nAction describes a request to be authorized\n\n```go\ntype ClusterPolicy struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// LastModified is the last time that any part of the ClusterPolicy was created, updated, or deleted\n\tLastModified unversioned.Time\n\n\t// Roles holds all the ClusterRoles held by this ClusterPolicy, mapped by Role.Name\n\tRoles ClusterRolesByName\n}\n```\nClusterPolicy is a object that holds all the ClusterRoles for a particular namespace.  There is at most one ClusterPolicy document per namespace.\n\n```go\nfunc ToClusterPolicy(in *Policy) *ClusterPolicy\n```\n\n```go\ntype ClusterPolicyBinding struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// LastModified is the last time that any part of the ClusterPolicyBinding was created, updated, or deleted\n\tLastModified unversioned.Time\n\n\t// ClusterPolicyRef is a reference to the ClusterPolicy that contains all the ClusterRoles that this ClusterPolicyBinding's RoleBindings may reference\n\tPolicyRef kapi.ObjectReference\n\t// RoleBindings holds all the RoleBindings held by this ClusterPolicyBinding, mapped by RoleBinding.Name\n\tRoleBindings ClusterRoleBindingsByName\n}\n```\nClusterPolicyBinding is a object that holds all the ClusterRoleBindings for a particular namespace.  There is one ClusterPolicyBinding document per referenced ClusterPolicy namespace\n\n```go\nfunc ToClusterPolicyBinding(in *PolicyBinding) *ClusterPolicyBinding\n```\n\n```go\ntype ClusterPolicyBindingList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of ClusterPolicyBindings\n\tItems []ClusterPolicyBinding\n}\n```\nClusterPolicyBindingList is a collection of ClusterPolicyBindings\n\n```go\nfunc ToClusterPolicyBindingList(in *PolicyBindingList) *ClusterPolicyBindingList\n```\n\n```go\ntype ClusterPolicyList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of ClusterPolicies\n\tItems []ClusterPolicy\n}\n```\nClusterPolicyList is a collection of ClusterPolicies\n\n```go\nfunc ToClusterPolicyList(in *PolicyList) *ClusterPolicyList\n```\n\n```go\ntype ClusterRole struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// Rules holds all the PolicyRules for this ClusterRole\n\tRules []PolicyRule\n}\n```\nClusterRole is a logical grouping of PolicyRules that can be referenced as a unit by ClusterRoleBindings.\n\n```go\nfunc ToClusterRole(in *Role) *ClusterRole\n```\n\n```go\ntype ClusterRoleBinding struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// Subjects hold object references of to authorize with this rule\n\tSubjects []kapi.ObjectReference\n\n\t// RoleRef can only reference the current namespace and the global namespace\n\t// If the ClusterRoleRef cannot be resolved, the Authorizer must return an error.\n\t// Since Policy is a singleton, this is sufficient knowledge to locate a role\n\tRoleRef kapi.ObjectReference\n}\n```\nClusterRoleBinding references a ClusterRole, but not contain it.  It can reference any ClusterRole in the same namespace or in the global namespace. It adds who information via Users and Groups and namespace information by which namespace it exists in.  ClusterRoleBindings in a given namespace only have effect in that namespace (excepting the master namespace which has power in all namespaces).\n\n```go\nfunc ToClusterRoleBinding(in *RoleBinding) *ClusterRoleBinding\n```\n\n```go\ntype ClusterRoleBindingList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of ClusterRoleBindings\n\tItems []ClusterRoleBinding\n}\n```\nClusterRoleBindingList is a collection of ClusterRoleBindings\n\n```go\nfunc ToClusterRoleBindingList(in *RoleBindingList) *ClusterRoleBindingList\n```\n\n```go\ntype ClusterRoleBindingsByName map[string]*ClusterRoleBinding\n```\n\n```go\ntype ClusterRoleList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of ClusterRoles\n\tItems []ClusterRole\n}\n```\nClusterRoleList is a collection of ClusterRoles\n\n```go\nfunc ToClusterRoleList(in *RoleList) *ClusterRoleList\n```\n\n```go\ntype ClusterRolesByName map[string]*ClusterRole\n```\n\n```go\ntype GroupRestriction struct {\n\t// Groups specifies a list of literal group names.\n\tGroups []string\n\n\t// Selectors specifies a list of label selectors over group labels.\n\tSelectors []unversioned.LabelSelector\n}\n```\nGroupRestriction matches a group either by a string match on the group name or a label selector applied to group labels.\n\n```go\ntype IsPersonalSubjectAccessReview struct {\n\tunversioned.TypeMeta\n}\n```\nIsPersonalSubjectAccessReview is a marker for PolicyRule.AttributeRestrictions that denotes that subjectaccessreviews on self should be allowed\n\n```go\ntype LocalResourceAccessReview struct {\n\tunversioned.TypeMeta\n\n\t// Action describes the action being tested\n\tAction\n}\n```\nLocalResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec in a particular namespace\n\n```go\ntype LocalSubjectAccessReview struct {\n\tunversioned.TypeMeta\n\n\t// Action describes the action being tested.  The Namespace element is FORCED to the current namespace.\n\tAction\n\t// User is optional.  If both User and Groups are empty, the current authenticated user is used.\n\tUser string\n\t// Groups is optional.  Groups is the list of groups to which the User belongs.\n\t// +k8s:conversion-gen=false\n\tGroups sets.String\n\t// Scopes to use for the evaluation.  Empty means \"use the unscoped (full) permissions of the user/groups\".\n\t// Nil for a self-SAR, means \"use the scopes on this request\".\n\t// Nil for a regular SAR, means the same as empty.\n\tScopes []string\n}\n```\nLocalSubjectAccessReview is an object for requesting information about whether a user or group can perform an action in a particular namespace\n\n```go\nfunc AddUserToLSAR(user user.Info, lsar *LocalSubjectAccessReview) *LocalSubjectAccessReview\n```\n\n```go\ntype Policy struct {\n\tunversioned.TypeMeta\n\tkapi.ObjectMeta\n\n\t// LastModified is the last time that any part of the Policy was created, updated, or deleted\n\tLastModified unversioned.Time\n\n\t// Roles holds all the Roles held by this Policy, mapped by Role.Name\n\tRoles RolesByName\n}\n```\nPolicy is a object that holds all the Roles for a particular namespace.  There is at most one Policy document per namespace.\n\n```go\nfunc ToPolicy(in *ClusterPolicy) *Policy\n```\n\n```go\ntype PolicyBinding struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// LastModified is the last time that any part of the PolicyBinding was created, updated, or deleted\n\tLastModified unversioned.Time\n\n\t// PolicyRef is a reference to the Policy that contains all the Roles that this PolicyBinding's RoleBindings may reference\n\tPolicyRef kapi.ObjectReference\n\t// RoleBindings holds all the RoleBindings held by this PolicyBinding, mapped by RoleBinding.Name\n\tRoleBindings RoleBindingsByName\n}\n```\nPolicyBinding is a object that holds all the RoleBindings for a particular namespace.  There is one PolicyBinding document per referenced Policy namespace\n\n```go\nfunc ToPolicyBinding(in *ClusterPolicyBinding) *PolicyBinding\n```\n\n```go\ntype PolicyBindingList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of policyBindings\n\tItems []PolicyBinding\n}\n```\nPolicyBindingList is a collection of PolicyBindings\n\n```go\nfunc ToPolicyBindingList(in *ClusterPolicyBindingList) *PolicyBindingList\n```\n\n```go\ntype PolicyBindingSorter []PolicyBinding\n```\n\n```go\nfunc (s PolicyBindingSorter) Len() int\n```\n\n```go\nfunc (s PolicyBindingSorter) Less(i, j int) bool\n```\n\n```go\nfunc (s PolicyBindingSorter) Swap(i, j int)\n```\n\n```go\ntype PolicyList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of policies\n\tItems []Policy\n}\n```\nPolicyList is a collection of Policies\n\n```go\nfunc ToPolicyList(in *ClusterPolicyList) *PolicyList\n```\n\n```go\ntype PolicyRule struct {\n\t// Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule.  VerbAll represents all kinds.\n\tVerbs sets.String\n\t// AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder pair supports.\n\t// If the Authorizer does not recognize how to handle the AttributeRestrictions, the Authorizer should report an error.\n\tAttributeRestrictions kruntime.Object\n\t// APIGroups is the name of the APIGroup that contains the resources.  If this field is empty, then both kubernetes and origin API groups are assumed.\n\t// That means that if an action is requested against one of the enumerated resources in either the kubernetes or the origin API group, the request\n\t// will be allowed\n\tAPIGroups []string\n\t// Resources is a list of resources this rule applies to.  ResourceAll represents all resources.\n\tResources sets.String\n\t// ResourceNames is an optional white list of names that the rule applies to.  An empty set means that everything is allowed.\n\tResourceNames sets.String\n\t// NonResourceURLs is a set of partial urls that a user should have access to.  *s are allowed, but only as the full, final step in the path\n\t// If an action is not a resource API request, then the URL is split on '/' and is checked against the NonResourceURLs to look for a match.\n\tNonResourceURLs sets.String\n}\n```\nPolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.\n\n```go\nfunc (r PolicyRule) CompactString() string\n```\nCompactString exposes a compact string representation for use in escalation error messages\n\n```go\nfunc (r PolicyRule) String() string\n```\n\n```go\ntype PolicyRuleBuilder struct {\n\tPolicyRule PolicyRule\n}\n```\n\\+gencopy=false PolicyRuleBuilder let's us attach methods.  A no-no for API types\n\n```go\nfunc NewRule(verbs ...string) *PolicyRuleBuilder\n```\n\n```go\nfunc (r *PolicyRuleBuilder) Groups(groups ...string) *PolicyRuleBuilder\n```\n\n```go\nfunc (r *PolicyRuleBuilder) Names(names ...string) *PolicyRuleBuilder\n```\n\n```go\nfunc (r *PolicyRuleBuilder) Resources(resources ...string) *PolicyRuleBuilder\n```\n\n```go\nfunc (r *PolicyRuleBuilder) Rule() (PolicyRule, error)\n```\n\n```go\nfunc (r *PolicyRuleBuilder) RuleOrDie() PolicyRule\n```\n\n```go\ntype ResourceAccessReview struct {\n\tunversioned.TypeMeta\n\n\t// Action describes the action being tested\n\tAction\n}\n```\nResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec\n\n```go\ntype ResourceAccessReviewResponse struct {\n\tunversioned.TypeMeta\n\n\t// Namespace is the namespace used for the access review\n\tNamespace string\n\t// Users is the list of users who can perform the action\n\t// +k8s:conversion-gen=false\n\tUsers sets.String\n\t// Groups is the list of groups who can perform the action\n\t// +k8s:conversion-gen=false\n\tGroups sets.String\n\n\t// EvaluationError is an indication that some error occurred during resolution, but partial results can still be returned.\n\t// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.  This is\n\t// most common when a bound role is missing, but enough roles are still present and bound to reason about the request.\n\tEvaluationError string\n}\n```\nResourceAccessReviewResponse describes who can perform the action\n\n```go\ntype Role struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// Rules holds all the PolicyRules for this Role\n\tRules []PolicyRule\n}\n```\nRole is a logical grouping of PolicyRules that can be referenced as a unit by RoleBindings.\n\n```go\nfunc ToRole(in *ClusterRole) *Role\n```\n\n```go\ntype RoleBinding struct {\n\tunversioned.TypeMeta\n\tkapi.ObjectMeta\n\n\t// Subjects hold object references of to authorize with this rule\n\tSubjects []kapi.ObjectReference\n\n\t// RoleRef can only reference the current namespace and the global namespace\n\t// If the RoleRef cannot be resolved, the Authorizer must return an error.\n\t// Since Policy is a singleton, this is sufficient knowledge to locate a role\n\tRoleRef kapi.ObjectReference\n}\n```\nRoleBinding references a Role, but not contain it.  It can reference any Role in the same namespace or in the global namespace. It adds who information via Users and Groups and namespace information by which namespace it exists in.  RoleBindings in a given namespace only have effect in that namespace (excepting the master namespace which has power in all namespaces).\n\n```go\nfunc SortRoleBindings(roleBindingMap map[string]*RoleBinding, reverse bool) []*RoleBinding\n```\n\n```go\nfunc ToRoleBinding(in *ClusterRoleBinding) *RoleBinding\n```\n\n```go\ntype RoleBindingList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of roleBindings\n\tItems []RoleBinding\n}\n```\nRoleBindingList is a collection of RoleBindings\n\n```go\nfunc ToRoleBindingList(in *ClusterRoleBindingList) *RoleBindingList\n```\n\n```go\ntype RoleBindingRestriction struct {\n\tunversioned.TypeMeta\n\n\t// Standard object's metadata.\n\tkapi.ObjectMeta\n\n\t// Spec defines the matcher.\n\tSpec RoleBindingRestrictionSpec\n}\n```\nRoleBindingRestriction is an object that can be matched against a subject (user, group, or service account) to determine whether rolebindings on that subject are allowed in the namespace to which the RoleBindingRestriction belongs.  If any one of those RoleBindingRestriction objects matches a subject, rolebindings on that subject in the namespace are allowed.\n\n```go\ntype RoleBindingRestrictionList struct {\n\tunversioned.TypeMeta\n\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of RoleBindingRestriction objects.\n\tItems []RoleBindingRestriction\n}\n```\nRoleBindingRestrictionList is a collection of RoleBindingRestriction objects.\n\n```go\ntype RoleBindingRestrictionSpec struct {\n\t// UserRestriction matches against user subjects.\n\tUserRestriction *UserRestriction\n\n\t// GroupRestriction matches against group subjects.\n\tGroupRestriction *GroupRestriction\n\n\t// ServiceAccountRestriction matches against service-account subjects.\n\tServiceAccountRestriction *ServiceAccountRestriction\n}\n```\nRoleBindingRestrictionSpec defines a rolebinding restriction.  Exactly one field must be non-nil.\n\n```go\ntype RoleBindingSorter []*RoleBinding\n```\n\n```go\nfunc (s RoleBindingSorter) Len() int\n```\n\n```go\nfunc (s RoleBindingSorter) Less(i, j int) bool\n```\n\n```go\nfunc (s RoleBindingSorter) Swap(i, j int)\n```\n\n```go\ntype RoleBindingsByName map[string]*RoleBinding\n```\n\n```go\ntype RoleList struct {\n\tunversioned.TypeMeta\n\t// Standard object's metadata.\n\tunversioned.ListMeta\n\n\t// Items is a list of roles\n\tItems []Role\n}\n```\nRoleList is a collection of Roles\n\n```go\nfunc ToRoleList(in *ClusterRoleList) *RoleList\n```\n\n```go\ntype RolesByName map[string]*Role\n```\n\n```go\ntype SelfSubjectRulesReview struct {\n\tunversioned.TypeMeta\n\n\t// Spec adds information about how to conduct the check\n\tSpec SelfSubjectRulesReviewSpec\n\n\t// Status is completed by the server to tell which permissions you have\n\tStatus SubjectRulesReviewStatus\n}\n```\nSelfSubjectRulesReview is a resource you can create to determine which actions you can perform in a namespace\n\n```go\ntype SelfSubjectRulesReviewSpec struct {\n\t// Scopes to use for the evaluation.  Empty means \"use the unscoped (full) permissions of the user/groups\".\n\t// Nil for a self-SubjectRulesReview, means \"use the scopes on this request\".\n\t// Nil for a regular SubjectRulesReview, means the same as empty.\n\tScopes []string\n}\n```\nSelfSubjectRulesReviewSpec adds information about how to conduct the check\n\n```go\ntype ServiceAccountReference struct {\n\t// Name is the name of the service account.\n\tName string\n\n\t// Namespace is the namespace of the service account.  Service accounts from\n\t// inside the whitelisted namespaces are allowed to be bound to roles.  If\n\t// Namespace is empty, then the namespace of the RoleBindingRestriction in\n\t// which the ServiceAccountReference is embedded is used.\n\tNamespace string\n}\n```\nServiceAccountReference specifies a service account and namespace by their names.\n\n```go\ntype ServiceAccountRestriction struct {\n\t// ServiceAccounts specifies a list of literal service-account names.\n\tServiceAccounts []ServiceAccountReference\n\n\t// Namespaces specifies a list of literal namespace names.  ServiceAccounts\n\t// from inside the whitelisted namespaces are allowed to be bound to roles.\n\tNamespaces []string\n}\n```\nServiceAccountRestriction matches a service account by a string match on either the service-account name or the name of the service account's namespace.\n\n```go\ntype SortableRuleSlice []PolicyRule\n```\n\n```go\nfunc (s SortableRuleSlice) Len() int\n```\n\n```go\nfunc (s SortableRuleSlice) Less(i, j int) bool\n```\n\n```go\nfunc (s SortableRuleSlice) Swap(i, j int)\n```\n\n```go\ntype SubjectAccessReview struct {\n\tunversioned.TypeMeta\n\n\t// Action describes the action being tested\n\tAction\n\t// User is optional.  If both User and Groups are empty, the current authenticated user is used.\n\tUser string\n\t// Groups is optional.  Groups is the list of groups to which the User belongs.\n\t// +k8s:conversion-gen=false\n\tGroups sets.String\n\t// Scopes to use for the evaluation.  Empty means \"use the unscoped (full) permissions of the user/groups\".\n\t// Nil for a self-SAR, means \"use the scopes on this request\".\n\t// Nil for a regular SAR, means the same as empty.\n\tScopes []string\n}\n```\nSubjectAccessReview is an object for requesting information about whether a user or group can perform an action\n\n```go\nfunc AddUserToSAR(user user.Info, sar *SubjectAccessReview) *SubjectAccessReview\n```\n\n```go\ntype SubjectAccessReviewResponse struct {\n\tunversioned.TypeMeta\n\n\t// Namespace is the namespace used for the access review\n\tNamespace string\n\t// Allowed is required.  True if the action would be allowed, false otherwise.\n\tAllowed bool\n\t// Reason is optional.  It indicates why a request was allowed or denied.\n\tReason string\n\t// EvaluationError is an indication that some error occurred during the authorization check.\n\t// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.  This is\n\t// most common when a bound role is missing, but enough roles are still present and bound to reason about the request.\n\tEvaluationError string\n}\n```\nSubjectAccessReviewResponse describes whether or not a user or group can perform an action\n\n```go\ntype SubjectRulesReview struct {\n\tunversioned.TypeMeta\n\n\t// Spec adds information about how to conduct the check\n\tSpec SubjectRulesReviewSpec\n\n\t// Status is completed by the server to tell which permissions you have\n\tStatus SubjectRulesReviewStatus\n}\n```\nSubjectRulesReview is a resource you can create to determine which actions another user can perform in a namespace\n\n```go\ntype SubjectRulesReviewSpec struct {\n\t// User is optional.  At least one of User and Groups must be specified.\n\tUser string\n\t// Groups is optional.  Groups is the list of groups to which the User belongs.  At least one of User and Groups must be specified.\n\tGroups []string\n\t// Scopes to use for the evaluation.  Empty means \"use the unscoped (full) permissions of the user/groups\".\n\tScopes []string\n}\n```\nSubjectRulesReviewSpec adds information about how to conduct the check\n\n```go\ntype SubjectRulesReviewStatus struct {\n\t// Rules is the list of rules (no particular sort) that are allowed for the subject\n\tRules []PolicyRule\n\t// EvaluationError can appear in combination with Rules.  It means some error happened during evaluation\n\t// that may have prevented additional rules from being populated.\n\tEvaluationError string\n}\n```\nSubjectRulesReviewStatus is contains the result of a rules check\n\n```go\ntype UserRestriction struct {\n\t// Users specifies a list of literal user names.\n\tUsers []string\n\n\t// Groups is a list of groups used to match against an individual user's\n\t// groups. If the user is a member of one of the whitelisted groups, the user\n\t// is allowed to be bound to a role.\n\tGroups []string\n\n\t// Selectors specifies a list of label selectors over user labels.\n\tSelectors []unversioned.LabelSelector\n}\n```\nUserRestriction matches a user either by a string match on the user name, a string match on the name of a group to which the user belongs, or a label selector applied to the user labels.\n\n","path":"github.1git.de/openshift/origin/pkg/authorization/api","name":"api","synopsis":"Package api is the internal version of the API.","isRedistributable":true}
