Documentation ¶
Index ¶
- type Client
- func (c *Client) AddPermission(oid, target string) error
- func (c *Client) AddUserToGroup(uid, gid string) error
- func (c *Client) Close() error
- func (c *Client) CreateGroup(scopes []Scope) (*CreateGroupResponse, error)
- func (c *Client) CreateUser(scopes []Scope) (*CreateUserResponse, error)
- func (c *Client) Decrypt(objectID string, ciphertext, associatedData []byte) (*DecryptResponse, error)
- func (c *Client) Delete(oid string) error
- func (c *Client) Encrypt(plaintext, associatedData []byte) (*EncryptResponse, error)
- func (c *Client) GetPermissions(oid string) (*GetPermissionsResponse, error)
- func (c *Client) GetTokenExpiration() time.Time
- func (c *Client) Health() (*HealthResponse, error)
- func (c *Client) LoginUser(uid, password string) error
- func (c *Client) RemovePermission(oid, target string) error
- func (c *Client) RemoveUser(uid string) error
- func (c *Client) RemoveUserFromGroup(uid, gid string) error
- func (c *Client) Retrieve(oid string) (*RetrieveResponse, error)
- func (c *Client) SetToken(token string)
- func (c *Client) Store(plaintext, associatedData []byte) (*StoreResponse, error)
- func (c *Client) Update(oid string, plaintext, associatedData []byte) error
- func (c *Client) Version() (*VersionResponse, error)
- type ClientWR
- func (c *ClientWR) AddPermission(oid, target string) error
- func (c *ClientWR) AddUserToGroup(uid, gid string) error
- func (c *ClientWR) CreateGroup(scopes []Scope) (*CreateGroupResponse, error)
- func (c *ClientWR) CreateUser(scopes []Scope) (*CreateUserResponse, error)
- func (c *ClientWR) Decrypt(objectID string, ciphertext, associatedData []byte) (*DecryptResponse, error)
- func (c *ClientWR) Delete(oid string) error
- func (c *ClientWR) Encrypt(plaintext, associatedData []byte) (*EncryptResponse, error)
- func (c *ClientWR) GetPermissions(oid string) (*GetPermissionsResponse, error)
- func (c *ClientWR) Health() (*HealthResponse, error)
- func (c *ClientWR) LoginUser(uid, password string) error
- func (c *ClientWR) RemovePermission(oid, target string) error
- func (c *ClientWR) RemoveUser(uid string) error
- func (c *ClientWR) RemoveUserFromGroup(uid, gid string) error
- func (c *ClientWR) Retrieve(oid string) (*RetrieveResponse, error)
- func (c *ClientWR) Store(plaintext, associatedData []byte) (*StoreResponse, error)
- func (c *ClientWR) Update(oid string, plaintext, associatedData []byte) error
- func (c *ClientWR) Version() (*VersionResponse, error)
- type CreateGroupResponse
- type CreateUserResponse
- type DecryptResponse
- type EncryptResponse
- type GetPermissionsResponse
- type HealthResponse
- type RetrieveResponse
- type Scope
- type StoreResponse
- type VersionResponse
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 for making gRPC calls to the Encryptonize service.
func NewClient ¶
NewClient creates a new Encryptonize client. Note that in order to call endpoints that require authentication, you need to call `LoginUser` first.
func (*Client) AddPermission ¶
AddPermission grants permission for the `target` to the requested object.
func (*Client) AddUserToGroup ¶
AddUserToGroup adds a user to a group.
func (*Client) CreateGroup ¶
func (c *Client) CreateGroup(scopes []Scope) (*CreateGroupResponse, error)
CreateGroup creates a new Encryptonize group with the requested scopes.
func (*Client) CreateUser ¶
func (c *Client) CreateUser(scopes []Scope) (*CreateUserResponse, error)
CreateUser creates a new Encryptonize user with the requested scopes.
func (*Client) Decrypt ¶
func (c *Client) Decrypt(objectID string, ciphertext, associatedData []byte) (*DecryptResponse, error)
Decrypt decrypts a previously encrypted `ciphertext` and verifies the integrity of the `ciphertext` and `associatedData`.
func (*Client) Encrypt ¶
func (c *Client) Encrypt(plaintext, associatedData []byte) (*EncryptResponse, error)
Encrypt encrypts the `plaintext` and tags both `plaintext` and `associatedData` returning the resulting ciphertext.
func (*Client) GetPermissions ¶
func (c *Client) GetPermissions(oid string) (*GetPermissionsResponse, error)
GetPermissions returns a list of IDs that have access to the requested object.
func (*Client) GetTokenExpiration ¶
GetTokenExpiration returns when the current token wil expire.
func (*Client) Health ¶
func (c *Client) Health() (*HealthResponse, error)
Health retrieves the current health status of the Encryptonize service.
func (*Client) LoginUser ¶
LoginUser authenticates to the Encryptonize service with the given credentials and sets the resulting access token for future calls. Call `LoginUser` again to switch to a different user.
func (*Client) RemovePermission ¶
RemovePermission removes permissions for the `target` to the requested object.
func (*Client) RemoveUser ¶
RemoveUser removes a user from the Encryptonize service.
func (*Client) RemoveUserFromGroup ¶
RemoveUserFromGroup removes a user from a group.
func (*Client) Retrieve ¶
func (c *Client) Retrieve(oid string) (*RetrieveResponse, error)
Retrieve decrypts a previously stored object returning the ciphertext.
func (*Client) Store ¶
func (c *Client) Store(plaintext, associatedData []byte) (*StoreResponse, error)
Store encrypts the `plaintext` and tags both `plaintext` and `associatedData` storing the resulting ciphertext in the Encryptonize service.
func (*Client) Update ¶
Update replaces the currently stored data of an object with the specified `plaintext` and `associatedData`.
func (*Client) Version ¶
func (c *Client) Version() (*VersionResponse, error)
Version retrieves the version information of the Encryptonize service.
type ClientWR ¶
type ClientWR struct { Client // contains filtered or unexported fields }
ClientWR for making gRPC calls to the Encryptonize service while automatically refreshing the access token.
func NewClientWR ¶
NewClientWR creates a new Encryptonize client. In order to switch credentials to another user, use `LoginUser`.
func (*ClientWR) AddPermission ¶
AddPermission grants permission for the `target` to the requested object.
func (*ClientWR) AddUserToGroup ¶
AddUserToGroup adds a user to a group.
func (*ClientWR) CreateGroup ¶
func (c *ClientWR) CreateGroup(scopes []Scope) (*CreateGroupResponse, error)
CreateGroup creates a new Encryptonize group with the requested scopes.
func (*ClientWR) CreateUser ¶
func (c *ClientWR) CreateUser(scopes []Scope) (*CreateUserResponse, error)
CreateUser creates a new Encryptonize user with the requested scopes.
func (*ClientWR) Decrypt ¶
func (c *ClientWR) Decrypt(objectID string, ciphertext, associatedData []byte) (*DecryptResponse, error)
Decrypt decrypts a previously encrypted `ciphertext` and verifies the integrity of the `ciphertext` and `associatedData`.
func (*ClientWR) Encrypt ¶
func (c *ClientWR) Encrypt(plaintext, associatedData []byte) (*EncryptResponse, error)
Encrypt encrypts the `plaintext` and tags both `plaintext` and `associatedData` returning the resulting ciphertext.
func (*ClientWR) GetPermissions ¶
func (c *ClientWR) GetPermissions(oid string) (*GetPermissionsResponse, error)
GetPermissions returns a list of IDs that have access to the requested object.
func (*ClientWR) Health ¶
func (c *ClientWR) Health() (*HealthResponse, error)
Health retrieves the current health status of the Encryptonize service.
func (*ClientWR) LoginUser ¶
LoginUser authenticates to the Encryptonize service with the given credentials and sets the resulting access token for future calls. Call `LoginUser` again to switch to a different user.
func (*ClientWR) RemovePermission ¶
RemovePermission removes permissions for the `target` to the requested object.
func (*ClientWR) RemoveUser ¶
RemoveUser removes a user from the Encryptonize service.
func (*ClientWR) RemoveUserFromGroup ¶
RemoveUserFromGroup removes a user from a group.
func (*ClientWR) Retrieve ¶
func (c *ClientWR) Retrieve(oid string) (*RetrieveResponse, error)
Retrieve decrypts a previously stored object returning the ciphertext.
func (*ClientWR) Store ¶
func (c *ClientWR) Store(plaintext, associatedData []byte) (*StoreResponse, error)
Store encrypts the `plaintext` and tags both `plaintext` and `associatedData` storing the resulting ciphertext in the Encryptonize service.
func (*ClientWR) Update ¶
Update replaces the currently stored data of an object with the specified `plaintext` and `associatedData`.
func (*ClientWR) Version ¶
func (c *ClientWR) Version() (*VersionResponse, error)
Version retrieves the version information of the Encryptonize service.
type CreateGroupResponse ¶
type CreateGroupResponse struct {
GroupID string `json:"groupId"`
}
type CreateUserResponse ¶
type DecryptResponse ¶
type EncryptResponse ¶
type GetPermissionsResponse ¶
type GetPermissionsResponse struct {
GroupIDs []string `json:"groupIds"`
}
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
}
type RetrieveResponse ¶
type StoreResponse ¶
type StoreResponse struct {
ObjectID string `json:"objectId"`
}