Documentation ¶
Index ¶
- Constants
- Variables
- type Db
- type Endpoint
- type Identifier
- type MemoryDb
- func (db *MemoryDb) FindEndpointsByOrganizationAndType(organizationIdentifier string, endpointType *string) ([]Endpoint, error)
- func (db *MemoryDb) OrganizationById(id string) (*Organization, error)
- func (db *MemoryDb) OrganizationsByVendorID(id string) []*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 string) *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(organizationIdentifier string, endpointType *string) ([]Endpoint, error) SearchOrganizations(query string) []Organization OrganizationById(id string) (*Organization, error) VendorByID(id string) *Vendor OrganizationsByVendorID(id string) []*Organization ReverseLookup(name string) (*Organization, error) }
type Endpoint ¶
type Endpoint struct { URL string `json:"URL"` Organization Identifier `json:"organization"` EndpointType string `json:"endpointType"` Identifier Identifier `json:"identifier"` Status string `json:"status"` Properties map[string]string `json:"properties,omitempty"` }
Endpoint defines component schema for Endpoint.
type Identifier ¶
type Identifier string
Identifier defines component schema for Identifier.
func (Identifier) String ¶
func (i Identifier) String() string
String converts an identifier to string
type MemoryDb ¶
type MemoryDb struct {
// contains filtered or unexported fields
}
func (*MemoryDb) FindEndpointsByOrganizationAndType ¶
func (*MemoryDb) OrganizationById ¶
func (db *MemoryDb) OrganizationById(id string) (*Organization, error)
func (*MemoryDb) OrganizationsByVendorID ¶
func (db *MemoryDb) OrganizationsByVendorID(id string) []*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
func (*MemoryDb) VendorByID ¶
VendorByID looks up the vendor by the given ID.
type Organization ¶
type Organization struct { Identifier Identifier `json:"identifier"` Name string `json:"name"` 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 Identifier `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.