Documentation ¶
Index ¶
- Constants
- Variables
- type Db
- type Endpoint
- type MemoryDb
- func (db *MemoryDb) FindEndpointsByOrganizationAndType(organizationIdentifier core.PartyID, endpointType *string) ([]Endpoint, error)
- func (db *MemoryDb) OrganizationById(id core.PartyID) (*Organization, error)
- func (db *MemoryDb) OrganizationsByVendorID(id core.PartyID) []*Organization
- func (db *MemoryDb) RegisterEventHandlers(fn events.EventRegistrar)
- func (db *MemoryDb) ReverseLookup(name string) (*Organization, error)
- func (db *MemoryDb) SearchOrganizations(query string) []Organization
- func (db *MemoryDb) VendorByID(id core.PartyID) *Vendor
- type Organization
- type Vendor
Constants ¶
const StatusActive = "active"
StatusActive represents the "active" status
Variables ¶
var ErrOrganizationNotFound = errors.New("organization not found")
ErrOrganizationNotFound is returned when an organization is not found
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db interface { RegisterEventHandlers(fn events.EventRegistrar) FindEndpointsByOrganizationAndType(organizationID core.PartyID, endpointType *string) ([]Endpoint, error) SearchOrganizations(query string) []Organization OrganizationById(id core.PartyID) (*Organization, error) VendorByID(id core.PartyID) *Vendor OrganizationsByVendorID(id core.PartyID) []*Organization ReverseLookup(name string) (*Organization, error) }
type Endpoint ¶
type Endpoint struct { URL string `json:"URL"` Organization core.PartyID `json:"organization"` EndpointType string `json:"endpointType"` Identifier types.EndpointID `json:"identifier"` Status string `json:"status"` Properties map[string]string `json:"properties,omitempty"` }
Endpoint defines component schema for Endpoint.
type MemoryDb ¶
type MemoryDb struct {
// contains filtered or unexported fields
}
func (*MemoryDb) FindEndpointsByOrganizationAndType ¶
func (*MemoryDb) OrganizationById ¶
func (db *MemoryDb) OrganizationById(id core.PartyID) (*Organization, error)
func (*MemoryDb) OrganizationsByVendorID ¶
func (db *MemoryDb) OrganizationsByVendorID(id core.PartyID) []*Organization
func (*MemoryDb) RegisterEventHandlers ¶
func (db *MemoryDb) RegisterEventHandlers(fn events.EventRegistrar)
RegisterEventHandlers registers event handlers on this database
func (*MemoryDb) ReverseLookup ¶
func (db *MemoryDb) ReverseLookup(name string) (*Organization, error)
func (*MemoryDb) SearchOrganizations ¶
func (db *MemoryDb) SearchOrganizations(query string) []Organization
type Organization ¶
type Organization struct { Identifier core.PartyID `json:"identifier"` Vendor core.PartyID `json:"vendor"` Name string `json:"name"` // Deprecated: use Keys or helper functions to retrieve the current key in use by the organization PublicKey *string `json:"publicKey,omitempty"` Keys []interface{} `json:"keys,omitempty"` Endpoints []Endpoint }
Organization defines component schema for Organization.
func (Organization) CurrentPublicKey ¶
func (o Organization) CurrentPublicKey() (jwk.Key, error)
CurrentPublicKey returns the public key associated with the organization certificate which has the longest validity. For backwards compatibility:
- If the organization has no certificates, it will return the first JWK.
- If the organization has no JWKs, it will return the (deprecated) PublicKey.
If none of the above conditions are matched, an error is returned.
func (Organization) GetActiveCertificates ¶
func (o Organization) GetActiveCertificates() []*x509.Certificate
type Vendor ¶
type Vendor struct { Identifier core.PartyID `json:"identifier"` Name string `json:"name"` Domain string `json:"domain,omitempty"` Keys []interface{} `json:"keys,omitempty"` }
Vendor defines component schema for Vendor.
func (Vendor) GetActiveCertificates ¶
func (v Vendor) GetActiveCertificates() []*x509.Certificate
GetActiveCertificates looks up the vendor's certificates and returns them sorted, longest valid certificate first. Expired certificates aren't returned.