Documentation
¶
Overview ¶
Package pdpcc implements gRPC client to control Policy Decision Point (PDP) server. It wraps control part of golang gRPC protocol implementation for PDP. The protocol is defined by github.com/infobloxopen/themis/proto/control.proto. Its golang implementation can be found at github.com/infobloxopen/themis/pdp-control.
Index ¶
- type Client
- func (c *Client) Apply(id int32) error
- func (c *Client) Close()
- func (c *Client) Connect(timeout time.Duration) error
- func (c *Client) NotifyReady() error
- func (c *Client) RequestContentUpload(id, fromTag, toTag string) (int32, error)
- func (c *Client) RequestPoliciesUpload(fromTag, toTag string) (int32, error)
- func (c *Client) Upload(id int32, r io.Reader) (int32, error)
- type TagError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client structure represents client side of PDP control protocol. It's responsible for establishing connection and uploading data to PDP server.
func (*Client) Apply ¶
Apply requests server to switch to recently apploaded policies or content. Its id argument should be upload id obtained on previous Upload call.
func (*Client) Close ¶
func (c *Client) Close()
Close terminates established connection. It does nothing if there is no connection.
func (*Client) NotifyReady ¶
NotifyReady set server to 'ready' state - after that server will open service port for serve decision requests
func (*Client) RequestContentUpload ¶
RequestContentUpload requests content upload. The method returns request's id which should be used on upload call. Argument id is content identifier. It must be equal to id field of full content representation. As for policies fromTag and toTag should be valid text representaion of UUID or empty string. If fromTag is emply server expects full content on upload otherwise it expects update. If toTag is empty content becomes not tagged and can't be updated incrementally. TagError is returned to indicate that fromTag doesn't match to current server's content with the same content id.
func (*Client) RequestPoliciesUpload ¶
RequestPoliciesUpload makes request to upload policies. On success returns id of the request. The id should be used to make actual upload. Arguments fromTag and toTag should be valid text representaions of UUID or empty strings. If fromTag is emply, server expects full policy on upload otherwise it expects update. If toTag is empty, policy becomes not tagged and can't be updated incrementally. If incremental update is not possible because fromTag doesn't match to current server policies tag, the method returns TagError.
func (*Client) Upload ¶
Upload implements actual data transfer to PDP server. It streams all data from given reader. Argument id should be valid request id obtained previously from RequestPoliciesUpload or RequestContentUpload call. On success Upload method returns upload id (which is not equal to request id). Obtained id shuld be used in next Apply call.