-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #436 from xmidt-org/senderwrapper
Senderwrapper
- Loading branch information
Showing
12 changed files
with
444 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import "time" | ||
|
||
//This is a stub for the ancla listener. This will be removed once we can add ancla back into caduceus | ||
|
||
type ListenerStub struct { | ||
PartnerIds []string | ||
Webhook Webhook | ||
} | ||
|
||
type Webhook struct { | ||
// Address is the subscription request origin HTTP Address. | ||
Address string `json:"registered_from_address"` | ||
|
||
// Config contains data to inform how events are delivered. | ||
Config DeliveryConfig `json:"config"` | ||
|
||
// FailureURL is the URL used to notify subscribers when they've been cut off due to event overflow. | ||
// Optional, set to "" to disable notifications. | ||
FailureURL string `json:"failure_url"` | ||
|
||
// Events is the list of regular expressions to match an event type against. | ||
Events []string `json:"events"` | ||
|
||
// Matcher type contains values to match against the metadata. | ||
Matcher MetadataMatcherConfig `json:"matcher,omitempty"` | ||
|
||
// Duration describes how long the subscription lasts once added. | ||
Duration time.Duration `json:"duration"` | ||
|
||
// Until describes the time this subscription expires. | ||
Until time.Time `json:"until"` | ||
} | ||
|
||
// DeliveryConfig is a Webhook substructure with data related to event delivery. | ||
type DeliveryConfig struct { | ||
// URL is the HTTP URL to deliver messages to. | ||
URL string `json:"url"` | ||
|
||
// ContentType is content type value to set WRP messages to (unless already specified in the WRP). | ||
ContentType string `json:"content_type"` | ||
|
||
// Secret is the string value for the SHA1 HMAC. | ||
// (Optional, set to "" to disable behavior). | ||
Secret string `json:"secret,omitempty"` | ||
|
||
// AlternativeURLs is a list of explicit URLs that should be round robin through on failure cases to the main URL. | ||
AlternativeURLs []string `json:"alt_urls,omitempty"` | ||
} | ||
|
||
// MetadataMatcherConfig is Webhook substructure with config to match event metadata. | ||
type MetadataMatcherConfig struct { | ||
// DeviceID is the list of regular expressions to match device id type against. | ||
DeviceID []string `json:"device_id"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.