-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use new sherpadoc rename mechanism to remove some typename stuttering
the stuttering was introduced to make the same type name declared in multiple packages, and used in the admin sherpa api, unique. with sherpadoc's new rename, we can make them unique when generating the api definition/docs, and the Go code can use nicer names.
- Loading branch information
Showing
18 changed files
with
73 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,16 @@ import ( | |
"strings" | ||
) | ||
|
||
// todo: DMARCPolicy should be named just Policy, but this is causing conflicting types in sherpadoc output. should somehow get the dmarc-prefix only in the sherpadoc. | ||
|
||
// Policy as used in DMARC DNS record for "p=" or "sp=". | ||
type DMARCPolicy string | ||
type Policy string | ||
|
||
// ../rfc/7489:1157 | ||
|
||
const ( | ||
PolicyEmpty DMARCPolicy = "" // Only for the optional Record.SubdomainPolicy. | ||
PolicyNone DMARCPolicy = "none" | ||
PolicyQuarantine DMARCPolicy = "quarantine" | ||
PolicyReject DMARCPolicy = "reject" | ||
PolicyEmpty Policy = "" // Only for the optional Record.SubdomainPolicy. | ||
PolicyNone Policy = "none" | ||
PolicyQuarantine Policy = "quarantine" | ||
PolicyReject Policy = "reject" | ||
) | ||
|
||
// URI is a destination address for reporting. | ||
|
@@ -55,17 +53,17 @@ const ( | |
// | ||
// v=DMARC1; p=reject; rua=mailto:[email protected] | ||
type Record struct { | ||
Version string // "v=DMARC1", fixed. | ||
Policy DMARCPolicy // Required, for "p=". | ||
SubdomainPolicy DMARCPolicy // Like policy but for subdomains. Optional, for "sp=". | ||
AggregateReportAddresses []URI // Optional, for "rua=". Destination addresses for aggregate reports. | ||
FailureReportAddresses []URI // Optional, for "ruf=". Destination addresses for failure reports. | ||
ADKIM Align // Alignment: "r" (default) for relaxed or "s" for simple. For "adkim=". | ||
ASPF Align // Alignment: "r" (default) for relaxed or "s" for simple. For "aspf=". | ||
AggregateReportingInterval int // In seconds, default 86400. For "ri=" | ||
FailureReportingOptions []string // "0" (default), "1", "d", "s". For "fo=". | ||
ReportingFormat []string // "afrf" (default). For "rf=". | ||
Percentage int // Between 0 and 100, default 100. For "pct=". Policy applies randomly to this percentage of messages. | ||
Version string // "v=DMARC1", fixed. | ||
Policy Policy // Required, for "p=". | ||
SubdomainPolicy Policy // Like policy but for subdomains. Optional, for "sp=". | ||
AggregateReportAddresses []URI // Optional, for "rua=". Destination addresses for aggregate reports. | ||
FailureReportAddresses []URI // Optional, for "ruf=". Destination addresses for failure reports. | ||
ADKIM Align // Alignment: "r" (default) for relaxed or "s" for simple. For "adkim=". | ||
ASPF Align // Alignment: "r" (default) for relaxed or "s" for simple. For "aspf=". | ||
AggregateReportingInterval int // In seconds, default 86400. For "ri=" | ||
FailureReportingOptions []string // "0" (default), "1", "d", "s". For "fo=". | ||
ReportingFormat []string // "afrf" (default). For "rf=". | ||
Percentage int // Between 0 and 100, default 100. For "pct=". Policy applies randomly to this percentage of messages. | ||
} | ||
|
||
// DefaultRecord holds the defaults for a DMARC record. | ||
|
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
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 |
---|---|---|
|
@@ -488,9 +488,9 @@ func TestSendReports(t *testing.T) { | |
// Suppressed addresses don't get a report. | ||
resolver.TXT["_smtp._tls.mailhost.xn--74h.example."] = []string{"v=TLSRPTv1; rua=mailto:[email protected],mailto:[email protected]; rua=mailto:[email protected]"} | ||
db.Insert(ctxbg, | ||
&tlsrptdb.TLSRPTSuppressAddress{ReportingAddress: "[email protected]", Until: time.Now().Add(-time.Minute)}, // Expired, so ignored. | ||
&tlsrptdb.TLSRPTSuppressAddress{ReportingAddress: "[email protected]", Until: time.Now().Add(time.Minute)}, // Still valid. | ||
&tlsrptdb.TLSRPTSuppressAddress{ReportingAddress: "[email protected]", Until: time.Now().Add(31 * 24 * time.Hour)}, // Still valid. | ||
&tlsrptdb.SuppressAddress{ReportingAddress: "[email protected]", Until: time.Now().Add(-time.Minute)}, // Expired, so ignored. | ||
&tlsrptdb.SuppressAddress{ReportingAddress: "[email protected]", Until: time.Now().Add(time.Minute)}, // Still valid. | ||
&tlsrptdb.SuppressAddress{ReportingAddress: "[email protected]", Until: time.Now().Add(31 * 24 * time.Hour)}, // Still valid. | ||
) | ||
test(tlsResults, map[string][]tlsrpt.Report{ | ||
"[email protected]": {report1}, | ||
|
Oops, something went wrong.