clients

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENROLL         = "/enroll"
	VerifyPassword = "/verify-password"

	InsertUser            = "/insert-user"
	UpdateUser            = "/update-user"
	GetUser               = "/get-user"
	GetUsers              = "/get-users"
	DeleteUser            = "/delete-user"
	InsertCellKey         = "/insert-cell-key"
	UpdateCellKey         = "/update-cell-key"
	GetCellKey            = "/get-cell-key"
	DeleteCellKey         = "/delete-cell-key"
	InsertRole            = "/insert-role"
	GetRoles              = "/get-roles"
	InsertRoleAssignments = "/role-assignments"
	GetRoleAssignments    = "/get-role-assignments"
	GetRoleAssignment     = "/get-role-assignment"
	DeleteRoleAssignments = "/delete-role-assignments"
	InsertGrantKey        = "/insert-grant-key"
	GetGrantKey           = "/get-grant-key"
	DeleteGrantKey        = "/delete-grant-key"

	DecryptRequest = "/decrypt"
)
View Source
const (
	KmsAPIURL = "https://api.virgilsecurity.com/kms/v1"
)
View Source
const (
	PheAPIURL = "https://api.virgilsecurity.com/phe/v1"
)
View Source
const (
	PureAPIURL = "https://api.virgilsecurity.com/pure/v1"
)

Variables

This section is empty.

Functions

func DefaultErrorHandler

func DefaultErrorHandler(resp *client.Response) error

Types

type Client

type Client struct {
	AppToken   string
	URL        string
	HTTPClient *client.Client
	// contains filtered or unexported fields
}

type KmsClient

type KmsClient struct {
	*Client
}

KmsClient implements API request layer

func (*KmsClient) Decrypt

func (c *KmsClient) Decrypt(req *protos.DecryptRequest) (resp *protos.DecryptResponse, err error)

type PheClient

type PheClient struct {
	*Client
}

PheClient implements API request layer

func (*PheClient) GetEnrollment

func (c *PheClient) GetEnrollment(req *protos.EnrollmentRequest) (resp *protos.EnrollmentResponse, err error)

GetEnrollment receives random enrollment from service

func (*PheClient) VerifyPassword

func (c *PheClient) VerifyPassword(req *protos.VerifyPasswordRequest) (resp *protos.VerifyPasswordResponse, err error)

VerifyPassword does not send password to server, only the part tat server provided in GetEnrollment

type ProtobufCodec

type ProtobufCodec struct{}

func (*ProtobufCodec) Marshal

func (c *ProtobufCodec) Marshal(obj interface{}) (body []byte, err error)

func (*ProtobufCodec) Name

func (c *ProtobufCodec) Name() string

func (*ProtobufCodec) Unmarshal

func (c *ProtobufCodec) Unmarshal(data []byte, obj interface{}) error

type PureClient

type PureClient struct {
	*Client
}

PureClient implements API request layer

func (*PureClient) DeleteCellKey

func (c *PureClient) DeleteCellKey(req *protos.UserIdAndDataIdRequest) (err error)

func (*PureClient) DeleteGrantKey

func (c *PureClient) DeleteGrantKey(req *protos.GrantKeyDescriptor) (err error)

func (*PureClient) DeleteRoleAssignments

func (c *PureClient) DeleteRoleAssignments(req *protos.DeleteRoleAssignments) (err error)

func (*PureClient) DeleteUser

func (c *PureClient) DeleteUser(req *protos.UserIdRequest, cascade bool) (err error)

func (*PureClient) GetCellKey

func (c *PureClient) GetCellKey(req *protos.UserIdAndDataIdRequest) (resp *protos.CellKey, err error)

func (*PureClient) GetGrantKey

func (c *PureClient) GetGrantKey(req *protos.GrantKeyDescriptor) (resp *protos.GrantKey, err error)

func (*PureClient) GetRoleAssignment

func (c *PureClient) GetRoleAssignment(req *protos.GetRoleAssignment) (resp *protos.RoleAssignment, err error)

func (*PureClient) GetRoleAssignments

func (c *PureClient) GetRoleAssignments(req *protos.GetRoleAssignments) (resp *protos.RoleAssignments, err error)

func (*PureClient) GetRoles

func (c *PureClient) GetRoles(req *protos.GetRoles) (resp *protos.Roles, err error)

func (*PureClient) GetUser

func (c *PureClient) GetUser(req *protos.UserIdRequest) (resp *protos.UserRecord, err error)

func (*PureClient) GetUsers

func (c *PureClient) GetUsers(userIds ...string) (resp *protos.UserRecords, err error)

func (*PureClient) InsertCellKey

func (c *PureClient) InsertCellKey(req *protos.CellKey) (err error)

func (*PureClient) InsertGrantKey

func (c *PureClient) InsertGrantKey(req *protos.GrantKey) (err error)

func (*PureClient) InsertRole

func (c *PureClient) InsertRole(req *protos.Role) (err error)

func (*PureClient) InsertRoleAssignments

func (c *PureClient) InsertRoleAssignments(req *protos.RoleAssignments) (err error)

func (*PureClient) InsertUser

func (c *PureClient) InsertUser(req *protos.UserRecord) (err error)

func (*PureClient) UpdateCellKey

func (c *PureClient) UpdateCellKey(req *protos.CellKey) (err error)

func (*PureClient) UpdateUser

func (c *PureClient) UpdateUser(req *protos.UserRecord) (err error)

Jump to

Keyboard shortcuts

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