api

package
v0.0.0-...-c0ddbc9 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTermination = "Subscription end date + 1 year"
)

Functions

This section is empty.

Types

type ConsentReceipt

type ConsentReceipt struct {
	Version             string                  `json:"version"`
	Jurisdiction        string                  `json:"jurisdiction"`
	ConsentTimestamp    int64                   `json:"consentTimestamp"`
	CollectionMethod    string                  `json:"collectionMethod"`
	ConsentReceiptID    string                  `json:"consentReceiptID"`
	PublicKey           string                  `json:"publicKey,omitempty"`
	Language            string                  `json:"language,omitempty"`
	SubjectID           string                  `json:"piiPrincipalId"`
	DataControllers     []*DataController       `json:"piiControllers"`
	PolicyUrl           string                  `json:"policyURL"`
	Services            []*Service              `json:"services,omitempty"`
	Sensitive           bool                    `json:"sensitive"`
	SensitiveCategories []category.DataCategory `json:"spiCat,omitempty"`
}

func NewConsentReceipt

func NewConsentReceipt() *ConsentReceipt

func (*ConsentReceipt) AddDataController

func (cr *ConsentReceipt) AddDataController(controller *DataController)

func (*ConsentReceipt) AddSensitiveCategory

func (cr *ConsentReceipt) AddSensitiveCategory(category category.DataCategory)

func (*ConsentReceipt) AddService

func (cr *ConsentReceipt) AddService(service *Service)

func (ConsentReceipt) GenerateClaims

func (cr ConsentReceipt) GenerateClaims() ConsentReceiptClaims

func (*ConsentReceipt) GenerateJurisdictions

func (cr *ConsentReceipt) GenerateJurisdictions()

type ConsentReceiptClaims

type ConsentReceiptClaims struct {
	ConsentReceipt *ConsentReceipt `json:"consentReceipt"`
	jwt.StandardClaims
}

type DataController

type DataController struct {
	ControllerName string        `json:"piiController" mapstructure:"name"`
	OnBehalf       bool          `json:"on_behalf,omitempty" mapstructure:"onbehalf"`
	Contact        string        `json:"contact" mapstructure:"contact"`
	Address        PostalAddress `json:"address" mapstructure:"address"`
	Email          string        `json:"email" mapstructure:"email"`
	Phone          string        `json:"phone" mapstructure:"phone"`
	ControllerUrl  string        `json:"piiControllerUrl,omitempty" mapstructure:"url"`
}

func NewDataController

func NewDataController(controllerName string, contactName string, email string, phone string, address PostalAddress) *DataController

func (*DataController) NewConsentReceipt

func (dc *DataController) NewConsentReceipt() *ConsentReceipt

type PostalAddress

type PostalAddress struct {
	Country             string `json:"addressCountry" mapstructure:"country"`
	Locality            string `json:"addressLocality" mapstructure:"city"`
	Region              string `json:"addressRegion,omitempty" mapstructure:"region"`
	PostOfficeBoxNumber string `json:"postOfficeBoxNumber,omitempty" mapstructure:"pobox"`
	PostalCode          string `json:"postalCode" mapstructure:"postalcode"`
	StreetAddress       string `json:"streetAddress" mapstructure:"address"`
}

func NewPostalAddress

func NewPostalAddress(country string, locality string, postalcode string, address string) PostalAddress

type Purpose

type Purpose struct {
	Purpose              string                       `json:"purpose"`
	PurposeCategory      purpose.PurposeSpecification `json:"purposeCategory"`
	ConsentType          string                       `json:"consentType"`
	DataCategory         []category.DataCategory      `json:"piiCategory"`
	PrimaryPurpose       bool                         `json:"primaryPurpose"`
	Termination          string                       `json:"termination"`
	ThirdPartyDisclosure bool                         `json:"thirdPartyDisclosure"`
	ThirdPartyName       string                       `json:"thirdPartyName,omitempty"`

	// Extensions - OAuth scopes associated with this specific purpose of processing
	Scopes string `json:"scopes,omitempty"`
}

func DefaultPurpose

func DefaultPurpose() *Purpose

func NewPurpose

func NewPurpose(spec purpose.PurposeSpecification, categories []category.DataCategory, primaryPurpose bool, termination string) *Purpose

func NewPurposeDescription

func NewPurposeDescription(description string, spec purpose.PurposeSpecification, categories []category.DataCategory, primaryPurpose bool, termination string) *Purpose

func NewPurposeShared

func NewPurposeShared(description string, spec purpose.PurposeSpecification, categories []category.DataCategory, primaryPurpose bool, termination string, thirdPartyName string) *Purpose

func (*Purpose) AddDataCategory

func (p *Purpose) AddDataCategory(cat category.DataCategory)

type Service

type Service struct {
	Service  string     `json:"service"`
	Purposes []*Purpose `json:"purposes"`
}

func NewServiceMultiPurpose

func NewServiceMultiPurpose(serviceName string, purposes []*Purpose) *Service

func NewServiceSinglePurpose

func NewServiceSinglePurpose(serviceName string, purpose *Purpose) *Service

func (*Service) AddPurpose

func (s *Service) AddPurpose(purpose *Purpose)

Directories

Path Synopsis
Lack of explicitly namespaced enums in Go mean we simply hide this in another package, instead
Lack of explicitly namespaced enums in Go mean we simply hide this in another package, instead

Jump to

Keyboard shortcuts

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