Documentation ¶
Index ¶
- Variables
- type Client
- func (a *Client) EndEPPRun(id int64) (errs []error)
- func (a *Client) Get(path string) (data []byte, err error)
- func (a *Client) GetAPIUser(id int64) (outobj *lib.APIUserExportFull, errs []error)
- func (a *Client) GetAPIUserAt(id int64, ts int64) (outobj *lib.APIUserExportFull, errs []error)
- func (a *Client) GetAPIUserRevision(id int64) (outobj *lib.APIUserRevisionExport, errs []error)
- func (a *Client) GetAPIUserRevisionAt(id int64, ts int64) (outobj *lib.APIUserRevisionExport, errs []error)
- func (a *Client) GetAll(objectType string) (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
- func (a *Client) GetApproval(approvalID int64, approverID int64, action string) (approvalObject []byte, errs []error)
- func (a *Client) GetApprovalObject(id int64) (outobj *lib.ApprovalExport, errs []error)
- func (a *Client) GetApprovalObjectAt(id int64, ts int64) (outobj *lib.ApprovalExport, errs []error)
- func (a *Client) GetApprover(id int64) (outobj *lib.ApproverExportFull, errs []error)
- func (a *Client) GetApproverAt(id int64, ts int64) (outobj *lib.ApproverExportFull, errs []error)
- func (a *Client) GetApproverRevision(id int64) (outobj *lib.ApproverRevisionExport, errs []error)
- func (a *Client) GetApproverRevisionAt(id int64, ts int64) (outobj *lib.ApproverRevisionExport, errs []error)
- func (a *Client) GetApproverSet(id int64) (outobj *lib.ApproverSetExportFull, errs []error)
- func (a *Client) GetApproverSetAt(id int64, ts int64) (outobj *lib.ApproverSetExportFull, errs []error)
- func (a *Client) GetApproverSetRevision(id int64) (outobj *lib.ApproverSetRevisionExport, errs []error)
- func (a *Client) GetApproverSetRevisionAt(id int64, ts int64) (outobj *lib.ApproverSetRevisionExport, errs []error)
- func (a *Client) GetChangeRequest(id int64) (outobj *lib.ChangeRequestExport, errs []error)
- func (a *Client) GetChangeRequestAt(id int64, ts int64) (outobj *lib.ChangeRequestExport, errs []error)
- func (a *Client) GetContact(id int64) (outobj *lib.ContactExport, errs []error)
- func (a *Client) GetContactAt(id int64, ts int64) (outobj *lib.ContactExport, errs []error)
- func (a *Client) GetContactRevision(id int64) (outobj *lib.ContactRevisionExport, errs []error)
- func (a *Client) GetContactRevisionAt(id int64, ts int64) (outobj *lib.ContactRevisionExport, errs []error)
- func (a *Client) GetContactsWork() (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
- func (a *Client) GetDomain(id int64) (outobj *lib.DomainExport, errs []error)
- func (a *Client) GetDomainAt(id int64, ts int64) (outobj *lib.DomainExport, errs []error)
- func (a *Client) GetDomainIDFromName(domainName string) (id int64, errs []error)
- func (a *Client) GetDomainRevision(id int64) (outobj *lib.DomainRevisionExport, errs []error)
- func (a *Client) GetDomainRevisionAt(id int64, ts int64) (outobj *lib.DomainRevisionExport, errs []error)
- func (a *Client) GetDomainsWork() (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
- func (a *Client) GetEncryptedPassphrase(username string) (encryptedPassphrase string, errs []error)
- func (a *Client) GetHost(id int64) (outobj *lib.HostExport, errs []error)
- func (a *Client) GetHostAt(id int64, ts int64) (outobj *lib.HostExport, errs []error)
- func (a *Client) GetHostIPAllowList() (ips []string, errs []error)
- func (a *Client) GetHostRevision(id int64) (outobj *lib.HostRevisionExport, errs []error)
- func (a *Client) GetHostRevisionAt(id int64, ts int64) (outobj *lib.HostRevisionExport, errs []error)
- func (a *Client) GetHostsWork() (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
- func (a *Client) GetIDList(url string) (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
- func (a *Client) GetObject(objectType string, id int64, lastUpdate *time.Time) (outObj lib.RegistrarObjectExport, errs []error)
- func (a *Client) GetObjectAt(objectType string, id int64, ts int64) (outObj lib.RegistrarObjectExport, errs []error)
- func (a *Client) GetProtectedDomainList() (domains []string, errs []error)
- func (a *Client) GetSig(approvalID int64) (sigBytes []byte, errs []error)
- func (a *Client) GetToken() (token string, errs []error)
- func (a *Client) GetVerifiedApprover(approverID int64, timestamp int64) (verified bool, errs []error, obj *lib.ApproverExportFull)
- func (a *Client) GetVerifiedApproverSet(approverSetID int64, timestamp int64) (verified bool, errs []error, obj *lib.ApproverSetExportFull)
- func (a *Client) GetVerifiedContact(contactID int64, timestamp int64) (verified bool, errs []error, obj *lib.ContactExport)
- func (a *Client) GetVerifiedDomain(domainID int64, timestamp int64) (verified bool, errs []error, obj *lib.DomainExport)
- func (a *Client) GetVerifiedHost(hostID int64, timestamp int64) (verified bool, errs []error, obj *lib.HostExport)
- func (a *Client) GetWHOIS(defaultContactID int64) (objects.WHOIS, []error)
- func (a *Client) GetWork(objectType string) (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
- func (a *Client) Post(path string, bodyType string, body io.Reader) (*http.Response, error)
- func (a *Client) Prepare(base string, log *logging.Logger, dcc DiskCacheConfig)
- func (a *Client) PrepareObjectDirectory() (errs []error)
- func (a *Client) PrepareSSL(base, certFile, keyFile, caFile string, keychainConf keychain.Conf, ...)
- func (a *Client) PushContactRegistryID(objectID int64, token string, registryID string) (errs []error)
- func (a *Client) PushEPPActionLog(action lib.EPPAction) (errs []error)
- func (a *Client) PushHostIPAllowList(ips []string, token string) (errs []error)
- func (a *Client) PushInfoEPP(objectType string, objectID int64, info *epp.Response) (errs []error)
- func (a *Client) PushProtectedDomainList(domains []string, token string) (errs []error)
- func (a *Client) PushSig(approvalID int64, sigData []byte, token string) (errs []error)
- func (a *Client) RequestNewEPPRunID() (id int64, errs []error)
- func (a *Client) SetEncryptedPassphrase(username string, encryptedPassphrase string) (errs []error)
- func (a *Client) SetLogger(logger *logging.Logger)
- func (a *Client) SpoofCertificateForTesting(cert string, headername string)
- func (a *Client) UnsetEPPCheck(objectType string, objectID int64) (errs []error)
- func (a *Client) VerifyApproverSet(as *lib.ApproverSetExportFull) (verified bool, obj lib.ApproverSetRevisionExport, errs []error)
- func (a *Client) VerifyChangeRequest(id int64, revision lib.RegistrarObjectExport) (verified bool, errs []error, signedData []byte)
- type DiskCache
- func (d *DiskCache) GetObject(objType string, id int64, lastUpdate *time.Time) (outObj lib.RegistrarObjectExport, errs []error)
- func (d *DiskCache) GetObjectAt(objectType string, id int64, timestamp int64, od ObjectDirectory) (outObj lib.RegistrarObjectExport, errs []error)
- func (d *DiskCache) SaveObject(resp lib.APIResponse) error
- func (d *DiskCache) SaveObjectAt(resp lib.APIResponse, id int64, timestamp int64) error
- func (d *DiskCache) UpdateRevisionList(objectType string, objectID int64, revisionID int64, ts int64) error
- type DiskCacheConfig
- type ObjectCache
- type ObjectDirectory
- type ObjectInfo
- type RevisionValidity
- type TrustAnchors
- func (t *TrustAnchors) AddKey(key string) error
- func (t TrustAnchors) DecryptionKeys() (keys []openpgp.Key)
- func (t TrustAnchors) IsSignedBy(sig []byte) (valid bool, signedBody []byte)
- func (t TrustAnchors) KeysById(id uint64) (keys []openpgp.Key)
- func (t TrustAnchors) KeysByIdUsage(id uint64, requiredUsage byte) (keys []openpgp.Key)
Constants ¶
This section is empty.
Variables ¶
var ErrUnexpectedObject = errors.New("unexpected object")
ErrUnexpectedObject represents an unexpected object type received
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { TrustAnchor TrustAnchors ObjectDir ObjectDirectory // contains filtered or unexported fields }
Client is an object that will hold the required state to communicate with the registrar server
func (*Client) EndEPPRun ¶
EndEPPRun is used to end an epp run. If the process of ending the run fails an error will be returned.
func (*Client) Get ¶
Get will send a request to the server using the current client and return a respose and error, similar to the response from http.Client.Get
func (*Client) GetAPIUser ¶
func (a *Client) GetAPIUser(id int64) (outobj *lib.APIUserExportFull, errs []error)
GetAPIUser will try and retrieve a domain object from the server
func (*Client) GetAPIUserAt ¶
GetAPIUserAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetAPIUserRevision ¶
func (a *Client) GetAPIUserRevision(id int64) (outobj *lib.APIUserRevisionExport, errs []error)
GetAPIUserRevision will try and retrieve a domain object from the server
func (*Client) GetAPIUserRevisionAt ¶
func (a *Client) GetAPIUserRevisionAt(id int64, ts int64) (outobj *lib.APIUserRevisionExport, errs []error)
GetAPIUserRevisionAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetAll ¶
func (a *Client) GetAll(objectType string) (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
GetAll will try to retrieve a list of all IDs for objects that are in an active state or require work to be done
func (*Client) GetApproval ¶
func (a *Client) GetApproval(approvalID int64, approverID int64, action string) (approvalObject []byte, errs []error)
GetApproval will try to retrieve an approval from the registrar server given the approval ID and the desired approver id
func (*Client) GetApprovalObject ¶
func (a *Client) GetApprovalObject(id int64) (outobj *lib.ApprovalExport, errs []error)
GetApprovalObject will try and retrieve a domain object from the server
func (*Client) GetApprovalObjectAt ¶
GetApprovalObjectAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetApprover ¶
func (a *Client) GetApprover(id int64) (outobj *lib.ApproverExportFull, errs []error)
GetApprover will try and retrieve a domain object from the server
func (*Client) GetApproverAt ¶
GetApproverAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetApproverRevision ¶
func (a *Client) GetApproverRevision(id int64) (outobj *lib.ApproverRevisionExport, errs []error)
GetApproverRevision will try and retrieve a domain object from the server
func (*Client) GetApproverRevisionAt ¶
func (a *Client) GetApproverRevisionAt(id int64, ts int64) (outobj *lib.ApproverRevisionExport, errs []error)
GetApproverRevisionAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetApproverSet ¶
func (a *Client) GetApproverSet(id int64) (outobj *lib.ApproverSetExportFull, errs []error)
GetApproverSet will try and retrieve a domain object from the server
func (*Client) GetApproverSetAt ¶
func (a *Client) GetApproverSetAt(id int64, ts int64) (outobj *lib.ApproverSetExportFull, errs []error)
GetApproverSetAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetApproverSetRevision ¶
func (a *Client) GetApproverSetRevision(id int64) (outobj *lib.ApproverSetRevisionExport, errs []error)
GetApproverSetRevision will try and retrieve a domain object from the server
func (*Client) GetApproverSetRevisionAt ¶
func (a *Client) GetApproverSetRevisionAt(id int64, ts int64) (outobj *lib.ApproverSetRevisionExport, errs []error)
GetApproverSetRevisionAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetChangeRequest ¶
func (a *Client) GetChangeRequest(id int64) (outobj *lib.ChangeRequestExport, errs []error)
GetChangeRequest will try and retrieve a change request object from the server
func (*Client) GetChangeRequestAt ¶
func (a *Client) GetChangeRequestAt(id int64, ts int64) (outobj *lib.ChangeRequestExport, errs []error)
GetChangeRequestAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetContact ¶
func (a *Client) GetContact(id int64) (outobj *lib.ContactExport, errs []error)
GetContact will try and retrieve a domain object from the server
func (*Client) GetContactAt ¶
GetContactAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetContactRevision ¶
func (a *Client) GetContactRevision(id int64) (outobj *lib.ContactRevisionExport, errs []error)
GetContactRevision will try and retrieve a domain object from the server
func (*Client) GetContactRevisionAt ¶
func (a *Client) GetContactRevisionAt(id int64, ts int64) (outobj *lib.ContactRevisionExport, errs []error)
GetContactRevisionAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetContactsWork ¶
GetContactsWork will try to retrieve a list of contacts IDs that have work to be done
func (*Client) GetDomain ¶
func (a *Client) GetDomain(id int64) (outobj *lib.DomainExport, errs []error)
GetDomain will try and retrieve a domain object from the server
func (*Client) GetDomainAt ¶
GetDomainAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetDomainIDFromName ¶
GetDomainIDFromName will attempt to find the domain ID from the domain name provided. If a domain object is found, its id will be returned, otherwise an error will be returned
func (*Client) GetDomainRevision ¶
func (a *Client) GetDomainRevision(id int64) (outobj *lib.DomainRevisionExport, errs []error)
GetDomainRevision will try and retrieve a domain object from the server
func (*Client) GetDomainRevisionAt ¶
func (a *Client) GetDomainRevisionAt(id int64, ts int64) (outobj *lib.DomainRevisionExport, errs []error)
GetDomainRevisionAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetDomainsWork ¶
GetDomainsWork will try to retrieve a list of domains IDs that have work to be done
func (*Client) GetEncryptedPassphrase ¶
GetEncryptedPassphrase will attempt to get the encrypted passphrase from the server based on the username provided. If errors occur when trying to locate the passphrase, they will be returned.
func (*Client) GetHost ¶
func (a *Client) GetHost(id int64) (outobj *lib.HostExport, errs []error)
GetHost will try and retrieve a domain object from the server
func (*Client) GetHostAt ¶
GetHostAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetHostIPAllowList ¶
GetHostIPAllowList will retrieve the list of Host IPs that are allowlisted as they are trusted nameservers
func (*Client) GetHostRevision ¶
func (a *Client) GetHostRevision(id int64) (outobj *lib.HostRevisionExport, errs []error)
GetHostRevision will try and retrieve a domain object from the server
func (*Client) GetHostRevisionAt ¶
func (a *Client) GetHostRevisionAt(id int64, ts int64) (outobj *lib.HostRevisionExport, errs []error)
GetHostRevisionAt will try and retrieve a domain object from the server at the given timestamp
func (*Client) GetHostsWork ¶
GetHostsWork will try to retrieve a list of host IDs that have work to be done
func (*Client) GetIDList ¶
func (a *Client) GetIDList(url string) (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
GetIDList will try to retrieve a list of IDs for the provided object type using the url provided
func (*Client) GetObject ¶
func (a *Client) GetObject(objectType string, id int64, lastUpdate *time.Time) (outObj lib.RegistrarObjectExport, errs []error)
GetObject will try to retrieve an object from the server
func (*Client) GetObjectAt ¶
func (a *Client) GetObjectAt(objectType string, id int64, ts int64) (outObj lib.RegistrarObjectExport, errs []error)
GetObjectAt will try to retrieve an object from the server at a given unix timestamp
func (*Client) GetProtectedDomainList ¶
GetProtectedDomainList will retrieve the list of Protected domains that are stored in the registrar system. If an error is encountered, it will be returned
func (*Client) GetSig ¶
GetSig will try and retireve the signature associated with an approval given an approval ID. If the approval is not signed or another error occurs an error will be retured.
func (*Client) GetToken ¶
GetToken will retrieve a CSRF token from the server for the user that is currently logged in
func (*Client) GetVerifiedApprover ¶
func (a *Client) GetVerifiedApprover(approverID int64, timestamp int64) (verified bool, errs []error, obj *lib.ApproverExportFull)
GetVerifiedApprover will attempt to download and verify an approver with the given ID at the given time. A bool of if the Approver was verified or not, a list of errors and the resulting ApproverExportFull object will be returned. An empty object is returned if the object did not verify.
func (*Client) GetVerifiedApproverSet ¶
func (a *Client) GetVerifiedApproverSet(approverSetID int64, timestamp int64) (verified bool, errs []error, obj *lib.ApproverSetExportFull)
GetVerifiedApproverSet will attempt to download and verify an approver set with the given ID at the given time. A bool of if the Approver Set was verified or not, a list of errors and the resulting ApproverSetExportFull object will be returned. An empty object is returned if the object did not verify
func (*Client) GetVerifiedContact ¶
func (a *Client) GetVerifiedContact(contactID int64, timestamp int64) (verified bool, errs []error, obj *lib.ContactExport)
GetVerifiedContact will attempt to download and verify a Contact with the given ID at the given time. A bool of if the Contact was verified or not, a list of errors and the resulting ContactExport object will be returned. An empty object is returned if the object did not verify.
func (*Client) GetVerifiedDomain ¶
func (a *Client) GetVerifiedDomain(domainID int64, timestamp int64) (verified bool, errs []error, obj *lib.DomainExport)
GetVerifiedDomain will attempt to download and verify a Domain with the given ID at the given time. A bool of if the Domain was verified or not, a list of errors and the resulting DomainExport object will be returned. An empty object is returned if the object did not verify.
func (*Client) GetVerifiedHost ¶
func (a *Client) GetVerifiedHost(hostID int64, timestamp int64) (verified bool, errs []error, obj *lib.HostExport)
GetVerifiedHost will attempt to download and verify a Host with the given ID at the given time. A bool of if the Host was verified or not, a list of errors and the resulting HostExport object will be returned. An empty object is returned if the object did not verify.
func (*Client) GetWHOIS ¶
GetWHOIS creates an objects.WHOIS object that can be serialized and installed on a WHOIS server
func (*Client) GetWork ¶
func (a *Client) GetWork(objectType string) (ids []int64, hints map[int64]lib.APIRevisionHint, errs []error)
GetWork will try to retrieve a list of IDs for the provided object type that require work to be done
func (*Client) Post ¶
Post will send a request to the server using the current client and return a respose and error, similar to the response from http.Client.Post
func (*Client) Prepare ¶
func (a *Client) Prepare(base string, log *logging.Logger, dcc DiskCacheConfig)
Prepare will take the required information for the client and prepare it to send queries to the server
func (*Client) PrepareObjectDirectory ¶
PrepareObjectDirectory will attempt to prepare the object directory for use. If any errors are encountered, they will be returned
func (*Client) PrepareSSL ¶
func (a *Client) PrepareSSL(base, certFile, keyFile, caFile string, keychainConf keychain.Conf, log *logging.Logger, dcc DiskCacheConfig)
PrepareSSL will take the required infomration for the client and prepare it to send queries to the server using TLS
func (*Client) PushContactRegistryID ¶
func (a *Client) PushContactRegistryID(objectID int64, token string, registryID string) (errs []error)
PushContactRegistryID will try to push the RegistryID selected for the contact to the server.
func (*Client) PushEPPActionLog ¶
PushEPPActionLog will attempt to push an epp action to the server and if it fails, the errors will be returned
func (*Client) PushHostIPAllowList ¶
PushHostIPAllowList will attempt to uplaod the IP allow list provided to the registrar server. If an error occurs, it will be returned
func (*Client) PushInfoEPP ¶
PushInfoEPP will try to push the EPP Info response associated with a registry object
func (*Client) PushProtectedDomainList ¶
PushProtectedDomainList will attempt to uplaod the protected domain list provided to the registrar server. If an error occurs, it will be returned
func (*Client) PushSig ¶
PushSig will try to push a signature associated with an approval to the server.
func (*Client) RequestNewEPPRunID ¶
RequestNewEPPRunID will request a new EPP Run ID from he registrar server and return it. If an error occurs getting a new ID, it will be returned
func (*Client) SetEncryptedPassphrase ¶
SetEncryptedPassphrase will attempt to se the encrypted passphrase for the username provided. If the process results in errors, they will be returned
func (*Client) SetLogger ¶
SetLogger is used to set or reset the logger that the Client object will call
func (*Client) SpoofCertificateForTesting ¶
SpoofCertificateForTesting is used to spoof a client certificate that is used to authenticatea client to the testing server
func (*Client) UnsetEPPCheck ¶
UnsetEPPCheck will try to unset the check_required field for the registry object
func (*Client) VerifyApproverSet ¶
func (a *Client) VerifyApproverSet(as *lib.ApproverSetExportFull) (verified bool, obj lib.ApproverSetRevisionExport, errs []error)
VerifyApproverSet will attempt to verify that the approver set provided has been signed by one of the trust anchors or has a chain of signatures and revisions back to a trust anchor. A bool indicating if the object was verified, a list of errors and a ApproverSetRevisionExport object are returned. If the Approver set was not verified an empty object is returned. If only some of the approvers of the current approver set were verified then only the verifable approvers are returned. If no valid approvers were found verified will be set to false, an error will be added and the object will be just the Approver set.
func (*Client) VerifyChangeRequest ¶
func (a *Client) VerifyChangeRequest(id int64, revision lib.RegistrarObjectExport) (verified bool, errs []error, signedData []byte)
VerifyChangeRequest will attempt to verify that the change request was signed by one of the trust anchors an approver that has a chain of approvals leading back to a trust anchor. A bool indicating if the verification succeeded, a list of errors and the signed data are returned. If the object was not signed no data is returned.
type DiskCache ¶
type DiskCache struct { Enabled bool BasePath string UseHints bool // contains filtered or unexported fields }
DiskCache is used to handle the storage and reterival of objects stored on the local disk
func NewDiskCache ¶
func NewDiskCache(dcc DiskCacheConfig, log *logging.Logger) (DiskCache, error)
NewDiskCache will generate an initialize a disk cache using the DiskCacheConfig passed
func (*DiskCache) GetObject ¶
func (d *DiskCache) GetObject(objType string, id int64, lastUpdate *time.Time) (outObj lib.RegistrarObjectExport, errs []error)
GetObject will attempt to reterive the object of the type passed with the id pass from disk otherwise an error will be returned
func (*DiskCache) GetObjectAt ¶
func (d *DiskCache) GetObjectAt(objectType string, id int64, timestamp int64, od ObjectDirectory) (outObj lib.RegistrarObjectExport, errs []error)
GetObjectAt will attempt to retrieve the object type with the id passed at the timestamp given. If no object is caches for that timestamp, an error is returned
func (*DiskCache) SaveObject ¶
func (d *DiskCache) SaveObject(resp lib.APIResponse) error
SaveObject will take the given object and save it to disk in the cache
func (*DiskCache) SaveObjectAt ¶
SaveObjectAt will save the given object to disk for the given ID and add the timestamp to the date rage for the object revision table
func (*DiskCache) UpdateRevisionList ¶
func (d *DiskCache) UpdateRevisionList(objectType string, objectID int64, revisionID int64, ts int64) error
UpdateRevisionList will attempt to read in a object from cache and add a revision at a timestamp to the object infomration and then write the object back to disk
type DiskCacheConfig ¶
DiskCacheConfig is used to include in configruations files to handle the initialization of Disk Caches
type ObjectCache ¶
type ObjectCache struct {
Response lib.APIResponse
}
ObjectCache is used to serialize and object into the disk cache
type ObjectDirectory ¶
type ObjectDirectory struct { DomainIDs []int64 DomainHints map[int64]lib.APIRevisionHint HostIDs []int64 HostHints map[int64]lib.APIRevisionHint ContactIDs []int64 ContactHints map[int64]lib.APIRevisionHint }
ObjectDirectory handles a list of IDs and revision hints for the client to allow quick lookups in the disk cache if used
func NewObjectDirectory ¶
func NewObjectDirectory() ObjectDirectory
NewObjectDirectory will initialize a new object directory object and return it
func (*ObjectDirectory) LoadObjectDirectory ¶
func (od *ObjectDirectory) LoadObjectDirectory(cli *Client) (errs []error)
LoadObjectDirectory will attempt to load the list of active objects and the current hints for all objects. If any errors are returned when trying to load the objects, the errors will be returned
type ObjectInfo ¶
type ObjectInfo struct { ObjectID int64 Revisions []RevisionValidity }
ObjectInfo is used to store multiple revision validity windows for objects of the same ID. Object info is what will be serialized to disk
type RevisionValidity ¶
RevisionValidity is used to store information about which revisions were active for given times
type TrustAnchors ¶
TrustAnchors are used to pin GPG keys that are trusted, often the set of trust anchors will be the bootstrap key or possibly the members of the default (first) approver set. Trust anchors can be added to reduce the amount of work required to verify a change set. At least one trust anchor will be required for verification to work correctly.
func (*TrustAnchors) AddKey ¶
func (t *TrustAnchors) AddKey(key string) error
AddKey is used to add a new key to a trust anchor set
func (TrustAnchors) DecryptionKeys ¶
func (t TrustAnchors) DecryptionKeys() (keys []openpgp.Key)
DecryptionKeys returns all private keys that are valid for decryption. No private keys are stored by the system so it is always a noop. This method is part of the interface for []openpgp.Entities
func (TrustAnchors) IsSignedBy ¶
func (t TrustAnchors) IsSignedBy(sig []byte) (valid bool, signedBody []byte)
IsSignedBy will return true if the object is signed by one of the members of the TrustAnchors list
func (TrustAnchors) KeysById ¶
func (t TrustAnchors) KeysById(id uint64) (keys []openpgp.Key)
KeysById returns the set of keys that have the given key id. This method is part of the interface for []openpgp.Entities
func (TrustAnchors) KeysByIdUsage ¶
func (t TrustAnchors) KeysByIdUsage(id uint64, requiredUsage byte) (keys []openpgp.Key)
KeysByIdUsage returns the set of keys with the given id that also meet the key usage given by requiredUsage. The requiredUsage is expressed as the bitwise-OR of packet.KeyFlag* values. This method is part of the interface for []openpgp.Entities