forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readonlyclient.go
27 lines (22 loc) · 1.32 KB
/
readonlyclient.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package client
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
// ReadOnlyPolicyClient exposes List() and Get() for policies and bindings along with the the last synced resource version
type ReadOnlyPolicyClient interface {
// Embedded interfaces to allow read-only access to policies and bindings on project and cluster level
PoliciesReadOnlyNamespacer
ClusterPoliciesReadOnlyInterface
PolicyBindingsReadOnlyNamespacer
ClusterPolicyBindingsReadOnlyInterface
// Returns the last synced resource version for re-sync sanity checks
LastSyncResourceVersion() string
// Methods that enable the ReadOnlyPolicyClient to conform to rulevalidation.PolicyGetter and rulevalidation.BindingLister interfaces
GetPolicy(ctx kapi.Context, name string) (*authorizationapi.Policy, error)
ListPolicyBindings(ctx kapi.Context, label labels.Selector, field fields.Selector) (*authorizationapi.PolicyBindingList, error)
GetClusterPolicy(ctx kapi.Context, name string) (*authorizationapi.ClusterPolicy, error)
ListClusterPolicyBindings(ctx kapi.Context, label labels.Selector, field fields.Selector) (*authorizationapi.ClusterPolicyBindingList, error)
}