v1alpha1

package
v0.0.0-...-69db04a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Statement_Effect_name = map[int32]string{
	0: "ALLOW",
	1: "DENY",
}
View Source
var Statement_Effect_value = map[string]int32{
	"ALLOW": 0,
	"DENY":  1,
}

Functions

func RegisterJudgeServer

func RegisterJudgeServer(s *grpc.Server, srv JudgeServer)

Types

type AuthorizeRequest

type AuthorizeRequest struct {
	Object               string            `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"`
	Action               string            `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
	Context              map[string]string `` /* 155-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*AuthorizeRequest) Descriptor

func (*AuthorizeRequest) Descriptor() ([]byte, []int)

func (*AuthorizeRequest) GetAction

func (m *AuthorizeRequest) GetAction() string

func (*AuthorizeRequest) GetContext

func (m *AuthorizeRequest) GetContext() map[string]string

func (*AuthorizeRequest) GetObject

func (m *AuthorizeRequest) GetObject() string

func (*AuthorizeRequest) ProtoMessage

func (*AuthorizeRequest) ProtoMessage()

func (*AuthorizeRequest) Reset

func (m *AuthorizeRequest) Reset()

func (*AuthorizeRequest) String

func (m *AuthorizeRequest) String() string

func (*AuthorizeRequest) XXX_DiscardUnknown

func (m *AuthorizeRequest) XXX_DiscardUnknown()

func (*AuthorizeRequest) XXX_Marshal

func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuthorizeRequest) XXX_Merge

func (m *AuthorizeRequest) XXX_Merge(src proto.Message)

func (*AuthorizeRequest) XXX_Size

func (m *AuthorizeRequest) XXX_Size() int

func (*AuthorizeRequest) XXX_Unmarshal

func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error

type AuthorizeResponse

type AuthorizeResponse struct {
	Authorized           bool     `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
	Explain              string   `protobuf:"bytes,2,opt,name=explain,proto3" json:"explain,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthorizeResponse) Descriptor

func (*AuthorizeResponse) Descriptor() ([]byte, []int)

func (*AuthorizeResponse) GetAuthorized

func (m *AuthorizeResponse) GetAuthorized() bool

func (*AuthorizeResponse) GetExplain

func (m *AuthorizeResponse) GetExplain() string

func (*AuthorizeResponse) ProtoMessage

func (*AuthorizeResponse) ProtoMessage()

func (*AuthorizeResponse) Reset

func (m *AuthorizeResponse) Reset()

func (*AuthorizeResponse) String

func (m *AuthorizeResponse) String() string

func (*AuthorizeResponse) XXX_DiscardUnknown

func (m *AuthorizeResponse) XXX_DiscardUnknown()

func (*AuthorizeResponse) XXX_Marshal

func (m *AuthorizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuthorizeResponse) XXX_Merge

func (m *AuthorizeResponse) XXX_Merge(src proto.Message)

func (*AuthorizeResponse) XXX_Size

func (m *AuthorizeResponse) XXX_Size() int

func (*AuthorizeResponse) XXX_Unmarshal

func (m *AuthorizeResponse) XXX_Unmarshal(b []byte) error

type CreatePolicyRequest

type CreatePolicyRequest struct {
	// The client-assigned policy object resource name to use for this document.
	//
	// Optional. If not specified, an ID will be assigned by the service.
	PolicyId string `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	// The policy to create.
	Policy               *Policy  `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreatePolicyRequest) Descriptor

func (*CreatePolicyRequest) Descriptor() ([]byte, []int)

func (*CreatePolicyRequest) GetPolicy

func (m *CreatePolicyRequest) GetPolicy() *Policy

func (*CreatePolicyRequest) GetPolicyId

func (m *CreatePolicyRequest) GetPolicyId() string

func (*CreatePolicyRequest) ProtoMessage

func (*CreatePolicyRequest) ProtoMessage()

func (*CreatePolicyRequest) Reset

func (m *CreatePolicyRequest) Reset()

func (*CreatePolicyRequest) String

func (m *CreatePolicyRequest) String() string

func (*CreatePolicyRequest) XXX_DiscardUnknown

func (m *CreatePolicyRequest) XXX_DiscardUnknown()

func (*CreatePolicyRequest) XXX_Marshal

func (m *CreatePolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreatePolicyRequest) XXX_Merge

func (m *CreatePolicyRequest) XXX_Merge(src proto.Message)

func (*CreatePolicyRequest) XXX_Size

func (m *CreatePolicyRequest) XXX_Size() int

func (*CreatePolicyRequest) XXX_Unmarshal

func (m *CreatePolicyRequest) XXX_Unmarshal(b []byte) error

type DeletePolicyRequest

type DeletePolicyRequest struct {
	// The object resource name of the Policy to delete. In the format:
	// `orn:judge-org:judge-service::policy/default_policy`.
	PolicyId             string   `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeletePolicyRequest) Descriptor

func (*DeletePolicyRequest) Descriptor() ([]byte, []int)

func (*DeletePolicyRequest) GetPolicyId

func (m *DeletePolicyRequest) GetPolicyId() string

func (*DeletePolicyRequest) ProtoMessage

func (*DeletePolicyRequest) ProtoMessage()

func (*DeletePolicyRequest) Reset

func (m *DeletePolicyRequest) Reset()

func (*DeletePolicyRequest) String

func (m *DeletePolicyRequest) String() string

func (*DeletePolicyRequest) XXX_DiscardUnknown

func (m *DeletePolicyRequest) XXX_DiscardUnknown()

func (*DeletePolicyRequest) XXX_Marshal

func (m *DeletePolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeletePolicyRequest) XXX_Merge

func (m *DeletePolicyRequest) XXX_Merge(src proto.Message)

func (*DeletePolicyRequest) XXX_Size

func (m *DeletePolicyRequest) XXX_Size() int

func (*DeletePolicyRequest) XXX_Unmarshal

func (m *DeletePolicyRequest) XXX_Unmarshal(b []byte) error

type GetPolicyRequest

type GetPolicyRequest struct {
	// The orn of the policy to retrieve.
	PolicyId             string   `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetPolicyRequest) Descriptor

func (*GetPolicyRequest) Descriptor() ([]byte, []int)

func (*GetPolicyRequest) GetPolicyId

func (m *GetPolicyRequest) GetPolicyId() string

func (*GetPolicyRequest) ProtoMessage

func (*GetPolicyRequest) ProtoMessage()

func (*GetPolicyRequest) Reset

func (m *GetPolicyRequest) Reset()

func (*GetPolicyRequest) String

func (m *GetPolicyRequest) String() string

func (*GetPolicyRequest) XXX_DiscardUnknown

func (m *GetPolicyRequest) XXX_DiscardUnknown()

func (*GetPolicyRequest) XXX_Marshal

func (m *GetPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetPolicyRequest) XXX_Merge

func (m *GetPolicyRequest) XXX_Merge(src proto.Message)

func (*GetPolicyRequest) XXX_Size

func (m *GetPolicyRequest) XXX_Size() int

func (*GetPolicyRequest) XXX_Unmarshal

func (m *GetPolicyRequest) XXX_Unmarshal(b []byte) error

type JudgeClient

type JudgeClient interface {
	// Gets a single policy.
	GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*Policy, error)
	// Lists policies.
	ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error)
	// Creates a new policy.
	CreatePolicy(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*Policy, error)
	// Updates or inserts a policy.
	UpdatePolicy(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*Policy, error)
	// Deletes a policy.
	DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error)
}

JudgeClient is the client API for Judge service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewJudgeClient

func NewJudgeClient(cc *grpc.ClientConn) JudgeClient

type JudgeServer

type JudgeServer interface {
	// Gets a single policy.
	GetPolicy(context.Context, *GetPolicyRequest) (*Policy, error)
	// Lists policies.
	ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error)
	// Creates a new policy.
	CreatePolicy(context.Context, *CreatePolicyRequest) (*Policy, error)
	// Updates or inserts a policy.
	UpdatePolicy(context.Context, *UpdatePolicyRequest) (*Policy, error)
	// Deletes a policy.
	DeletePolicy(context.Context, *DeletePolicyRequest) (*empty.Empty, error)
	Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error)
}

JudgeServer is the server API for Judge service.

type ListPoliciesRequest

type ListPoliciesRequest struct {
	// The maximum number of policies to return.
	PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// The `next_page_token` value returned from a previous List request, if any.
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// The order to sort results by. For example: `priority desc, name`.
	OrderBy              string   `protobuf:"bytes,3,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListPoliciesRequest) Descriptor

func (*ListPoliciesRequest) Descriptor() ([]byte, []int)

func (*ListPoliciesRequest) GetOrderBy

func (m *ListPoliciesRequest) GetOrderBy() string

func (*ListPoliciesRequest) GetPageSize

func (m *ListPoliciesRequest) GetPageSize() int32

func (*ListPoliciesRequest) GetPageToken

func (m *ListPoliciesRequest) GetPageToken() string

func (*ListPoliciesRequest) ProtoMessage

func (*ListPoliciesRequest) ProtoMessage()

func (*ListPoliciesRequest) Reset

func (m *ListPoliciesRequest) Reset()

func (*ListPoliciesRequest) String

func (m *ListPoliciesRequest) String() string

func (*ListPoliciesRequest) XXX_DiscardUnknown

func (m *ListPoliciesRequest) XXX_DiscardUnknown()

func (*ListPoliciesRequest) XXX_Marshal

func (m *ListPoliciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListPoliciesRequest) XXX_Merge

func (m *ListPoliciesRequest) XXX_Merge(src proto.Message)

func (*ListPoliciesRequest) XXX_Size

func (m *ListPoliciesRequest) XXX_Size() int

func (*ListPoliciesRequest) XXX_Unmarshal

func (m *ListPoliciesRequest) XXX_Unmarshal(b []byte) error

type ListPoliciesResponse

type ListPoliciesResponse struct {
	// The Policies found.
	Policies []*Policy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"`
	// The next page token.
	NextPageToken        string   `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListPoliciesResponse) Descriptor

func (*ListPoliciesResponse) Descriptor() ([]byte, []int)

func (*ListPoliciesResponse) GetNextPageToken

func (m *ListPoliciesResponse) GetNextPageToken() string

func (*ListPoliciesResponse) GetPolicies

func (m *ListPoliciesResponse) GetPolicies() []*Policy

func (*ListPoliciesResponse) ProtoMessage

func (*ListPoliciesResponse) ProtoMessage()

func (*ListPoliciesResponse) Reset

func (m *ListPoliciesResponse) Reset()

func (*ListPoliciesResponse) String

func (m *ListPoliciesResponse) String() string

func (*ListPoliciesResponse) XXX_DiscardUnknown

func (m *ListPoliciesResponse) XXX_DiscardUnknown()

func (*ListPoliciesResponse) XXX_Marshal

func (m *ListPoliciesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListPoliciesResponse) XXX_Merge

func (m *ListPoliciesResponse) XXX_Merge(src proto.Message)

func (*ListPoliciesResponse) XXX_Size

func (m *ListPoliciesResponse) XXX_Size() int

func (*ListPoliciesResponse) XXX_Unmarshal

func (m *ListPoliciesResponse) XXX_Unmarshal(b []byte) error

type Policy

type Policy struct {
	// Output only. The object resource name of the document, for example
	// `orn:judge-org:judge-service::policy/default_policy`.
	PolicyId string `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	// Name element specifies a user friendly name for the policy.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description element specifies description/usage about the policy.
	//
	// Optional.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Statement contains a list of Statement.
	//
	// Optional.
	Statements []*Statement `protobuf:"bytes,4,rep,name=statements,proto3" json:"statements,omitempty"`
	// Output only. The time at which the policy was created.
	CreateTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// Output only. The time at which the document was last changed.
	//
	// This value is initally set to the `create_time` then increases
	// monotonically with each change to the policy.
	UpdateTime           *timestamp.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

A Judge policy.

func (*Policy) Descriptor

func (*Policy) Descriptor() ([]byte, []int)

func (*Policy) GetCreateTime

func (m *Policy) GetCreateTime() *timestamp.Timestamp

func (*Policy) GetDescription

func (m *Policy) GetDescription() string

func (*Policy) GetName

func (m *Policy) GetName() string

func (*Policy) GetPolicyId

func (m *Policy) GetPolicyId() string

func (*Policy) GetStatements

func (m *Policy) GetStatements() []*Statement

func (*Policy) GetUpdateTime

func (m *Policy) GetUpdateTime() *timestamp.Timestamp

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) Reset

func (m *Policy) Reset()

func (*Policy) String

func (m *Policy) String() string

func (*Policy) XXX_DiscardUnknown

func (m *Policy) XXX_DiscardUnknown()

func (*Policy) XXX_Marshal

func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Policy) XXX_Merge

func (m *Policy) XXX_Merge(src proto.Message)

func (*Policy) XXX_Size

func (m *Policy) XXX_Size() int

func (*Policy) XXX_Unmarshal

func (m *Policy) XXX_Unmarshal(b []byte) error

type Statement

type Statement struct {
	// The Effect element is required and specifies whether the statement
	// results in an allow or an explicit deny. Valid values for Effect are
	// Allow and Deny.
	Effect Statement_Effect `protobuf:"varint,1,opt,name=effect,proto3,enum=judge.api.v1alpha1.Statement_Effect" json:"effect,omitempty"`
	// The Action element describes the specific action or actions that will
	// be allowed or denied.
	Actions []string `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
	// The Resource element specifies the object or objects that the statement
	// covers.
	Resources []string `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"`
	// The Conditions element contains definition of conditions to execute.
	Conditions           []string `protobuf:"bytes,4,rep,name=conditions,proto3" json:"conditions,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

An Statement.

func (*Statement) Descriptor

func (*Statement) Descriptor() ([]byte, []int)

func (*Statement) GetActions

func (m *Statement) GetActions() []string

func (*Statement) GetConditions

func (m *Statement) GetConditions() []string

func (*Statement) GetEffect

func (m *Statement) GetEffect() Statement_Effect

func (*Statement) GetResources

func (m *Statement) GetResources() []string

func (*Statement) ProtoMessage

func (*Statement) ProtoMessage()

func (*Statement) Reset

func (m *Statement) Reset()

func (*Statement) String

func (m *Statement) String() string

func (*Statement) XXX_DiscardUnknown

func (m *Statement) XXX_DiscardUnknown()

func (*Statement) XXX_Marshal

func (m *Statement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Statement) XXX_Merge

func (m *Statement) XXX_Merge(src proto.Message)

func (*Statement) XXX_Size

func (m *Statement) XXX_Size() int

func (*Statement) XXX_Unmarshal

func (m *Statement) XXX_Unmarshal(b []byte) error

type Statement_Effect

type Statement_Effect int32
const (
	Statement_ALLOW Statement_Effect = 0
	Statement_DENY  Statement_Effect = 1
)

func (Statement_Effect) EnumDescriptor

func (Statement_Effect) EnumDescriptor() ([]byte, []int)

func (Statement_Effect) String

func (x Statement_Effect) String() string

type UpdatePolicyRequest

type UpdatePolicyRequest struct {
	// The updated policy.
	// Creates the policy if it does not already exist.
	Policy               *Policy  `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UpdatePolicyRequest) Descriptor

func (*UpdatePolicyRequest) Descriptor() ([]byte, []int)

func (*UpdatePolicyRequest) GetPolicy

func (m *UpdatePolicyRequest) GetPolicy() *Policy

func (*UpdatePolicyRequest) ProtoMessage

func (*UpdatePolicyRequest) ProtoMessage()

func (*UpdatePolicyRequest) Reset

func (m *UpdatePolicyRequest) Reset()

func (*UpdatePolicyRequest) String

func (m *UpdatePolicyRequest) String() string

func (*UpdatePolicyRequest) XXX_DiscardUnknown

func (m *UpdatePolicyRequest) XXX_DiscardUnknown()

func (*UpdatePolicyRequest) XXX_Marshal

func (m *UpdatePolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdatePolicyRequest) XXX_Merge

func (m *UpdatePolicyRequest) XXX_Merge(src proto.Message)

func (*UpdatePolicyRequest) XXX_Size

func (m *UpdatePolicyRequest) XXX_Size() int

func (*UpdatePolicyRequest) XXX_Unmarshal

func (m *UpdatePolicyRequest) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL