Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateSecret(recipientFingerprint fpr.Fingerprint, armoredEncryptedSecret string) error
- func (c *Client) DeleteRequestToJoinTeam(teamUUID uuid.UUID, requestUUID uuid.UUID) error
- func (c *Client) DeleteSecret(fingerprint fpr.Fingerprint, uuid string) error
- func (c *Client) GetPublicKey(email string) (string, error)
- func (c *Client) GetPublicKeyByFingerprint(fingerprint fpr.Fingerprint) (*pgpkey.PgpKey, error)
- func (c *Client) GetTeamName(teamUUID uuid.UUID) (string, error)
- func (c *Client) GetTeamRoster(teamUUID uuid.UUID, me fpr.Fingerprint) (roster string, signature string, err error)
- func (c *Client) ListRequestsToJoinTeam(teamUUID uuid.UUID, fingerprint fpr.Fingerprint) (requestsToJoinTeam []team.RequestToJoinTeam, err error)
- func (c *Client) ListSecrets(fingerprint fpr.Fingerprint) ([]v1structs.Secret, error)
- func (c *Client) Log(event Event) error
- func (c *Client) RequestToJoinTeam(teamUUID uuid.UUID, fingerprint fpr.Fingerprint, email string) (err error)
- func (c *Client) UpsertPublicKey(armoredPublicKey string, privateKey *pgpkey.PgpKey) error
- func (c *Client) UpsertTeam(roster string, rosterSignature string, signerFingerprint fpr.Fingerprint) error
- type Event
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPublicKeyNotFound means the response was OK, but no key was found ErrPublicKeyNotFound = fmt.Errorf("Public key not found") // ErrTeamNotFound means the response was OK, but no team was found ErrTeamNotFound = fmt.Errorf("Team not found") // ErrForbidden means the given user doesn't have access to the given resource, for example // the requester key isn't a member of a requested team. ErrForbidden = fmt.Errorf("Forbidden") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL *url.URL // Base URL for API requests UserAgent string // User agent used when communicating with the API. // contains filtered or unexported fields }
A Client manages communication with the Fluidkeys Server API.
func (*Client) CreateSecret ¶
func (c *Client) CreateSecret(recipientFingerprint fpr.Fingerprint, armoredEncryptedSecret string) error
CreateSecret creates a secret for the given recipient
func (*Client) DeleteRequestToJoinTeam ¶
DeleteRequestToJoinTeam deletes a request to join a team
func (*Client) DeleteSecret ¶
func (c *Client) DeleteSecret(fingerprint fpr.Fingerprint, uuid string) error
DeleteSecret deletes a secret
func (*Client) GetPublicKey ¶
GetPublicKey attempts to get a single armored public key.
func (*Client) GetPublicKeyByFingerprint ¶
GetPublicKeyByFingerprint attempts to get a single armored public key.
func (*Client) GetTeamName ¶
GetTeamName attempts to get the team name
func (*Client) GetTeamRoster ¶
func (c *Client) GetTeamRoster(teamUUID uuid.UUID, me fpr.Fingerprint) ( roster string, signature string, err error)
GetTeamRoster attempts to get the team roster and signature for the given UUID. The API responds with encrypted JSON, so it tries to decrypt this using the requestingKey.
func (*Client) ListRequestsToJoinTeam ¶
func (c *Client) ListRequestsToJoinTeam(teamUUID uuid.UUID, fingerprint fpr.Fingerprint) ( requestsToJoinTeam []team.RequestToJoinTeam, err error)
ListRequestsToJoinTeam for the team with the given UUID.
func (*Client) ListSecrets ¶
ListSecrets for a particular fingerprint.
func (*Client) Log ¶
Log sends an event to the API. The event is sent in a goroutine so it doesn't block the main thread.
func (*Client) RequestToJoinTeam ¶
func (c *Client) RequestToJoinTeam( teamUUID uuid.UUID, fingerprint fpr.Fingerprint, email string) (err error)
RequestToJoinTeam posts a request to join the team identified by the UUID with the given fingerprint and email
func (*Client) UpsertPublicKey ¶
UpsertPublicKey creates or updates a public key in the Fluidkeys Directory. It requires privateKey to ensure that only the owner of the public key can upload it.
func (*Client) UpsertTeam ¶
func (c *Client) UpsertTeam(roster string, rosterSignature string, signerFingerprint fpr.Fingerprint) error
UpsertTeam takes a roster, signature and fingerprint to sign the request and attempts to create a secret for the given recipient
type Event ¶
type Event struct { Name string // Fingerprint is the key that this event relates to, if any. Fingerprint *fp.Fingerprint // TeamUUID is the team that this event relates to, if any. TeamUUID *uuid.UUID // Error is the error associated with this event, or nil if no error. Error error }
Event contains data to be uploaded and stored in the API