onepassword

package
v0.0.0-...-76df578 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GroupResource is 1Password's internal designator for Groups
	GroupResource = "group"

	// GroupStateActive indicates an Active Group
	GroupStateActive = "A"

	// GroupStateDeleted indicates a Deleted Group
	GroupStateDeleted = "D"
)
View Source
const DocumentResource = "document"
View Source
const ItemResource = "item"
View Source
const VaultResource = "vault"

Variables

This section is empty.

Functions

func Category2Template

func Category2Template(c Category) string

func ParseTags

func ParseTags(d *schema.ResourceData) []string

func ProcessField

func ProcessField(srcFields []SectionField) []map[string]interface{}

func ProcessSections

func ProcessSections(srcSections []Section) []map[string]interface{}

func Provider

func Provider() terraform.ResourceProvider

func ToSnakeCase

func ToSnakeCase(str string) string

Types

type Address

type Address struct {
	City    string `json:"city"`
	Country string `json:"country"`
	Region  string `json:"region"`
	State   string `json:"state"`
	Street  string `json:"street"`
	Zip     string `json:"zip"`
}

type Annotation

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

type Category

type Category string
const (
	LoginCategory                Category = "Login"
	IdentityCategory             Category = "Identity"
	DatabaseCategory             Category = "Database"
	MembershipCategory           Category = "Membership"
	WirelessRouterCategory       Category = "Wireless Router"
	SecureNoteCategory           Category = "Secure Note"
	SoftwareLicenseCategory      Category = "Software License"
	CreditCardCategory           Category = "Credit Card"
	DriverLicenseCategory        Category = "Driver License"
	OutdoorLicenseCategory       Category = "Outdoor License"
	PassportCategory             Category = "Passport"
	EmailAccountCategory         Category = "Email Account"
	PasswordCategory             Category = "Password"
	RewardProgramCategory        Category = "Reward Program"
	SocialSecurityNumberCategory Category = "Social Security Number"
	BankAccountCategory          Category = "Bank Account"
	DocumentCategory             Category = "Document"
	ServerCategory               Category = "Server"
	UnknownCategory              Category = "UNKNOWN"
)

func Template2Category

func Template2Category(t string) Category

type Details

type Details struct {
	Notes    string    `json:"notesPlain"`
	Password string    `json:"password"`
	Fields   []Field   `json:"fields"`
	Sections []Section `json:"sections"`
}

type Field

type Field struct {
	Type        FieldType `json:"type"`
	Designation string    `json:"designation"`
	Name        string    `json:"name"`
	Value       string    `json:"value"`
}

type FieldType

type FieldType string
const (
	FieldPassword FieldType = "P"
	FieldText     FieldType = "T"
)

type Group

type Group struct {
	UUID  string
	Name  string
	State string
}

Group represents a 1Password Group resource

type Item

type Item struct {
	UUID     string   `json:"uuid"`
	Template string   `json:"templateUUID"`
	Vault    string   `json:"vaultUUID"`
	Overview Overview `json:"overview"`
	Details  Details  `json:"details"`
}

type Meta

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

func NewMeta

func NewMeta(d *schema.ResourceData) (*Meta, error)

func (*Meta) NewOnePassClient

func (m *Meta) NewOnePassClient() (*OnePassClient, error)

type OnePassClient

type OnePassClient struct {
	Password  string
	Email     string
	SecretKey string
	Subdomain string
	PathToOp  string
	Session   string
	// contains filtered or unexported fields
}

func (*OnePassClient) CreateDocument

func (o *OnePassClient) CreateDocument(v *Item, filePath string) error

func (*OnePassClient) CreateGroup

func (o *OnePassClient) CreateGroup(v *Group) (*Group, error)

CreateGroup creates a new 1Password Group

func (*OnePassClient) CreateItem

func (o *OnePassClient) CreateItem(v *Item) error

func (*OnePassClient) CreateVault

func (o *OnePassClient) CreateVault(v *Vault) (*Vault, error)

func (*OnePassClient) Delete

func (o *OnePassClient) Delete(resource string, id string) error

func (*OnePassClient) DeleteGroup

func (o *OnePassClient) DeleteGroup(id string) error

DeleteGroup deletes a 1Password Group

func (*OnePassClient) DeleteItem

func (o *OnePassClient) DeleteItem(id string) error

func (*OnePassClient) DeleteVault

func (o *OnePassClient) DeleteVault(id string) error

func (*OnePassClient) ReadDocument

func (o *OnePassClient) ReadDocument(id string) (string, error)

func (*OnePassClient) ReadGroup

func (o *OnePassClient) ReadGroup(id string) (*Group, error)

ReadGroup gets an existing 1Password Group

func (*OnePassClient) ReadItem

func (o *OnePassClient) ReadItem(id string, vaultID string) (*Item, error)

func (*OnePassClient) ReadVault

func (o *OnePassClient) ReadVault(id string) (*Vault, error)

func (*OnePassClient) SignIn

func (o *OnePassClient) SignIn() error

type Overview

type Overview struct {
	Title string   `json:"title"`
	URL   string   `json:"url"`
	Tags  []string `json:"tags"`
}

type Resource

type Resource struct {
	UUID string `json:"uuid"`
}

type Section

type Section struct {
	Name   string         `json:"name"`
	Title  string         `json:"title"`
	Fields []SectionField `json:"fields"`
}

func ParseSections

func ParseSections(d *schema.ResourceData) []Section

type SectionField

type SectionField struct {
	Type   SectionFieldType  `json:"k"`
	Text   string            `json:"t"`
	Value  interface{}       `json:"v"`
	N      string            `json:"n"`
	A      Annotation        `json:"a"`
	Inputs map[string]string `json:"inputTraits"`
}

func ParseField

func ParseField(fl map[string]interface{}) SectionField

func ParseFields

func ParseFields(s map[string]interface{}) []SectionField

type SectionFieldType

type SectionFieldType string
const (
	TypeSex       SectionFieldType = "menu"
	TypeCard      SectionFieldType = "cctype"
	TypeAddress   SectionFieldType = "address"
	TypeString    SectionFieldType = "string"
	TypeURL       SectionFieldType = "URL"
	TypeEmail     SectionFieldType = "email"
	TypeDate      SectionFieldType = "date"
	TypeMonthYear SectionFieldType = "monthYear"
	TypeConcealed SectionFieldType = "concealed"
	TypePhone     SectionFieldType = "phone"
	TypeReference SectionFieldType = "reference"
)

type SectionGroup

type SectionGroup struct {
	Selector string
	Name     string
	Fields   map[string]string
}

type Vault

type Vault struct {
	UUID string
	Name string
}

Jump to

Keyboard shortcuts

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