keyhub

package
v0.0.0-...-c3d8e25 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

README

go-keyhub - Topicus KeyHub API Client

How to use

Gopkg.toml:

[[constraint]]
name = "github.com/topicusonderwijs/keyhub-sdk"
import "github.com/topicusonderwijs/keyhub-sdk/go-keyhub"
How to develop
  • Dependencies: dep ensure
  • Code formatting: gofmt -s -w .

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Version *VersionService
	Groups  *GroupService
	Vaults  *VaultService
}

func NewClient

func NewClient(httpClient *http.Client, issuer string, clientID string, clientSecret string) (*Client, error)

type Group

type Group struct {
	UUID  string `json:"uuid"`
	Name  string `json:"name:`
	Links []struct {
		ID   int    `json:"id"`
		Rel  string `json:"rel"`
		Type string `json:"type"`
		Href string `json:"href"`
	} `json:"links"`
}

type GroupParams

type GroupParams struct {
	UUID string `url:"uuid,omitempty"`
}

type GroupService

type GroupService struct {
	// contains filtered or unexported fields
}

func (*GroupService) Get

func (s *GroupService) Get(uuid string) (g *Group, err error)

func (*GroupService) List

func (s *GroupService) List() (groups []Group, err error)

type Transport

type Transport struct {
	Base http.RoundTripper
}

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

Based on oauth2.Transport.RoundTrip()

type VaultParams

type VaultParams struct {
	Additional string `url:"additional,omitempty"`
}

type VaultRecord

type VaultRecord struct {
	UUID     string   `json:"uuid"`
	Name     string   `json:"name"`
	Username string   `json:"username"`
	Color    string   `json:"color"`
	Filename string   `json:"filename"`
	Types    []string `json:"types"`
	Links    []struct {
		ID   int    `json:"id"`
		Href string `json:"href"`
	} `json:"links"`
	AdditionalObjects struct {
		Secret struct {
			Password string `json:"password"`
			File     []byte `json:"file"`
			Comment  string `json:"comment"`
		} `json:"secret"`
	} `json:"additionalObjects"`
}

func (*VaultRecord) Comment

func (r *VaultRecord) Comment() string

func (*VaultRecord) File

func (r *VaultRecord) File() []byte

func (*VaultRecord) Password

func (r *VaultRecord) Password() string

type VaultService

type VaultService struct {
	// contains filtered or unexported fields
}

func (*VaultService) GetRecord

func (s *VaultService) GetRecord(group *Group, uuid string) (record *VaultRecord, err error)

Retrieve a vault record by uuid for a certain group, including secrets

func (*VaultService) GetRecords

func (s *VaultService) GetRecords(g *Group) (records []VaultRecord, err error)

Retrieve all vault records for a group (secrets are not included)

type Version

type Version struct {
	KeyhubVersion    string `json:"keyHubVersion"`
	ContractVersions []int  `json:"contractVersions"`
}

type VersionService

type VersionService struct {
	// contains filtered or unexported fields
}

func (*VersionService) Get

func (s *VersionService) Get() (v *Version, err error)

Jump to

Keyboard shortcuts

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