id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
31,100 | letsencrypt/boulder | log/log.go | AuditPanic | func (log *impl) AuditPanic() {
if err := recover(); err != nil {
buf := make([]byte, 8192)
log.AuditErrf("Panic caused by err: %s", err)
runtime.Stack(buf, false)
log.AuditErrf("Stack Trace (Current frame) %s", buf)
runtime.Stack(buf, true)
log.Warningf("Stack Trace (All frames): %s", buf)
}
} | go | func (log *impl) AuditPanic() {
if err := recover(); err != nil {
buf := make([]byte, 8192)
log.AuditErrf("Panic caused by err: %s", err)
runtime.Stack(buf, false)
log.AuditErrf("Stack Trace (Current frame) %s", buf)
runtime.Stack(buf, true)
log.Warningf("Stack Trace (All frames): %s", buf)
}
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"AuditPanic",
"(",
")",
"{",
"if",
"err",
":=",
"recover",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"buf",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"8192",
")",
"\n",
"log",
".",
"AuditErrf",
"(",
"\"",
"... | // AuditPanic catches panicking executables. This method should be added
// in a defer statement as early as possible | [
"AuditPanic",
"catches",
"panicking",
"executables",
".",
"This",
"method",
"should",
"be",
"added",
"in",
"a",
"defer",
"statement",
"as",
"early",
"as",
"possible"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L189-L200 |
31,101 | letsencrypt/boulder | log/log.go | Err | func (log *impl) Err(msg string) {
log.auditAtLevel(syslog.LOG_ERR, msg)
} | go | func (log *impl) Err(msg string) {
log.auditAtLevel(syslog.LOG_ERR, msg)
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Err",
"(",
"msg",
"string",
")",
"{",
"log",
".",
"auditAtLevel",
"(",
"syslog",
".",
"LOG_ERR",
",",
"msg",
")",
"\n",
"}"
] | // Err level messages are always marked with the audit tag, for special handling
// at the upstream system logger. | [
"Err",
"level",
"messages",
"are",
"always",
"marked",
"with",
"the",
"audit",
"tag",
"for",
"special",
"handling",
"at",
"the",
"upstream",
"system",
"logger",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L204-L206 |
31,102 | letsencrypt/boulder | log/log.go | Errf | func (log *impl) Errf(format string, a ...interface{}) {
log.Err(fmt.Sprintf(format, a...))
} | go | func (log *impl) Errf(format string, a ...interface{}) {
log.Err(fmt.Sprintf(format, a...))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Errf",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"Err",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"a",
"...",
")",
")",
"\n",
"}"
] | // Errf level messages are always marked with the audit tag, for special handling
// at the upstream system logger. | [
"Errf",
"level",
"messages",
"are",
"always",
"marked",
"with",
"the",
"audit",
"tag",
"for",
"special",
"handling",
"at",
"the",
"upstream",
"system",
"logger",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L210-L212 |
31,103 | letsencrypt/boulder | log/log.go | Warning | func (log *impl) Warning(msg string) {
log.w.logAtLevel(syslog.LOG_WARNING, msg)
} | go | func (log *impl) Warning(msg string) {
log.w.logAtLevel(syslog.LOG_WARNING, msg)
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Warning",
"(",
"msg",
"string",
")",
"{",
"log",
".",
"w",
".",
"logAtLevel",
"(",
"syslog",
".",
"LOG_WARNING",
",",
"msg",
")",
"\n",
"}"
] | // Warning level messages pass through normally. | [
"Warning",
"level",
"messages",
"pass",
"through",
"normally",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L215-L217 |
31,104 | letsencrypt/boulder | log/log.go | Warningf | func (log *impl) Warningf(format string, a ...interface{}) {
log.Warning(fmt.Sprintf(format, a...))
} | go | func (log *impl) Warningf(format string, a ...interface{}) {
log.Warning(fmt.Sprintf(format, a...))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Warningf",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"Warning",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"a",
"...",
")",
")",
"\n",
"}"
] | // Warningf level messages pass through normally. | [
"Warningf",
"level",
"messages",
"pass",
"through",
"normally",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L220-L222 |
31,105 | letsencrypt/boulder | log/log.go | Info | func (log *impl) Info(msg string) {
log.w.logAtLevel(syslog.LOG_INFO, msg)
} | go | func (log *impl) Info(msg string) {
log.w.logAtLevel(syslog.LOG_INFO, msg)
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Info",
"(",
"msg",
"string",
")",
"{",
"log",
".",
"w",
".",
"logAtLevel",
"(",
"syslog",
".",
"LOG_INFO",
",",
"msg",
")",
"\n",
"}"
] | // Info level messages pass through normally. | [
"Info",
"level",
"messages",
"pass",
"through",
"normally",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L225-L227 |
31,106 | letsencrypt/boulder | log/log.go | Infof | func (log *impl) Infof(format string, a ...interface{}) {
log.Info(fmt.Sprintf(format, a...))
} | go | func (log *impl) Infof(format string, a ...interface{}) {
log.Info(fmt.Sprintf(format, a...))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Infof",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"Info",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"a",
"...",
")",
")",
"\n",
"}"
] | // Infof level messages pass through normally. | [
"Infof",
"level",
"messages",
"pass",
"through",
"normally",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L230-L232 |
31,107 | letsencrypt/boulder | log/log.go | Debug | func (log *impl) Debug(msg string) {
log.w.logAtLevel(syslog.LOG_DEBUG, msg)
} | go | func (log *impl) Debug(msg string) {
log.w.logAtLevel(syslog.LOG_DEBUG, msg)
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Debug",
"(",
"msg",
"string",
")",
"{",
"log",
".",
"w",
".",
"logAtLevel",
"(",
"syslog",
".",
"LOG_DEBUG",
",",
"msg",
")",
"\n",
"}"
] | // Debug level messages pass through normally. | [
"Debug",
"level",
"messages",
"pass",
"through",
"normally",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L235-L237 |
31,108 | letsencrypt/boulder | log/log.go | Debugf | func (log *impl) Debugf(format string, a ...interface{}) {
log.Debug(fmt.Sprintf(format, a...))
} | go | func (log *impl) Debugf(format string, a ...interface{}) {
log.Debug(fmt.Sprintf(format, a...))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"Debugf",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"Debug",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"a",
"...",
")",
")",
"\n",
"}"
] | // Debugf level messages pass through normally. | [
"Debugf",
"level",
"messages",
"pass",
"through",
"normally",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L240-L242 |
31,109 | letsencrypt/boulder | log/log.go | AuditInfo | func (log *impl) AuditInfo(msg string) {
log.auditAtLevel(syslog.LOG_INFO, msg)
} | go | func (log *impl) AuditInfo(msg string) {
log.auditAtLevel(syslog.LOG_INFO, msg)
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"AuditInfo",
"(",
"msg",
"string",
")",
"{",
"log",
".",
"auditAtLevel",
"(",
"syslog",
".",
"LOG_INFO",
",",
"msg",
")",
"\n",
"}"
] | // AuditInfo sends an INFO-severity message that is prefixed with the
// audit tag, for special handling at the upstream system logger. | [
"AuditInfo",
"sends",
"an",
"INFO",
"-",
"severity",
"message",
"that",
"is",
"prefixed",
"with",
"the",
"audit",
"tag",
"for",
"special",
"handling",
"at",
"the",
"upstream",
"system",
"logger",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L246-L248 |
31,110 | letsencrypt/boulder | log/log.go | AuditInfof | func (log *impl) AuditInfof(format string, a ...interface{}) {
log.AuditInfo(fmt.Sprintf(format, a...))
} | go | func (log *impl) AuditInfof(format string, a ...interface{}) {
log.AuditInfo(fmt.Sprintf(format, a...))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"AuditInfof",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"AuditInfo",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"a",
"...",
")",
")",
"\n",
"}"
] | // AuditInfof sends an INFO-severity message that is prefixed with the
// audit tag, for special handling at the upstream system logger. | [
"AuditInfof",
"sends",
"an",
"INFO",
"-",
"severity",
"message",
"that",
"is",
"prefixed",
"with",
"the",
"audit",
"tag",
"for",
"special",
"handling",
"at",
"the",
"upstream",
"system",
"logger",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L252-L254 |
31,111 | letsencrypt/boulder | log/log.go | AuditObject | func (log *impl) AuditObject(msg string, obj interface{}) {
jsonObj, err := json.Marshal(obj)
if err != nil {
log.auditAtLevel(syslog.LOG_ERR, fmt.Sprintf("Object could not be serialized to JSON. Raw: %+v", obj))
return
}
log.auditAtLevel(syslog.LOG_INFO, fmt.Sprintf("%s JSON=%s", msg, jsonObj))
} | go | func (log *impl) AuditObject(msg string, obj interface{}) {
jsonObj, err := json.Marshal(obj)
if err != nil {
log.auditAtLevel(syslog.LOG_ERR, fmt.Sprintf("Object could not be serialized to JSON. Raw: %+v", obj))
return
}
log.auditAtLevel(syslog.LOG_INFO, fmt.Sprintf("%s JSON=%s", msg, jsonObj))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"AuditObject",
"(",
"msg",
"string",
",",
"obj",
"interface",
"{",
"}",
")",
"{",
"jsonObj",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"obj",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"auditA... | // AuditObject sends an INFO-severity JSON-serialized object message that is prefixed
// with the audit tag, for special handling at the upstream system logger. | [
"AuditObject",
"sends",
"an",
"INFO",
"-",
"severity",
"JSON",
"-",
"serialized",
"object",
"message",
"that",
"is",
"prefixed",
"with",
"the",
"audit",
"tag",
"for",
"special",
"handling",
"at",
"the",
"upstream",
"system",
"logger",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L258-L266 |
31,112 | letsencrypt/boulder | log/log.go | AuditErr | func (log *impl) AuditErr(msg string) {
log.auditAtLevel(syslog.LOG_ERR, msg)
} | go | func (log *impl) AuditErr(msg string) {
log.auditAtLevel(syslog.LOG_ERR, msg)
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"AuditErr",
"(",
"msg",
"string",
")",
"{",
"log",
".",
"auditAtLevel",
"(",
"syslog",
".",
"LOG_ERR",
",",
"msg",
")",
"\n",
"}"
] | // AuditErr can format an error for auditing; it does so at ERR level. | [
"AuditErr",
"can",
"format",
"an",
"error",
"for",
"auditing",
";",
"it",
"does",
"so",
"at",
"ERR",
"level",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L269-L271 |
31,113 | letsencrypt/boulder | log/log.go | AuditErrf | func (log *impl) AuditErrf(format string, a ...interface{}) {
log.AuditErr(fmt.Sprintf(format, a...))
} | go | func (log *impl) AuditErrf(format string, a ...interface{}) {
log.AuditErr(fmt.Sprintf(format, a...))
} | [
"func",
"(",
"log",
"*",
"impl",
")",
"AuditErrf",
"(",
"format",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"{",
"log",
".",
"AuditErr",
"(",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"a",
"...",
")",
")",
"\n",
"}"
] | // AuditErrf can format an error for auditing; it does so at ERR level. | [
"AuditErrf",
"can",
"format",
"an",
"error",
"for",
"auditing",
";",
"it",
"does",
"so",
"at",
"ERR",
"level",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/log.go#L274-L276 |
31,114 | letsencrypt/boulder | va/caa.go | checkCAA | func (va *ValidationAuthorityImpl) checkCAA(
ctx context.Context,
identifier core.AcmeIdentifier,
params *caaParams) *probs.ProblemDetails {
present, valid, records, err := va.checkCAARecords(ctx, identifier, params)
if err != nil {
return probs.DNS("%v", err)
}
recordsStr, err := json.Marshal(&records)
if e... | go | func (va *ValidationAuthorityImpl) checkCAA(
ctx context.Context,
identifier core.AcmeIdentifier,
params *caaParams) *probs.ProblemDetails {
present, valid, records, err := va.checkCAARecords(ctx, identifier, params)
if err != nil {
return probs.DNS("%v", err)
}
recordsStr, err := json.Marshal(&records)
if e... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"checkCAA",
"(",
"ctx",
"context",
".",
"Context",
",",
"identifier",
"core",
".",
"AcmeIdentifier",
",",
"params",
"*",
"caaParams",
")",
"*",
"probs",
".",
"ProblemDetails",
"{",
"present",
",",
"vali... | // checkCAA performs a CAA lookup & validation for the provided identifier. If
// the CAA lookup & validation fail a problem is returned. | [
"checkCAA",
"performs",
"a",
"CAA",
"lookup",
"&",
"validation",
"for",
"the",
"provided",
"identifier",
".",
"If",
"the",
"CAA",
"lookup",
"&",
"validation",
"fail",
"a",
"problem",
"is",
"returned",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/caa.go#L47-L75 |
31,115 | letsencrypt/boulder | va/caa.go | criticalUnknown | func (caaSet CAASet) criticalUnknown() bool {
if len(caaSet.Unknown) > 0 {
for _, caaRecord := range caaSet.Unknown {
// The critical flag is the bit with significance 128. However, many CAA
// record users have misinterpreted the RFC and concluded that the bit
// with significance 1 is the critical bit. Th... | go | func (caaSet CAASet) criticalUnknown() bool {
if len(caaSet.Unknown) > 0 {
for _, caaRecord := range caaSet.Unknown {
// The critical flag is the bit with significance 128. However, many CAA
// record users have misinterpreted the RFC and concluded that the bit
// with significance 1 is the critical bit. Th... | [
"func",
"(",
"caaSet",
"CAASet",
")",
"criticalUnknown",
"(",
")",
"bool",
"{",
"if",
"len",
"(",
"caaSet",
".",
"Unknown",
")",
">",
"0",
"{",
"for",
"_",
",",
"caaRecord",
":=",
"range",
"caaSet",
".",
"Unknown",
"{",
"// The critical flag is the bit wit... | // returns true if any CAA records have unknown tag properties and are flagged critical. | [
"returns",
"true",
"if",
"any",
"CAA",
"records",
"have",
"unknown",
"tag",
"properties",
"and",
"are",
"flagged",
"critical",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/caa.go#L86-L102 |
31,116 | letsencrypt/boulder | va/caa.go | newCAASet | func newCAASet(CAAs []*dns.CAA) *CAASet {
var filtered CAASet
for _, caaRecord := range CAAs {
switch strings.ToLower(caaRecord.Tag) {
case "issue":
filtered.Issue = append(filtered.Issue, caaRecord)
case "issuewild":
filtered.Issuewild = append(filtered.Issuewild, caaRecord)
case "iodef":
filtered.... | go | func newCAASet(CAAs []*dns.CAA) *CAASet {
var filtered CAASet
for _, caaRecord := range CAAs {
switch strings.ToLower(caaRecord.Tag) {
case "issue":
filtered.Issue = append(filtered.Issue, caaRecord)
case "issuewild":
filtered.Issuewild = append(filtered.Issuewild, caaRecord)
case "iodef":
filtered.... | [
"func",
"newCAASet",
"(",
"CAAs",
"[",
"]",
"*",
"dns",
".",
"CAA",
")",
"*",
"CAASet",
"{",
"var",
"filtered",
"CAASet",
"\n\n",
"for",
"_",
",",
"caaRecord",
":=",
"range",
"CAAs",
"{",
"switch",
"strings",
".",
"ToLower",
"(",
"caaRecord",
".",
"T... | // Filter CAA records by property | [
"Filter",
"CAA",
"records",
"by",
"property"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/caa.go#L105-L122 |
31,117 | letsencrypt/boulder | va/caa.go | checkAccountURI | func checkAccountURI(accountURI string, accountURIPrefixes []string, accountID int64) bool {
for _, prefix := range accountURIPrefixes {
if accountURI == fmt.Sprintf("%s%d", prefix, accountID) {
return true
}
}
return false
} | go | func checkAccountURI(accountURI string, accountURIPrefixes []string, accountID int64) bool {
for _, prefix := range accountURIPrefixes {
if accountURI == fmt.Sprintf("%s%d", prefix, accountID) {
return true
}
}
return false
} | [
"func",
"checkAccountURI",
"(",
"accountURI",
"string",
",",
"accountURIPrefixes",
"[",
"]",
"string",
",",
"accountID",
"int64",
")",
"bool",
"{",
"for",
"_",
",",
"prefix",
":=",
"range",
"accountURIPrefixes",
"{",
"if",
"accountURI",
"==",
"fmt",
".",
"Sp... | // checkAccountURI checks the specified full account URI against the
// given accountID and a list of valid prefixes. | [
"checkAccountURI",
"checks",
"the",
"specified",
"full",
"account",
"URI",
"against",
"the",
"given",
"accountID",
"and",
"a",
"list",
"of",
"valid",
"prefixes",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/caa.go#L311-L318 |
31,118 | letsencrypt/boulder | core/util.go | RandomString | func RandomString(byteLength int) string {
b := make([]byte, byteLength)
_, err := io.ReadFull(RandReader, b)
if err != nil {
panic(fmt.Sprintf("Error reading random bytes: %s", err))
}
return base64.RawURLEncoding.EncodeToString(b)
} | go | func RandomString(byteLength int) string {
b := make([]byte, byteLength)
_, err := io.ReadFull(RandReader, b)
if err != nil {
panic(fmt.Sprintf("Error reading random bytes: %s", err))
}
return base64.RawURLEncoding.EncodeToString(b)
} | [
"func",
"RandomString",
"(",
"byteLength",
"int",
")",
"string",
"{",
"b",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"byteLength",
")",
"\n",
"_",
",",
"err",
":=",
"io",
".",
"ReadFull",
"(",
"RandReader",
",",
"b",
")",
"\n",
"if",
"err",
"!=",
... | // RandomString returns a randomly generated string of the requested length. | [
"RandomString",
"returns",
"a",
"randomly",
"generated",
"string",
"of",
"the",
"requested",
"length",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L58-L65 |
31,119 | letsencrypt/boulder | core/util.go | Fingerprint256 | func Fingerprint256(data []byte) string {
d := sha256.New()
_, _ = d.Write(data) // Never returns an error
return base64.RawURLEncoding.EncodeToString(d.Sum(nil))
} | go | func Fingerprint256(data []byte) string {
d := sha256.New()
_, _ = d.Write(data) // Never returns an error
return base64.RawURLEncoding.EncodeToString(d.Sum(nil))
} | [
"func",
"Fingerprint256",
"(",
"data",
"[",
"]",
"byte",
")",
"string",
"{",
"d",
":=",
"sha256",
".",
"New",
"(",
")",
"\n",
"_",
",",
"_",
"=",
"d",
".",
"Write",
"(",
"data",
")",
"// Never returns an error",
"\n",
"return",
"base64",
".",
"RawURL... | // Fingerprints
// Fingerprint256 produces an unpadded, URL-safe Base64-encoded SHA256 digest
// of the data. | [
"Fingerprints",
"Fingerprint256",
"produces",
"an",
"unpadded",
"URL",
"-",
"safe",
"Base64",
"-",
"encoded",
"SHA256",
"digest",
"of",
"the",
"data",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L84-L88 |
31,120 | letsencrypt/boulder | core/util.go | KeyDigest | func KeyDigest(key crypto.PublicKey) (string, error) {
switch t := key.(type) {
case *jose.JSONWebKey:
if t == nil {
return "", fmt.Errorf("Cannot compute digest of nil key")
}
return KeyDigest(t.Key)
case jose.JSONWebKey:
return KeyDigest(t.Key)
default:
keyDER, err := x509.MarshalPKIXPublicKey(key)
... | go | func KeyDigest(key crypto.PublicKey) (string, error) {
switch t := key.(type) {
case *jose.JSONWebKey:
if t == nil {
return "", fmt.Errorf("Cannot compute digest of nil key")
}
return KeyDigest(t.Key)
case jose.JSONWebKey:
return KeyDigest(t.Key)
default:
keyDER, err := x509.MarshalPKIXPublicKey(key)
... | [
"func",
"KeyDigest",
"(",
"key",
"crypto",
".",
"PublicKey",
")",
"(",
"string",
",",
"error",
")",
"{",
"switch",
"t",
":=",
"key",
".",
"(",
"type",
")",
"{",
"case",
"*",
"jose",
".",
"JSONWebKey",
":",
"if",
"t",
"==",
"nil",
"{",
"return",
"... | // KeyDigest produces a padded, standard Base64-encoded SHA256 digest of a
// provided public key. | [
"KeyDigest",
"produces",
"a",
"padded",
"standard",
"Base64",
"-",
"encoded",
"SHA256",
"digest",
"of",
"a",
"provided",
"public",
"key",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L92-L111 |
31,121 | letsencrypt/boulder | core/util.go | KeyDigestEquals | func KeyDigestEquals(j, k crypto.PublicKey) bool {
digestJ, errJ := KeyDigest(j)
digestK, errK := KeyDigest(k)
// Keys that don't have a valid digest (due to marshalling problems)
// are never equal. So, e.g. nil keys are not equal.
if errJ != nil || errK != nil {
return false
}
return digestJ == digestK
} | go | func KeyDigestEquals(j, k crypto.PublicKey) bool {
digestJ, errJ := KeyDigest(j)
digestK, errK := KeyDigest(k)
// Keys that don't have a valid digest (due to marshalling problems)
// are never equal. So, e.g. nil keys are not equal.
if errJ != nil || errK != nil {
return false
}
return digestJ == digestK
} | [
"func",
"KeyDigestEquals",
"(",
"j",
",",
"k",
"crypto",
".",
"PublicKey",
")",
"bool",
"{",
"digestJ",
",",
"errJ",
":=",
"KeyDigest",
"(",
"j",
")",
"\n",
"digestK",
",",
"errK",
":=",
"KeyDigest",
"(",
"k",
")",
"\n",
"// Keys that don't have a valid di... | // KeyDigestEquals determines whether two public keys have the same digest. | [
"KeyDigestEquals",
"determines",
"whether",
"two",
"public",
"keys",
"have",
"the",
"same",
"digest",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L114-L123 |
31,122 | letsencrypt/boulder | core/util.go | PublicKeysEqual | func PublicKeysEqual(a, b interface{}) (bool, error) {
if a == nil || b == nil {
return false, errors.New("One or more nil arguments to PublicKeysEqual")
}
aBytes, err := x509.MarshalPKIXPublicKey(a)
if err != nil {
return false, err
}
bBytes, err := x509.MarshalPKIXPublicKey(b)
if err != nil {
return fals... | go | func PublicKeysEqual(a, b interface{}) (bool, error) {
if a == nil || b == nil {
return false, errors.New("One or more nil arguments to PublicKeysEqual")
}
aBytes, err := x509.MarshalPKIXPublicKey(a)
if err != nil {
return false, err
}
bBytes, err := x509.MarshalPKIXPublicKey(b)
if err != nil {
return fals... | [
"func",
"PublicKeysEqual",
"(",
"a",
",",
"b",
"interface",
"{",
"}",
")",
"(",
"bool",
",",
"error",
")",
"{",
"if",
"a",
"==",
"nil",
"||",
"b",
"==",
"nil",
"{",
"return",
"false",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
... | // PublicKeysEqual determines whether two public keys have the same marshalled
// bytes as one another | [
"PublicKeysEqual",
"determines",
"whether",
"two",
"public",
"keys",
"have",
"the",
"same",
"marshalled",
"bytes",
"as",
"one",
"another"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L127-L140 |
31,123 | letsencrypt/boulder | core/util.go | ValidSerial | func ValidSerial(serial string) bool {
// Originally, serial numbers were 32 hex characters long. We later increased
// them to 36, but we allow the shorter ones because they exist in some
// production databases.
if len(serial) != 32 && len(serial) != 36 {
return false
}
_, err := hex.DecodeString(serial)
if ... | go | func ValidSerial(serial string) bool {
// Originally, serial numbers were 32 hex characters long. We later increased
// them to 36, but we allow the shorter ones because they exist in some
// production databases.
if len(serial) != 32 && len(serial) != 36 {
return false
}
_, err := hex.DecodeString(serial)
if ... | [
"func",
"ValidSerial",
"(",
"serial",
"string",
")",
"bool",
"{",
"// Originally, serial numbers were 32 hex characters long. We later increased",
"// them to 36, but we allow the shorter ones because they exist in some",
"// production databases.",
"if",
"len",
"(",
"serial",
")",
"... | // ValidSerial tests whether the input string represents a syntactically
// valid serial number, i.e., that it is a valid hex string between 32
// and 36 characters long. | [
"ValidSerial",
"tests",
"whether",
"the",
"input",
"string",
"represents",
"a",
"syntactically",
"valid",
"serial",
"number",
"i",
".",
"e",
".",
"that",
"it",
"is",
"a",
"valid",
"hex",
"string",
"between",
"32",
"and",
"36",
"characters",
"long",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L162-L174 |
31,124 | letsencrypt/boulder | core/util.go | UniqueLowerNames | func UniqueLowerNames(names []string) (unique []string) {
nameMap := make(map[string]int, len(names))
for _, name := range names {
nameMap[strings.ToLower(name)] = 1
}
unique = make([]string, 0, len(nameMap))
for name := range nameMap {
unique = append(unique, name)
}
sort.Strings(unique)
return
} | go | func UniqueLowerNames(names []string) (unique []string) {
nameMap := make(map[string]int, len(names))
for _, name := range names {
nameMap[strings.ToLower(name)] = 1
}
unique = make([]string, 0, len(nameMap))
for name := range nameMap {
unique = append(unique, name)
}
sort.Strings(unique)
return
} | [
"func",
"UniqueLowerNames",
"(",
"names",
"[",
"]",
"string",
")",
"(",
"unique",
"[",
"]",
"string",
")",
"{",
"nameMap",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"int",
",",
"len",
"(",
"names",
")",
")",
"\n",
"for",
"_",
",",
"name",
":=... | // UniqueLowerNames returns the set of all unique names in the input after all
// of them are lowercased. The returned names will be in their lowercased form
// and sorted alphabetically. | [
"UniqueLowerNames",
"returns",
"the",
"set",
"of",
"all",
"unique",
"names",
"in",
"the",
"input",
"after",
"all",
"of",
"them",
"are",
"lowercased",
".",
"The",
"returned",
"names",
"will",
"be",
"in",
"their",
"lowercased",
"form",
"and",
"sorted",
"alphab... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L206-L218 |
31,125 | letsencrypt/boulder | core/util.go | LoadCertBundle | func LoadCertBundle(filename string) ([]*x509.Certificate, error) {
bundleBytes, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
var bundle []*x509.Certificate
var block *pem.Block
rest := bundleBytes
for {
block, rest = pem.Decode(rest)
if block == nil {
break
}
if block.Type != ... | go | func LoadCertBundle(filename string) ([]*x509.Certificate, error) {
bundleBytes, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
var bundle []*x509.Certificate
var block *pem.Block
rest := bundleBytes
for {
block, rest = pem.Decode(rest)
if block == nil {
break
}
if block.Type != ... | [
"func",
"LoadCertBundle",
"(",
"filename",
"string",
")",
"(",
"[",
"]",
"*",
"x509",
".",
"Certificate",
",",
"error",
")",
"{",
"bundleBytes",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"filename",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"... | // LoadCertBundle loads a PEM bundle of certificates from disk | [
"LoadCertBundle",
"loads",
"a",
"PEM",
"bundle",
"of",
"certificates",
"from",
"disk"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L221-L249 |
31,126 | letsencrypt/boulder | core/util.go | LoadCert | func LoadCert(filename string) (cert *x509.Certificate, err error) {
certPEM, err := ioutil.ReadFile(filename)
if err != nil {
return
}
block, _ := pem.Decode(certPEM)
if block == nil {
return nil, fmt.Errorf("No data in cert PEM file %s", filename)
}
cert, err = x509.ParseCertificate(block.Bytes)
return
} | go | func LoadCert(filename string) (cert *x509.Certificate, err error) {
certPEM, err := ioutil.ReadFile(filename)
if err != nil {
return
}
block, _ := pem.Decode(certPEM)
if block == nil {
return nil, fmt.Errorf("No data in cert PEM file %s", filename)
}
cert, err = x509.ParseCertificate(block.Bytes)
return
} | [
"func",
"LoadCert",
"(",
"filename",
"string",
")",
"(",
"cert",
"*",
"x509",
".",
"Certificate",
",",
"err",
"error",
")",
"{",
"certPEM",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"filename",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retur... | // LoadCert loads a PEM certificate specified by filename or returns an error | [
"LoadCert",
"loads",
"a",
"PEM",
"certificate",
"specified",
"by",
"filename",
"or",
"returns",
"an",
"error"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L252-L263 |
31,127 | letsencrypt/boulder | core/util.go | IsASCII | func IsASCII(str string) bool {
for _, r := range str {
if r > unicode.MaxASCII {
return false
}
}
return true
} | go | func IsASCII(str string) bool {
for _, r := range str {
if r > unicode.MaxASCII {
return false
}
}
return true
} | [
"func",
"IsASCII",
"(",
"str",
"string",
")",
"bool",
"{",
"for",
"_",
",",
"r",
":=",
"range",
"str",
"{",
"if",
"r",
">",
"unicode",
".",
"MaxASCII",
"{",
"return",
"false",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}"
] | // IsASCII determines if every character in a string is encoded in
// the ASCII character set. | [
"IsASCII",
"determines",
"if",
"every",
"character",
"in",
"a",
"string",
"is",
"encoded",
"in",
"the",
"ASCII",
"character",
"set",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/core/util.go#L293-L300 |
31,128 | letsencrypt/boulder | grpc/pb-marshalling.go | authzMetaToPB | func authzMetaToPB(authz core.Authorization) (*vapb.AuthzMeta, error) {
return &vapb.AuthzMeta{
Id: &authz.ID,
RegID: &authz.RegistrationID,
}, nil
} | go | func authzMetaToPB(authz core.Authorization) (*vapb.AuthzMeta, error) {
return &vapb.AuthzMeta{
Id: &authz.ID,
RegID: &authz.RegistrationID,
}, nil
} | [
"func",
"authzMetaToPB",
"(",
"authz",
"core",
".",
"Authorization",
")",
"(",
"*",
"vapb",
".",
"AuthzMeta",
",",
"error",
")",
"{",
"return",
"&",
"vapb",
".",
"AuthzMeta",
"{",
"Id",
":",
"&",
"authz",
".",
"ID",
",",
"RegID",
":",
"&",
"authz",
... | // This file defines functions to translate between the protobuf types and the
// code types. | [
"This",
"file",
"defines",
"functions",
"to",
"translate",
"between",
"the",
"protobuf",
"types",
"and",
"the",
"code",
"types",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/pb-marshalling.go#L26-L31 |
31,129 | letsencrypt/boulder | grpc/pb-marshalling.go | orderValid | func orderValid(order *corepb.Order) bool {
return order.Id != nil && order.BeganProcessing != nil && order.Created != nil && newOrderValid(order)
} | go | func orderValid(order *corepb.Order) bool {
return order.Id != nil && order.BeganProcessing != nil && order.Created != nil && newOrderValid(order)
} | [
"func",
"orderValid",
"(",
"order",
"*",
"corepb",
".",
"Order",
")",
"bool",
"{",
"return",
"order",
".",
"Id",
"!=",
"nil",
"&&",
"order",
".",
"BeganProcessing",
"!=",
"nil",
"&&",
"order",
".",
"Created",
"!=",
"nil",
"&&",
"newOrderValid",
"(",
"o... | // orderValid checks that a corepb.Order is valid. In addition to the checks
// from `newOrderValid` it ensures the order ID, the BeganProcessing fields
// and the Created field are not nil. | [
"orderValid",
"checks",
"that",
"a",
"corepb",
".",
"Order",
"is",
"valid",
".",
"In",
"addition",
"to",
"the",
"checks",
"from",
"newOrderValid",
"it",
"ensures",
"the",
"order",
"ID",
"the",
"BeganProcessing",
"fields",
"and",
"the",
"Created",
"field",
"a... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/pb-marshalling.go#L410-L412 |
31,130 | letsencrypt/boulder | grpc/pb-marshalling.go | newOrderValid | func newOrderValid(order *corepb.Order) bool {
return !(order.RegistrationID == nil || order.Expires == nil || order.Authorizations == nil || order.Names == nil)
} | go | func newOrderValid(order *corepb.Order) bool {
return !(order.RegistrationID == nil || order.Expires == nil || order.Authorizations == nil || order.Names == nil)
} | [
"func",
"newOrderValid",
"(",
"order",
"*",
"corepb",
".",
"Order",
")",
"bool",
"{",
"return",
"!",
"(",
"order",
".",
"RegistrationID",
"==",
"nil",
"||",
"order",
".",
"Expires",
"==",
"nil",
"||",
"order",
".",
"Authorizations",
"==",
"nil",
"||",
... | // newOrderValid checks that a corepb.Order is valid. It allows for a nil
// `order.Id` because the order has not been assigned an ID yet when it is being
// created initially. It allows `order.BeganProcessing` to be nil because
// `sa.NewOrder` explicitly sets it to the default value. It allows
// `order.Created` to b... | [
"newOrderValid",
"checks",
"that",
"a",
"corepb",
".",
"Order",
"is",
"valid",
".",
"It",
"allows",
"for",
"a",
"nil",
"order",
".",
"Id",
"because",
"the",
"order",
"has",
"not",
"been",
"assigned",
"an",
"ID",
"yet",
"when",
"it",
"is",
"being",
"cre... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/pb-marshalling.go#L421-L423 |
31,131 | letsencrypt/boulder | policy/pa.go | New | func New(challengeTypes map[string]bool) (*AuthorityImpl, error) {
pa := AuthorityImpl{
log: blog.Get(),
enabledChallenges: challengeTypes,
// We don't need real randomness for this.
pseudoRNG: rand.New(rand.NewSource(99)),
}
return &pa, nil
} | go | func New(challengeTypes map[string]bool) (*AuthorityImpl, error) {
pa := AuthorityImpl{
log: blog.Get(),
enabledChallenges: challengeTypes,
// We don't need real randomness for this.
pseudoRNG: rand.New(rand.NewSource(99)),
}
return &pa, nil
} | [
"func",
"New",
"(",
"challengeTypes",
"map",
"[",
"string",
"]",
"bool",
")",
"(",
"*",
"AuthorityImpl",
",",
"error",
")",
"{",
"pa",
":=",
"AuthorityImpl",
"{",
"log",
":",
"blog",
".",
"Get",
"(",
")",
",",
"enabledChallenges",
":",
"challengeTypes",
... | // New constructs a Policy Authority. | [
"New",
"constructs",
"a",
"Policy",
"Authority",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/policy/pa.go#L41-L51 |
31,132 | letsencrypt/boulder | policy/pa.go | SetHostnamePolicyFile | func (pa *AuthorityImpl) SetHostnamePolicyFile(f string) error {
var loadHandler func([]byte) error
if strings.HasSuffix(f, ".json") {
loadHandler = pa.loadHostnamePolicy(json.Unmarshal)
} else if strings.HasSuffix(f, ".yml") || strings.HasSuffix(f, ".yaml") {
loadHandler = pa.loadHostnamePolicy(yaml.Unmarshal)
... | go | func (pa *AuthorityImpl) SetHostnamePolicyFile(f string) error {
var loadHandler func([]byte) error
if strings.HasSuffix(f, ".json") {
loadHandler = pa.loadHostnamePolicy(json.Unmarshal)
} else if strings.HasSuffix(f, ".yml") || strings.HasSuffix(f, ".yaml") {
loadHandler = pa.loadHostnamePolicy(yaml.Unmarshal)
... | [
"func",
"(",
"pa",
"*",
"AuthorityImpl",
")",
"SetHostnamePolicyFile",
"(",
"f",
"string",
")",
"error",
"{",
"var",
"loadHandler",
"func",
"(",
"[",
"]",
"byte",
")",
"error",
"\n",
"if",
"strings",
".",
"HasSuffix",
"(",
"f",
",",
"\"",
"\"",
")",
... | // SetHostnamePolicyFile will load the given policy file, returning error if it
// fails. It will also start a reloader in case the file changes. It supports
// YAML and JSON serialization formats and chooses the correct unserialization
// method based on the file extension which must be ".yaml", ".yml", or ".json". | [
"SetHostnamePolicyFile",
"will",
"load",
"the",
"given",
"policy",
"file",
"returning",
"error",
"if",
"it",
"fails",
".",
"It",
"will",
"also",
"start",
"a",
"reloader",
"in",
"case",
"the",
"file",
"changes",
".",
"It",
"supports",
"YAML",
"and",
"JSON",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/policy/pa.go#L83-L98 |
31,133 | letsencrypt/boulder | policy/pa.go | processHostnamePolicy | func (pa *AuthorityImpl) processHostnamePolicy(policy blockedNamesPolicy) error {
nameMap := make(map[string]bool)
for _, v := range policy.HighRiskBlockedNames {
nameMap[v] = true
}
for _, v := range policy.AdminBlockedNames {
nameMap[v] = true
}
exactNameMap := make(map[string]bool)
wildcardNameMap := make... | go | func (pa *AuthorityImpl) processHostnamePolicy(policy blockedNamesPolicy) error {
nameMap := make(map[string]bool)
for _, v := range policy.HighRiskBlockedNames {
nameMap[v] = true
}
for _, v := range policy.AdminBlockedNames {
nameMap[v] = true
}
exactNameMap := make(map[string]bool)
wildcardNameMap := make... | [
"func",
"(",
"pa",
"*",
"AuthorityImpl",
")",
"processHostnamePolicy",
"(",
"policy",
"blockedNamesPolicy",
")",
"error",
"{",
"nameMap",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"policy",
".",... | // processHostnamePolicy handles loading a new blockedNamesPolicy into the PA.
// All of the policy.ExactBlockedNames will be added to the
// wildcardExactBlocklist by processHostnamePolicy to ensure that wildcards for
// exact blocked names entries are forbidden. | [
"processHostnamePolicy",
"handles",
"loading",
"a",
"new",
"blockedNamesPolicy",
"into",
"the",
"PA",
".",
"All",
"of",
"the",
"policy",
".",
"ExactBlockedNames",
"will",
"be",
"added",
"to",
"the",
"wildcardExactBlocklist",
"by",
"processHostnamePolicy",
"to",
"ens... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/policy/pa.go#L136-L172 |
31,134 | letsencrypt/boulder | policy/pa.go | checkWildcardHostList | func (pa *AuthorityImpl) checkWildcardHostList(domain string) error {
pa.blocklistMu.RLock()
defer pa.blocklistMu.RUnlock()
if pa.blocklist == nil {
return fmt.Errorf("Hostname policy not yet loaded.")
}
if pa.wildcardExactBlocklist[domain] {
return errPolicyForbidden
}
return nil
} | go | func (pa *AuthorityImpl) checkWildcardHostList(domain string) error {
pa.blocklistMu.RLock()
defer pa.blocklistMu.RUnlock()
if pa.blocklist == nil {
return fmt.Errorf("Hostname policy not yet loaded.")
}
if pa.wildcardExactBlocklist[domain] {
return errPolicyForbidden
}
return nil
} | [
"func",
"(",
"pa",
"*",
"AuthorityImpl",
")",
"checkWildcardHostList",
"(",
"domain",
"string",
")",
"error",
"{",
"pa",
".",
"blocklistMu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"pa",
".",
"blocklistMu",
".",
"RUnlock",
"(",
")",
"\n\n",
"if",
"pa",
... | // checkWildcardHostList checks the wildcardExactBlocklist for a given domain.
// If the domain is not present on the list nil is returned, otherwise
// errPolicyForbidden is returned. | [
"checkWildcardHostList",
"checks",
"the",
"wildcardExactBlocklist",
"for",
"a",
"given",
"domain",
".",
"If",
"the",
"domain",
"is",
"not",
"present",
"on",
"the",
"list",
"nil",
"is",
"returned",
"otherwise",
"errPolicyForbidden",
"is",
"returned",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/policy/pa.go#L403-L416 |
31,135 | letsencrypt/boulder | policy/pa.go | ChallengesFor | func (pa *AuthorityImpl) ChallengesFor(identifier core.AcmeIdentifier) ([]core.Challenge, error) {
challenges := []core.Challenge{}
// If we are using the new authorization storage schema we only use a single
// token for all challenges rather than a unique token per challenge.
var token string
if features.Enable... | go | func (pa *AuthorityImpl) ChallengesFor(identifier core.AcmeIdentifier) ([]core.Challenge, error) {
challenges := []core.Challenge{}
// If we are using the new authorization storage schema we only use a single
// token for all challenges rather than a unique token per challenge.
var token string
if features.Enable... | [
"func",
"(",
"pa",
"*",
"AuthorityImpl",
")",
"ChallengesFor",
"(",
"identifier",
"core",
".",
"AcmeIdentifier",
")",
"(",
"[",
"]",
"core",
".",
"Challenge",
",",
"error",
")",
"{",
"challenges",
":=",
"[",
"]",
"core",
".",
"Challenge",
"{",
"}",
"\n... | // ChallengesFor makes a decision of what challenges are acceptable for
// the given identifier. | [
"ChallengesFor",
"makes",
"a",
"decision",
"of",
"what",
"challenges",
"are",
"acceptable",
"for",
"the",
"given",
"identifier",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/policy/pa.go#L442-L490 |
31,136 | letsencrypt/boulder | policy/pa.go | ChallengeTypeEnabled | func (pa *AuthorityImpl) ChallengeTypeEnabled(t string) bool {
pa.blocklistMu.RLock()
defer pa.blocklistMu.RUnlock()
return pa.enabledChallenges[t]
} | go | func (pa *AuthorityImpl) ChallengeTypeEnabled(t string) bool {
pa.blocklistMu.RLock()
defer pa.blocklistMu.RUnlock()
return pa.enabledChallenges[t]
} | [
"func",
"(",
"pa",
"*",
"AuthorityImpl",
")",
"ChallengeTypeEnabled",
"(",
"t",
"string",
")",
"bool",
"{",
"pa",
".",
"blocklistMu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"pa",
".",
"blocklistMu",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"pa",
".",
... | // ChallengeTypeEnabled returns whether the specified challenge type is enabled | [
"ChallengeTypeEnabled",
"returns",
"whether",
"the",
"specified",
"challenge",
"type",
"is",
"enabled"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/policy/pa.go#L493-L497 |
31,137 | letsencrypt/boulder | nonce/nonce.go | NewNonceService | func NewNonceService(scope metrics.Scope) (*NonceService, error) {
scope = scope.NewScope("NonceService")
key := make([]byte, 16)
if _, err := rand.Read(key); err != nil {
return nil, err
}
c, err := aes.NewCipher(key)
if err != nil {
panic("Failure in NewCipher: " + err.Error())
}
gcm, err := cipher.NewGC... | go | func NewNonceService(scope metrics.Scope) (*NonceService, error) {
scope = scope.NewScope("NonceService")
key := make([]byte, 16)
if _, err := rand.Read(key); err != nil {
return nil, err
}
c, err := aes.NewCipher(key)
if err != nil {
panic("Failure in NewCipher: " + err.Error())
}
gcm, err := cipher.NewGC... | [
"func",
"NewNonceService",
"(",
"scope",
"metrics",
".",
"Scope",
")",
"(",
"*",
"NonceService",
",",
"error",
")",
"{",
"scope",
"=",
"scope",
".",
"NewScope",
"(",
"\"",
"\"",
")",
"\n",
"key",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"16",
")",... | // NewNonceService constructs a NonceService with defaults | [
"NewNonceService",
"constructs",
"a",
"NonceService",
"with",
"defaults"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/nonce/nonce.go#L68-L93 |
31,138 | letsencrypt/boulder | nonce/nonce.go | Nonce | func (ns *NonceService) Nonce() (string, error) {
ns.mu.Lock()
ns.latest++
latest := ns.latest
ns.mu.Unlock()
defer ns.stats.Inc("Generated", 1)
return ns.encrypt(latest)
} | go | func (ns *NonceService) Nonce() (string, error) {
ns.mu.Lock()
ns.latest++
latest := ns.latest
ns.mu.Unlock()
defer ns.stats.Inc("Generated", 1)
return ns.encrypt(latest)
} | [
"func",
"(",
"ns",
"*",
"NonceService",
")",
"Nonce",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"ns",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"ns",
".",
"latest",
"++",
"\n",
"latest",
":=",
"ns",
".",
"latest",
"\n",
"ns",
".",
"mu",
... | // Nonce provides a new Nonce. | [
"Nonce",
"provides",
"a",
"new",
"Nonce",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/nonce/nonce.go#L145-L152 |
31,139 | letsencrypt/boulder | nonce/nonce.go | Valid | func (ns *NonceService) Valid(nonce string) bool {
c, err := ns.decrypt(nonce)
if err != nil {
ns.stats.Inc("Invalid.Decrypt", 1)
return false
}
ns.mu.Lock()
defer ns.mu.Unlock()
if c > ns.latest {
ns.stats.Inc("Invalid.TooHigh", 1)
return false
}
if c <= ns.earliest {
ns.stats.Inc("Invalid.TooLow",... | go | func (ns *NonceService) Valid(nonce string) bool {
c, err := ns.decrypt(nonce)
if err != nil {
ns.stats.Inc("Invalid.Decrypt", 1)
return false
}
ns.mu.Lock()
defer ns.mu.Unlock()
if c > ns.latest {
ns.stats.Inc("Invalid.TooHigh", 1)
return false
}
if c <= ns.earliest {
ns.stats.Inc("Invalid.TooLow",... | [
"func",
"(",
"ns",
"*",
"NonceService",
")",
"Valid",
"(",
"nonce",
"string",
")",
"bool",
"{",
"c",
",",
"err",
":=",
"ns",
".",
"decrypt",
"(",
"nonce",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ns",
".",
"stats",
".",
"Inc",
"(",
"\"",
"\""... | // Valid determines whether the provided Nonce string is valid, returning
// true if so. | [
"Valid",
"determines",
"whether",
"the",
"provided",
"Nonce",
"string",
"is",
"valid",
"returning",
"true",
"if",
"so",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/nonce/nonce.go#L156-L191 |
31,140 | letsencrypt/boulder | ctpolicy/ctpolicy.go | New | func New(pub core.Publisher,
groups []cmd.CTGroup,
informational []cmd.LogDescription,
log blog.Logger,
stats metrics.Scope,
) *CTPolicy {
var finalLogs []cmd.LogDescription
for _, group := range groups {
for _, log := range group.Logs {
if log.SubmitFinalCert {
finalLogs = append(finalLogs, log)
}
... | go | func New(pub core.Publisher,
groups []cmd.CTGroup,
informational []cmd.LogDescription,
log blog.Logger,
stats metrics.Scope,
) *CTPolicy {
var finalLogs []cmd.LogDescription
for _, group := range groups {
for _, log := range group.Logs {
if log.SubmitFinalCert {
finalLogs = append(finalLogs, log)
}
... | [
"func",
"New",
"(",
"pub",
"core",
".",
"Publisher",
",",
"groups",
"[",
"]",
"cmd",
".",
"CTGroup",
",",
"informational",
"[",
"]",
"cmd",
".",
"LogDescription",
",",
"log",
"blog",
".",
"Logger",
",",
"stats",
"metrics",
".",
"Scope",
",",
")",
"*"... | // New creates a new CTPolicy struct | [
"New",
"creates",
"a",
"new",
"CTPolicy",
"struct"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ctpolicy/ctpolicy.go#L32-L69 |
31,141 | letsencrypt/boulder | ctpolicy/ctpolicy.go | GetSCTs | func (ctp *CTPolicy) GetSCTs(ctx context.Context, cert core.CertDER, expiration time.Time) (core.SCTDERs, error) {
results := make(chan result, len(ctp.groups))
subCtx, cancel := context.WithCancel(ctx)
defer cancel()
for i, g := range ctp.groups {
go func(i int, g cmd.CTGroup) {
sct, err := ctp.race(subCtx, c... | go | func (ctp *CTPolicy) GetSCTs(ctx context.Context, cert core.CertDER, expiration time.Time) (core.SCTDERs, error) {
results := make(chan result, len(ctp.groups))
subCtx, cancel := context.WithCancel(ctx)
defer cancel()
for i, g := range ctp.groups {
go func(i int, g cmd.CTGroup) {
sct, err := ctp.race(subCtx, c... | [
"func",
"(",
"ctp",
"*",
"CTPolicy",
")",
"GetSCTs",
"(",
"ctx",
"context",
".",
"Context",
",",
"cert",
"core",
".",
"CertDER",
",",
"expiration",
"time",
".",
"Time",
")",
"(",
"core",
".",
"SCTDERs",
",",
"error",
")",
"{",
"results",
":=",
"make"... | // GetSCTs attempts to retrieve a SCT from each configured grouping of logs and returns
// the set of SCTs to the caller. | [
"GetSCTs",
"attempts",
"to",
"retrieve",
"a",
"SCT",
"from",
"each",
"configured",
"grouping",
"of",
"logs",
"and",
"returns",
"the",
"set",
"of",
"SCTs",
"to",
"the",
"caller",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ctpolicy/ctpolicy.go#L143-L193 |
31,142 | letsencrypt/boulder | ctpolicy/ctpolicy.go | SubmitFinalCert | func (ctp *CTPolicy) SubmitFinalCert(cert []byte, expiration time.Time) {
falseVar := false
for _, log := range ctp.finalLogs {
go func(l cmd.LogDescription) {
uri, key, err := l.Info(expiration)
if err != nil {
ctp.log.Errf("unable to get log info: %s", err)
return
}
_, err = ctp.pub.SubmitToSi... | go | func (ctp *CTPolicy) SubmitFinalCert(cert []byte, expiration time.Time) {
falseVar := false
for _, log := range ctp.finalLogs {
go func(l cmd.LogDescription) {
uri, key, err := l.Info(expiration)
if err != nil {
ctp.log.Errf("unable to get log info: %s", err)
return
}
_, err = ctp.pub.SubmitToSi... | [
"func",
"(",
"ctp",
"*",
"CTPolicy",
")",
"SubmitFinalCert",
"(",
"cert",
"[",
"]",
"byte",
",",
"expiration",
"time",
".",
"Time",
")",
"{",
"falseVar",
":=",
"false",
"\n",
"for",
"_",
",",
"log",
":=",
"range",
"ctp",
".",
"finalLogs",
"{",
"go",
... | // SubmitFinalCert submits finalized certificates created from precertificates
// to any configured logs | [
"SubmitFinalCert",
"submits",
"finalized",
"certificates",
"created",
"from",
"precertificates",
"to",
"any",
"configured",
"logs"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ctpolicy/ctpolicy.go#L197-L218 |
31,143 | letsencrypt/boulder | web/context.go | WriteHeader | func (r *responseWriterWithStatus) WriteHeader(code int) {
r.code = code
r.ResponseWriter.WriteHeader(code)
} | go | func (r *responseWriterWithStatus) WriteHeader(code int) {
r.code = code
r.ResponseWriter.WriteHeader(code)
} | [
"func",
"(",
"r",
"*",
"responseWriterWithStatus",
")",
"WriteHeader",
"(",
"code",
"int",
")",
"{",
"r",
".",
"code",
"=",
"code",
"\n",
"r",
".",
"ResponseWriter",
".",
"WriteHeader",
"(",
"code",
")",
"\n",
"}"
] | // WriteHeader stores a status code for generating stats. | [
"WriteHeader",
"stores",
"a",
"status",
"code",
"for",
"generating",
"stats",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/web/context.go#L83-L86 |
31,144 | letsencrypt/boulder | grpc/va-wrappers.go | PerformValidation | func (vac ValidationAuthorityGRPCClient) PerformValidation(ctx context.Context, domain string, challenge core.Challenge, authz core.Authorization) ([]core.ValidationRecord, error) {
req, err := argsToPerformValidationRequest(domain, challenge, authz)
if err != nil {
return nil, err
}
gRecords, err := vac.gc.Perfo... | go | func (vac ValidationAuthorityGRPCClient) PerformValidation(ctx context.Context, domain string, challenge core.Challenge, authz core.Authorization) ([]core.ValidationRecord, error) {
req, err := argsToPerformValidationRequest(domain, challenge, authz)
if err != nil {
return nil, err
}
gRecords, err := vac.gc.Perfo... | [
"func",
"(",
"vac",
"ValidationAuthorityGRPCClient",
")",
"PerformValidation",
"(",
"ctx",
"context",
".",
"Context",
",",
"domain",
"string",
",",
"challenge",
"core",
".",
"Challenge",
",",
"authz",
"core",
".",
"Authorization",
")",
"(",
"[",
"]",
"core",
... | // PerformValidation has the VA revalidate the specified challenge and returns
// the updated Challenge object. | [
"PerformValidation",
"has",
"the",
"VA",
"revalidate",
"the",
"specified",
"challenge",
"and",
"returns",
"the",
"updated",
"Challenge",
"object",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/va-wrappers.go#L57-L77 |
31,145 | letsencrypt/boulder | wfe2/wfe.go | requestProto | func requestProto(request *http.Request) string {
proto := "http"
// If the request was received via TLS, use `https://` for the protocol
if request.TLS != nil {
proto = "https"
}
// Allow upstream proxies to specify the forwarded protocol. Allow this value
// to override our own guess.
if specifiedProto :=... | go | func requestProto(request *http.Request) string {
proto := "http"
// If the request was received via TLS, use `https://` for the protocol
if request.TLS != nil {
proto = "https"
}
// Allow upstream proxies to specify the forwarded protocol. Allow this value
// to override our own guess.
if specifiedProto :=... | [
"func",
"requestProto",
"(",
"request",
"*",
"http",
".",
"Request",
")",
"string",
"{",
"proto",
":=",
"\"",
"\"",
"\n\n",
"// If the request was received via TLS, use `https://` for the protocol",
"if",
"request",
".",
"TLS",
"!=",
"nil",
"{",
"proto",
"=",
"\""... | // requestProto returns "http" for HTTP requests and "https" for HTTPS
// requests. It supports the use of "X-Forwarded-Proto" to override the protocol. | [
"requestProto",
"returns",
"http",
"for",
"HTTP",
"requests",
"and",
"https",
"for",
"HTTPS",
"requests",
".",
"It",
"supports",
"the",
"use",
"of",
"X",
"-",
"Forwarded",
"-",
"Proto",
"to",
"override",
"the",
"protocol",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L251-L266 |
31,146 | letsencrypt/boulder | wfe2/wfe.go | Nonce | func (wfe *WebFrontEndImpl) Nonce(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
statusCode := http.StatusNoContent
// The ACME specification says GET requets should receive http.StatusNoContent
// and HEAD requests should receive http.StatusOK. We gate t... | go | func (wfe *WebFrontEndImpl) Nonce(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
statusCode := http.StatusNoContent
// The ACME specification says GET requets should receive http.StatusNoContent
// and HEAD requests should receive http.StatusOK. We gate t... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"Nonce",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
"{",
"sta... | // Nonce is an endpoint for getting a fresh nonce with an HTTP GET or HEAD
// request. This endpoint only returns a status code header - the `HandleFunc`
// wrapper ensures that a nonce is written in the correct response header. | [
"Nonce",
"is",
"an",
"endpoint",
"for",
"getting",
"a",
"fresh",
"nonce",
"with",
"an",
"HTTP",
"GET",
"or",
"HEAD",
"request",
".",
"This",
"endpoint",
"only",
"returns",
"a",
"status",
"code",
"header",
"-",
"the",
"HandleFunc",
"wrapper",
"ensures",
"th... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L436-L450 |
31,147 | letsencrypt/boulder | wfe2/wfe.go | processRevocation | func (wfe *WebFrontEndImpl) processRevocation(
ctx context.Context,
jwsBody []byte,
acctID int64,
authorizedToRevoke authorizedToRevokeCert,
request *http.Request,
logEvent *web.RequestEvent) *probs.ProblemDetails {
// Read the revoke request from the JWS payload
var revokeRequest struct {
CertificateDER core... | go | func (wfe *WebFrontEndImpl) processRevocation(
ctx context.Context,
jwsBody []byte,
acctID int64,
authorizedToRevoke authorizedToRevokeCert,
request *http.Request,
logEvent *web.RequestEvent) *probs.ProblemDetails {
// Read the revoke request from the JWS payload
var revokeRequest struct {
CertificateDER core... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"processRevocation",
"(",
"ctx",
"context",
".",
"Context",
",",
"jwsBody",
"[",
"]",
"byte",
",",
"acctID",
"int64",
",",
"authorizedToRevoke",
"authorizedToRevokeCert",
",",
"request",
"*",
"http",
".",
"Reque... | // processRevocation accepts the payload for a revocation request along with
// an account ID and a callback used to decide if the requester is authorized to
// revoke a given certificate. If the request can not be authenticated or the
// requester is not authorized to revoke the certificate requested a problem is
// ... | [
"processRevocation",
"accepts",
"the",
"payload",
"for",
"a",
"revocation",
"request",
"along",
"with",
"an",
"account",
"ID",
"and",
"a",
"callback",
"used",
"to",
"decide",
"if",
"the",
"requester",
"is",
"authorized",
"to",
"revoke",
"a",
"given",
"certific... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L629-L711 |
31,148 | letsencrypt/boulder | wfe2/wfe.go | revokeCertByKeyID | func (wfe *WebFrontEndImpl) revokeCertByKeyID(
ctx context.Context,
outerJWS *jose.JSONWebSignature,
request *http.Request,
logEvent *web.RequestEvent) *probs.ProblemDetails {
// For Key ID revocations we authenticate the outer JWS by using
// `validJWSForAccount` similar to other WFE endpoints
jwsBody, _, acct,... | go | func (wfe *WebFrontEndImpl) revokeCertByKeyID(
ctx context.Context,
outerJWS *jose.JSONWebSignature,
request *http.Request,
logEvent *web.RequestEvent) *probs.ProblemDetails {
// For Key ID revocations we authenticate the outer JWS by using
// `validJWSForAccount` similar to other WFE endpoints
jwsBody, _, acct,... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"revokeCertByKeyID",
"(",
"ctx",
"context",
".",
"Context",
",",
"outerJWS",
"*",
"jose",
".",
"JSONWebSignature",
",",
"request",
"*",
"http",
".",
"Request",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",... | // revokeCertByKeyID processes an outer JWS as a revocation request that is
// authenticated by a KeyID and the associated account. | [
"revokeCertByKeyID",
"processes",
"an",
"outer",
"JWS",
"as",
"a",
"revocation",
"request",
"that",
"is",
"authenticated",
"by",
"a",
"KeyID",
"and",
"the",
"associated",
"account",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L715-L748 |
31,149 | letsencrypt/boulder | wfe2/wfe.go | revokeCertByJWK | func (wfe *WebFrontEndImpl) revokeCertByJWK(
ctx context.Context,
outerJWS *jose.JSONWebSignature,
request *http.Request,
logEvent *web.RequestEvent) *probs.ProblemDetails {
// We maintain the requestKey as a var that is closed-over by the
// `authorizedToRevoke` function to use
var requestKey *jose.JSONWebKey
... | go | func (wfe *WebFrontEndImpl) revokeCertByJWK(
ctx context.Context,
outerJWS *jose.JSONWebSignature,
request *http.Request,
logEvent *web.RequestEvent) *probs.ProblemDetails {
// We maintain the requestKey as a var that is closed-over by the
// `authorizedToRevoke` function to use
var requestKey *jose.JSONWebKey
... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"revokeCertByJWK",
"(",
"ctx",
"context",
".",
"Context",
",",
"outerJWS",
"*",
"jose",
".",
"JSONWebSignature",
",",
"request",
"*",
"http",
".",
"Request",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
... | // revokeCertByJWK processes an outer JWS as a revocation request that is
// authenticated by an embedded JWK. E.g. in the case where someone is
// requesting a revocation by using the keypair associated with the certificate
// to be revoked | [
"revokeCertByJWK",
"processes",
"an",
"outer",
"JWS",
"as",
"a",
"revocation",
"request",
"that",
"is",
"authenticated",
"by",
"an",
"embedded",
"JWK",
".",
"E",
".",
"g",
".",
"in",
"the",
"case",
"where",
"someone",
"is",
"requesting",
"a",
"revocation",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L754-L784 |
31,150 | letsencrypt/boulder | wfe2/wfe.go | RevokeCertificate | func (wfe *WebFrontEndImpl) RevokeCertificate(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
// The ACME specification handles the verification of revocation requests
// differently from other endpoints. For this reason we do *not* immediately
// call `w... | go | func (wfe *WebFrontEndImpl) RevokeCertificate(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
// The ACME specification handles the verification of revocation requests
// differently from other endpoints. For this reason we do *not* immediately
// call `w... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"RevokeCertificate",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
... | // RevokeCertificate is used by clients to request the revocation of a cert. The
// revocation request is handled uniquely based on the method of authentication
// used. | [
"RevokeCertificate",
"is",
"used",
"by",
"clients",
"to",
"request",
"the",
"revocation",
"of",
"a",
"cert",
".",
"The",
"revocation",
"request",
"is",
"handled",
"uniquely",
"based",
"on",
"the",
"method",
"of",
"authentication",
"used",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L789-L831 |
31,151 | letsencrypt/boulder | wfe2/wfe.go | prepChallengeForDisplay | func (wfe *WebFrontEndImpl) prepChallengeForDisplay(request *http.Request, authz core.Authorization, challenge *core.Challenge) {
// Update the challenge URL to be relative to the HTTP request Host
if authz.V2 {
challenge.URL = web.RelativeEndpoint(request, fmt.Sprintf("%sv2/%s/%s", challengePath, authz.ID, challen... | go | func (wfe *WebFrontEndImpl) prepChallengeForDisplay(request *http.Request, authz core.Authorization, challenge *core.Challenge) {
// Update the challenge URL to be relative to the HTTP request Host
if authz.V2 {
challenge.URL = web.RelativeEndpoint(request, fmt.Sprintf("%sv2/%s/%s", challengePath, authz.ID, challen... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"prepChallengeForDisplay",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"authz",
"core",
".",
"Authorization",
",",
"challenge",
"*",
"core",
".",
"Challenge",
")",
"{",
"// Update the challenge URL to be relat... | // prepChallengeForDisplay takes a core.Challenge and prepares it for display to
// the client by filling in its URL field and clearing its ID and URI fields. | [
"prepChallengeForDisplay",
"takes",
"a",
"core",
".",
"Challenge",
"and",
"prepares",
"it",
"for",
"display",
"to",
"the",
"client",
"by",
"filling",
"in",
"its",
"URL",
"field",
"and",
"clearing",
"its",
"ID",
"and",
"URI",
"fields",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L956-L985 |
31,152 | letsencrypt/boulder | wfe2/wfe.go | Account | func (wfe *WebFrontEndImpl) Account(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
body, _, currAcct, prob := wfe.validPOSTForAccount(request, ctx, logEvent)
addRequesterHeader(response, logEvent.Requester)
if prob != nil {
// validPOSTForAccount handle... | go | func (wfe *WebFrontEndImpl) Account(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
body, _, currAcct, prob := wfe.validPOSTForAccount(request, ctx, logEvent)
addRequesterHeader(response, logEvent.Requester)
if prob != nil {
// validPOSTForAccount handle... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"Account",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
"{",
"b... | // Account is used by a client to submit an update to their account. | [
"Account",
"is",
"used",
"by",
"a",
"client",
"to",
"submit",
"an",
"update",
"to",
"their",
"account",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L1132-L1190 |
31,153 | letsencrypt/boulder | wfe2/wfe.go | Issuer | func (wfe *WebFrontEndImpl) Issuer(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
// TODO Content negotiation
response.Header().Set("Content-Type", "application/pkix-cert")
response.WriteHeader(http.StatusOK)
if _, err := response.Write(wfe.IssuerCert); err !... | go | func (wfe *WebFrontEndImpl) Issuer(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
// TODO Content negotiation
response.Header().Set("Content-Type", "application/pkix-cert")
response.WriteHeader(http.StatusOK)
if _, err := response.Write(wfe.IssuerCert); err !... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"Issuer",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
"{",
"//... | // Issuer obtains the issuer certificate used by this instance of Boulder. | [
"Issuer",
"obtains",
"the",
"issuer",
"certificate",
"used",
"by",
"this",
"instance",
"of",
"Boulder",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L1498-L1505 |
31,154 | letsencrypt/boulder | wfe2/wfe.go | BuildID | func (wfe *WebFrontEndImpl) BuildID(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
response.Header().Set("Content-Type", "text/plain")
response.WriteHeader(http.StatusOK)
detailsString := fmt.Sprintf("Boulder=(%s %s)", core.GetBuildID(), core.GetBuildTime())
... | go | func (wfe *WebFrontEndImpl) BuildID(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
response.Header().Set("Content-Type", "text/plain")
response.WriteHeader(http.StatusOK)
detailsString := fmt.Sprintf("Boulder=(%s %s)", core.GetBuildID(), core.GetBuildTime())
... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"BuildID",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
"{",
"r... | // BuildID tells the requestor what build we're running. | [
"BuildID",
"tells",
"the",
"requestor",
"what",
"build",
"we",
"re",
"running",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L1508-L1515 |
31,155 | letsencrypt/boulder | wfe2/wfe.go | Options | func (wfe *WebFrontEndImpl) Options(response http.ResponseWriter, request *http.Request, methodsStr string, methodsMap map[string]bool) {
// Every OPTIONS request gets an Allow header with a list of supported methods.
response.Header().Set("Allow", methodsStr)
// CORS preflight requests get additional headers. See
... | go | func (wfe *WebFrontEndImpl) Options(response http.ResponseWriter, request *http.Request, methodsStr string, methodsMap map[string]bool) {
// Every OPTIONS request gets an Allow header with a list of supported methods.
response.Header().Set("Allow", methodsStr)
// CORS preflight requests get additional headers. See
... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"Options",
"(",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
",",
"methodsStr",
"string",
",",
"methodsMap",
"map",
"[",
"string",
"]",
"bool",
")",
"{",
"// Every ... | // Options responds to an HTTP OPTIONS request. | [
"Options",
"responds",
"to",
"an",
"HTTP",
"OPTIONS",
"request",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L1518-L1531 |
31,156 | letsencrypt/boulder | wfe2/wfe.go | NewOrder | func (wfe *WebFrontEndImpl) NewOrder(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
body, _, acct, prob := wfe.validPOSTForAccount(request, ctx, logEvent)
addRequesterHeader(response, logEvent.Requester)
if prob != nil {
// validPOSTForAccount handles i... | go | func (wfe *WebFrontEndImpl) NewOrder(
ctx context.Context,
logEvent *web.RequestEvent,
response http.ResponseWriter,
request *http.Request) {
body, _, acct, prob := wfe.validPOSTForAccount(request, ctx, logEvent)
addRequesterHeader(response, logEvent.Requester)
if prob != nil {
// validPOSTForAccount handles i... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"NewOrder",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
"{",
"... | // NewOrder is used by clients to create a new order object from a CSR | [
"NewOrder",
"is",
"used",
"by",
"clients",
"to",
"create",
"a",
"new",
"order",
"object",
"from",
"a",
"CSR"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L1718-L1789 |
31,157 | letsencrypt/boulder | wfe2/wfe.go | GetOrder | func (wfe *WebFrontEndImpl) GetOrder(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
var requesterAccount *core.Registration
// Any POSTs to the Order endpoint should be POST-as-GET requests. There are
// no POSTs with a body allowed for this endpoint.
if requ... | go | func (wfe *WebFrontEndImpl) GetOrder(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
var requesterAccount *core.Registration
// Any POSTs to the Order endpoint should be POST-as-GET requests. There are
// no POSTs with a body allowed for this endpoint.
if requ... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"GetOrder",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
"{",
"... | // GetOrder is used to retrieve a existing order object | [
"GetOrder",
"is",
"used",
"to",
"retrieve",
"a",
"existing",
"order",
"object"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe2/wfe.go#L1792-L1852 |
31,158 | letsencrypt/boulder | cmd/notify-mailer/main.go | resolveEmailAddresses | func (m *mailer) resolveEmailAddresses() (emailToRecipientMap, error) {
result := make(emailToRecipientMap, len(m.destinations))
for _, r := range m.destinations {
// Get the email address for the reg ID
emails, err := emailsForReg(r.id, m.dbMap)
if err != nil {
return nil, err
}
for _, email := range ... | go | func (m *mailer) resolveEmailAddresses() (emailToRecipientMap, error) {
result := make(emailToRecipientMap, len(m.destinations))
for _, r := range m.destinations {
// Get the email address for the reg ID
emails, err := emailsForReg(r.id, m.dbMap)
if err != nil {
return nil, err
}
for _, email := range ... | [
"func",
"(",
"m",
"*",
"mailer",
")",
"resolveEmailAddresses",
"(",
")",
"(",
"emailToRecipientMap",
",",
"error",
")",
"{",
"result",
":=",
"make",
"(",
"emailToRecipientMap",
",",
"len",
"(",
"m",
".",
"destinations",
")",
")",
"\n\n",
"for",
"_",
",",... | // resolveEmailAddresses looks up the id of each recipient to find that
// account's email addresses, then adds that recipient to a map from address to
// recipient struct. | [
"resolveEmailAddresses",
"looks",
"up",
"the",
"id",
"of",
"each",
"recipient",
"to",
"find",
"that",
"account",
"s",
"email",
"addresses",
"then",
"adds",
"that",
"recipient",
"to",
"a",
"map",
"from",
"address",
"to",
"recipient",
"struct",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/notify-mailer/main.go#L184-L205 |
31,159 | letsencrypt/boulder | cmd/notify-mailer/main.go | emailsForReg | func emailsForReg(id int, dbMap dbSelector) ([]string, error) {
var contact contactJSON
err := dbMap.SelectOne(&contact,
`SELECT id, contact
FROM registrations
WHERE contact != 'null' AND id = :id;`,
map[string]interface{}{
"id": id,
})
if err == sql.ErrNoRows {
return []string{}, nil
}
if err != ni... | go | func emailsForReg(id int, dbMap dbSelector) ([]string, error) {
var contact contactJSON
err := dbMap.SelectOne(&contact,
`SELECT id, contact
FROM registrations
WHERE contact != 'null' AND id = :id;`,
map[string]interface{}{
"id": id,
})
if err == sql.ErrNoRows {
return []string{}, nil
}
if err != ni... | [
"func",
"emailsForReg",
"(",
"id",
"int",
",",
"dbMap",
"dbSelector",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"var",
"contact",
"contactJSON",
"\n",
"err",
":=",
"dbMap",
".",
"SelectOne",
"(",
"&",
"contact",
",",
"`SELECT id, contact\n\t\tF... | // Finds the email addresses associated with a reg ID | [
"Finds",
"the",
"email",
"addresses",
"associated",
"with",
"a",
"reg",
"ID"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/notify-mailer/main.go#L216-L244 |
31,160 | letsencrypt/boulder | cmd/notify-mailer/main.go | readRecipientsList | func readRecipientsList(filename string) ([]recipient, error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}
reader := csv.NewReader(f)
record, err := reader.Read()
if err != nil {
return nil, err
}
if len(record) == 0 {
return nil, fmt.Errorf("no entries in CSV")
}
if record[0] != "id"... | go | func readRecipientsList(filename string) ([]recipient, error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}
reader := csv.NewReader(f)
record, err := reader.Read()
if err != nil {
return nil, err
}
if len(record) == 0 {
return nil, fmt.Errorf("no entries in CSV")
}
if record[0] != "id"... | [
"func",
"readRecipientsList",
"(",
"filename",
"string",
")",
"(",
"[",
"]",
"recipient",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"filename",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n"... | // readRecipientsList reads a CSV filename and parses that file into a list of
// recipient structs. It puts any columns after the first into a per-recipient
// map from column name -> value. | [
"readRecipientsList",
"reads",
"a",
"CSV",
"filename",
"and",
"parses",
"that",
"file",
"into",
"a",
"list",
"of",
"recipient",
"structs",
".",
"It",
"puts",
"any",
"columns",
"after",
"the",
"first",
"into",
"a",
"per",
"-",
"recipient",
"map",
"from",
"c... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/notify-mailer/main.go#L260-L313 |
31,161 | letsencrypt/boulder | log/mock.go | newMockWriter | func newMockWriter() *mockWriter {
msgChan := make(chan string)
getChan := make(chan []string)
clearChan := make(chan struct{})
closeChan := make(chan struct{})
w := &mockWriter{
logged: []string{},
msgChan: msgChan,
getChan: getChan,
clearChan: clearChan,
closeChan: closeChan,
}
go func() {
f... | go | func newMockWriter() *mockWriter {
msgChan := make(chan string)
getChan := make(chan []string)
clearChan := make(chan struct{})
closeChan := make(chan struct{})
w := &mockWriter{
logged: []string{},
msgChan: msgChan,
getChan: getChan,
clearChan: clearChan,
closeChan: closeChan,
}
go func() {
f... | [
"func",
"newMockWriter",
"(",
")",
"*",
"mockWriter",
"{",
"msgChan",
":=",
"make",
"(",
"chan",
"string",
")",
"\n",
"getChan",
":=",
"make",
"(",
"chan",
"[",
"]",
"string",
")",
"\n",
"clearChan",
":=",
"make",
"(",
"chan",
"struct",
"{",
"}",
")"... | // newMockWriter returns a new mockWriter | [
"newMockWriter",
"returns",
"a",
"new",
"mockWriter"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/log/mock.go#L50-L77 |
31,162 | letsencrypt/boulder | cmd/config.go | Pass | func (pc *PasswordConfig) Pass() (string, error) {
if pc.PasswordFile != "" {
contents, err := ioutil.ReadFile(pc.PasswordFile)
if err != nil {
return "", err
}
return strings.TrimRight(string(contents), "\n"), nil
}
return pc.Password, nil
} | go | func (pc *PasswordConfig) Pass() (string, error) {
if pc.PasswordFile != "" {
contents, err := ioutil.ReadFile(pc.PasswordFile)
if err != nil {
return "", err
}
return strings.TrimRight(string(contents), "\n"), nil
}
return pc.Password, nil
} | [
"func",
"(",
"pc",
"*",
"PasswordConfig",
")",
"Pass",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"pc",
".",
"PasswordFile",
"!=",
"\"",
"\"",
"{",
"contents",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"pc",
".",
"PasswordFile",
... | // Pass returns a password, either directly from the configuration
// struct or by reading from a specified file | [
"Pass",
"returns",
"a",
"password",
"either",
"directly",
"from",
"the",
"configuration",
"struct",
"or",
"by",
"reading",
"from",
"a",
"specified",
"file"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L25-L34 |
31,163 | letsencrypt/boulder | cmd/config.go | URL | func (d *DBConfig) URL() (string, error) {
if d.DBConnectFile != "" {
url, err := ioutil.ReadFile(d.DBConnectFile)
return strings.TrimSpace(string(url)), err
}
return d.DBConnect, nil
} | go | func (d *DBConfig) URL() (string, error) {
if d.DBConnectFile != "" {
url, err := ioutil.ReadFile(d.DBConnectFile)
return strings.TrimSpace(string(url)), err
}
return d.DBConnect, nil
} | [
"func",
"(",
"d",
"*",
"DBConfig",
")",
"URL",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"d",
".",
"DBConnectFile",
"!=",
"\"",
"\"",
"{",
"url",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"d",
".",
"DBConnectFile",
")",
"\n",... | // URL returns the DBConnect URL represented by this DBConfig object, either
// loading it from disk or returning a default value. Leading and trailing
// whitespace is stripped. | [
"URL",
"returns",
"the",
"DBConnect",
"URL",
"represented",
"by",
"this",
"DBConfig",
"object",
"either",
"loading",
"it",
"from",
"disk",
"or",
"returning",
"a",
"default",
"value",
".",
"Leading",
"and",
"trailing",
"whitespace",
"is",
"stripped",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L58-L64 |
31,164 | letsencrypt/boulder | cmd/config.go | CheckChallenges | func (pc PAConfig) CheckChallenges() error {
if len(pc.Challenges) == 0 {
return errors.New("empty challenges map in the Policy Authority config is not allowed")
}
for name := range pc.Challenges {
if !core.ValidChallenge(name) {
return fmt.Errorf("Invalid challenge in PA config: %s", name)
}
}
return nil... | go | func (pc PAConfig) CheckChallenges() error {
if len(pc.Challenges) == 0 {
return errors.New("empty challenges map in the Policy Authority config is not allowed")
}
for name := range pc.Challenges {
if !core.ValidChallenge(name) {
return fmt.Errorf("Invalid challenge in PA config: %s", name)
}
}
return nil... | [
"func",
"(",
"pc",
"PAConfig",
")",
"CheckChallenges",
"(",
")",
"error",
"{",
"if",
"len",
"(",
"pc",
".",
"Challenges",
")",
"==",
"0",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"for",
"name",
":=",
"range",
"p... | // CheckChallenges checks whether the list of challenges in the PA config
// actually contains valid challenge names | [
"CheckChallenges",
"checks",
"whether",
"the",
"list",
"of",
"challenges",
"in",
"the",
"PA",
"config",
"actually",
"contains",
"valid",
"challenge",
"names"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L89-L99 |
31,165 | letsencrypt/boulder | cmd/config.go | UnmarshalJSON | func (d *ConfigDuration) UnmarshalJSON(b []byte) error {
s := ""
err := json.Unmarshal(b, &s)
if err != nil {
if _, ok := err.(*json.UnmarshalTypeError); ok {
return ErrDurationMustBeString
}
return err
}
dd, err := time.ParseDuration(s)
d.Duration = dd
return err
} | go | func (d *ConfigDuration) UnmarshalJSON(b []byte) error {
s := ""
err := json.Unmarshal(b, &s)
if err != nil {
if _, ok := err.(*json.UnmarshalTypeError); ok {
return ErrDurationMustBeString
}
return err
}
dd, err := time.ParseDuration(s)
d.Duration = dd
return err
} | [
"func",
"(",
"d",
"*",
"ConfigDuration",
")",
"UnmarshalJSON",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"s",
":=",
"\"",
"\"",
"\n",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"b",
",",
"&",
"s",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",... | // UnmarshalJSON parses a string into a ConfigDuration using
// time.ParseDuration. If the input does not unmarshal as a
// string, then UnmarshalJSON returns ErrDurationMustBeString. | [
"UnmarshalJSON",
"parses",
"a",
"string",
"into",
"a",
"ConfigDuration",
"using",
"time",
".",
"ParseDuration",
".",
"If",
"the",
"input",
"does",
"not",
"unmarshal",
"as",
"a",
"string",
"then",
"UnmarshalJSON",
"returns",
"ErrDurationMustBeString",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L210-L222 |
31,166 | letsencrypt/boulder | cmd/config.go | MarshalJSON | func (d ConfigDuration) MarshalJSON() ([]byte, error) {
return []byte(d.Duration.String()), nil
} | go | func (d ConfigDuration) MarshalJSON() ([]byte, error) {
return []byte(d.Duration.String()), nil
} | [
"func",
"(",
"d",
"ConfigDuration",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"[",
"]",
"byte",
"(",
"d",
".",
"Duration",
".",
"String",
"(",
")",
")",
",",
"nil",
"\n",
"}"
] | // MarshalJSON returns the string form of the duration, as a byte array. | [
"MarshalJSON",
"returns",
"the",
"string",
"form",
"of",
"the",
"duration",
"as",
"a",
"byte",
"array",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L225-L227 |
31,167 | letsencrypt/boulder | cmd/config.go | Setup | func (ts *TemporalSet) Setup() error {
if ts.Name == "" {
return errors.New("Name cannot be empty")
}
if len(ts.Shards) == 0 {
return errors.New("temporal set contains no shards")
}
for i := range ts.Shards {
if ts.Shards[i].WindowEnd.Before(ts.Shards[i].WindowStart) ||
ts.Shards[i].WindowEnd.Equal(ts.Sha... | go | func (ts *TemporalSet) Setup() error {
if ts.Name == "" {
return errors.New("Name cannot be empty")
}
if len(ts.Shards) == 0 {
return errors.New("temporal set contains no shards")
}
for i := range ts.Shards {
if ts.Shards[i].WindowEnd.Before(ts.Shards[i].WindowStart) ||
ts.Shards[i].WindowEnd.Equal(ts.Sha... | [
"func",
"(",
"ts",
"*",
"TemporalSet",
")",
"Setup",
"(",
")",
"error",
"{",
"if",
"ts",
".",
"Name",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"ts",
".",
"Shards",
")",
"=... | // Setup initializes the TemporalSet by parsing the start and end dates
// and verifying WindowEnd > WindowStart | [
"Setup",
"initializes",
"the",
"TemporalSet",
"by",
"parsing",
"the",
"start",
"and",
"end",
"dates",
"and",
"verifying",
"WindowEnd",
">",
"WindowStart"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L299-L313 |
31,168 | letsencrypt/boulder | cmd/config.go | pick | func (ts *TemporalSet) pick(exp time.Time) (*LogShard, error) {
for _, shard := range ts.Shards {
if exp.Before(shard.WindowStart) {
continue
}
if !exp.Before(shard.WindowEnd) {
continue
}
return &shard, nil
}
return nil, fmt.Errorf("no valid shard available for temporal set %q for expiration date %q... | go | func (ts *TemporalSet) pick(exp time.Time) (*LogShard, error) {
for _, shard := range ts.Shards {
if exp.Before(shard.WindowStart) {
continue
}
if !exp.Before(shard.WindowEnd) {
continue
}
return &shard, nil
}
return nil, fmt.Errorf("no valid shard available for temporal set %q for expiration date %q... | [
"func",
"(",
"ts",
"*",
"TemporalSet",
")",
"pick",
"(",
"exp",
"time",
".",
"Time",
")",
"(",
"*",
"LogShard",
",",
"error",
")",
"{",
"for",
"_",
",",
"shard",
":=",
"range",
"ts",
".",
"Shards",
"{",
"if",
"exp",
".",
"Before",
"(",
"shard",
... | // pick chooses the correct shard from a TemporalSet to use for the given
// expiration time. In the case where two shards have overlapping windows
// the earlier of the two shards will be chosen. | [
"pick",
"chooses",
"the",
"correct",
"shard",
"from",
"a",
"TemporalSet",
"to",
"use",
"for",
"the",
"given",
"expiration",
"time",
".",
"In",
"the",
"case",
"where",
"two",
"shards",
"have",
"overlapping",
"windows",
"the",
"earlier",
"of",
"the",
"two",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L318-L329 |
31,169 | letsencrypt/boulder | cmd/config.go | Info | func (ld LogDescription) Info(exp time.Time) (string, string, error) {
if ld.TemporalSet == nil {
return ld.URI, ld.Key, nil
}
shard, err := ld.TemporalSet.pick(exp)
if err != nil {
return "", "", err
}
return shard.URI, shard.Key, nil
} | go | func (ld LogDescription) Info(exp time.Time) (string, string, error) {
if ld.TemporalSet == nil {
return ld.URI, ld.Key, nil
}
shard, err := ld.TemporalSet.pick(exp)
if err != nil {
return "", "", err
}
return shard.URI, shard.Key, nil
} | [
"func",
"(",
"ld",
"LogDescription",
")",
"Info",
"(",
"exp",
"time",
".",
"Time",
")",
"(",
"string",
",",
"string",
",",
"error",
")",
"{",
"if",
"ld",
".",
"TemporalSet",
"==",
"nil",
"{",
"return",
"ld",
".",
"URI",
",",
"ld",
".",
"Key",
","... | // Info returns the URI and key of the log, either from a plain log description
// or from the earliest valid shard from a temporal log set | [
"Info",
"returns",
"the",
"URI",
"and",
"key",
"of",
"the",
"log",
"either",
"from",
"a",
"plain",
"log",
"description",
"or",
"from",
"the",
"earliest",
"valid",
"shard",
"from",
"a",
"temporal",
"log",
"set"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/config.go#L344-L353 |
31,170 | letsencrypt/boulder | grpc/balancer.go | Resolve | func (sr *staticResolver) Resolve(target string) (naming.Watcher, error) {
return sr, nil
} | go | func (sr *staticResolver) Resolve(target string) (naming.Watcher, error) {
return sr, nil
} | [
"func",
"(",
"sr",
"*",
"staticResolver",
")",
"Resolve",
"(",
"target",
"string",
")",
"(",
"naming",
".",
"Watcher",
",",
"error",
")",
"{",
"return",
"sr",
",",
"nil",
"\n",
"}"
] | // Resolve just returns the staticResolver it was called from as it satisfies
// both the naming.Resolver and naming.Watcher interfaces | [
"Resolve",
"just",
"returns",
"the",
"staticResolver",
"it",
"was",
"called",
"from",
"as",
"it",
"satisfies",
"both",
"the",
"naming",
".",
"Resolver",
"and",
"naming",
".",
"Watcher",
"interfaces"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/balancer.go#L26-L28 |
31,171 | letsencrypt/boulder | grpc/balancer.go | Next | func (sr *staticResolver) Next() ([]*naming.Update, error) {
if sr.addresses != nil {
addrs := sr.addresses
sr.addresses = nil
return addrs, nil
}
// Since staticResolver.Next is called in a tight loop block forever
// after returning the initial set of addresses
forever := make(chan struct{})
<-forever
re... | go | func (sr *staticResolver) Next() ([]*naming.Update, error) {
if sr.addresses != nil {
addrs := sr.addresses
sr.addresses = nil
return addrs, nil
}
// Since staticResolver.Next is called in a tight loop block forever
// after returning the initial set of addresses
forever := make(chan struct{})
<-forever
re... | [
"func",
"(",
"sr",
"*",
"staticResolver",
")",
"Next",
"(",
")",
"(",
"[",
"]",
"*",
"naming",
".",
"Update",
",",
"error",
")",
"{",
"if",
"sr",
".",
"addresses",
"!=",
"nil",
"{",
"addrs",
":=",
"sr",
".",
"addresses",
"\n",
"sr",
".",
"address... | // Next is called in a loop by grpc.RoundRobin expecting updates to which addresses are
// appropriate. Since we just want to return a static list once return a list on the first
// call then block forever on the second instead of sitting in a tight loop | [
"Next",
"is",
"called",
"in",
"a",
"loop",
"by",
"grpc",
".",
"RoundRobin",
"expecting",
"updates",
"to",
"which",
"addresses",
"are",
"appropriate",
".",
"Since",
"we",
"just",
"want",
"to",
"return",
"a",
"static",
"list",
"once",
"return",
"a",
"list",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/balancer.go#L33-L44 |
31,172 | letsencrypt/boulder | wfe/wfe.go | NewAuthorization | func (wfe *WebFrontEndImpl) NewAuthorization(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
body, _, currReg, prob := wfe.verifyPOST(ctx, logEvent, request, true, core.ResourceNewAuthz)
addRequesterHeader(response, logEvent.Requester)
if prob != nil {
// ver... | go | func (wfe *WebFrontEndImpl) NewAuthorization(ctx context.Context, logEvent *web.RequestEvent, response http.ResponseWriter, request *http.Request) {
body, _, currReg, prob := wfe.verifyPOST(ctx, logEvent, request, true, core.ResourceNewAuthz)
addRequesterHeader(response, logEvent.Requester)
if prob != nil {
// ver... | [
"func",
"(",
"wfe",
"*",
"WebFrontEndImpl",
")",
"NewAuthorization",
"(",
"ctx",
"context",
".",
"Context",
",",
"logEvent",
"*",
"web",
".",
"RequestEvent",
",",
"response",
"http",
".",
"ResponseWriter",
",",
"request",
"*",
"http",
".",
"Request",
")",
... | // NewAuthorization is used by clients to submit a new ID Authorization | [
"NewAuthorization",
"is",
"used",
"by",
"clients",
"to",
"submit",
"a",
"new",
"ID",
"Authorization"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/wfe/wfe.go#L656-L702 |
31,173 | letsencrypt/boulder | iana/iana.go | ExtractSuffix | func ExtractSuffix(name string) (string, error) {
if name == "" {
return "", fmt.Errorf("Blank name argument passed to ExtractSuffix")
}
rule := publicsuffix.DefaultList.Find(name, &publicsuffix.FindOptions{IgnorePrivate: true, DefaultRule: nil})
if rule == nil {
return "", fmt.Errorf("Domain %s has no IANA TL... | go | func ExtractSuffix(name string) (string, error) {
if name == "" {
return "", fmt.Errorf("Blank name argument passed to ExtractSuffix")
}
rule := publicsuffix.DefaultList.Find(name, &publicsuffix.FindOptions{IgnorePrivate: true, DefaultRule: nil})
if rule == nil {
return "", fmt.Errorf("Domain %s has no IANA TL... | [
"func",
"ExtractSuffix",
"(",
"name",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"name",
"==",
"\"",
"\"",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"rule",
":=",
"publicsuffix",... | // ExtractSuffix returns the public suffix of the domain using only the "ICANN"
// section of the Public Suffix List database.
// If the domain does not end in a suffix that belongs to an IANA-assigned
// domain, ExtractSuffix returns an error. | [
"ExtractSuffix",
"returns",
"the",
"public",
"suffix",
"of",
"the",
"domain",
"using",
"only",
"the",
"ICANN",
"section",
"of",
"the",
"Public",
"Suffix",
"List",
"database",
".",
"If",
"the",
"domain",
"does",
"not",
"end",
"in",
"a",
"suffix",
"that",
"b... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/iana/iana.go#L13-L32 |
31,174 | letsencrypt/boulder | web/probs.go | ProblemDetailsForError | func ProblemDetailsForError(err error, msg string) *probs.ProblemDetails {
switch e := err.(type) {
case *probs.ProblemDetails:
return e
case *berrors.BoulderError:
return problemDetailsForBoulderError(e, msg)
default:
// Internal server error messages may include sensitive data, so we do
// not include it.... | go | func ProblemDetailsForError(err error, msg string) *probs.ProblemDetails {
switch e := err.(type) {
case *probs.ProblemDetails:
return e
case *berrors.BoulderError:
return problemDetailsForBoulderError(e, msg)
default:
// Internal server error messages may include sensitive data, so we do
// not include it.... | [
"func",
"ProblemDetailsForError",
"(",
"err",
"error",
",",
"msg",
"string",
")",
"*",
"probs",
".",
"ProblemDetails",
"{",
"switch",
"e",
":=",
"err",
".",
"(",
"type",
")",
"{",
"case",
"*",
"probs",
".",
"ProblemDetails",
":",
"return",
"e",
"\n",
"... | // problemDetailsForError turns an error into a ProblemDetails with the special
// case of returning the same error back if its already a ProblemDetails. If the
// error is of an type unknown to ProblemDetailsForError, it will return a
// ServerInternal ProblemDetails. | [
"problemDetailsForError",
"turns",
"an",
"error",
"into",
"a",
"ProblemDetails",
"with",
"the",
"special",
"case",
"of",
"returning",
"the",
"same",
"error",
"back",
"if",
"its",
"already",
"a",
"ProblemDetails",
".",
"If",
"the",
"error",
"is",
"of",
"an",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/web/probs.go#L47-L58 |
31,175 | letsencrypt/boulder | ratelimit/rate-limits.go | GetThreshold | func (rlp *RateLimitPolicy) GetThreshold(key string, regID int64) int {
regOverride, regOverrideExists := rlp.RegistrationOverrides[regID]
keyOverride, keyOverrideExists := rlp.Overrides[key]
if regOverrideExists && !keyOverrideExists {
// If there is a regOverride and no keyOverride use the regOverride
return ... | go | func (rlp *RateLimitPolicy) GetThreshold(key string, regID int64) int {
regOverride, regOverrideExists := rlp.RegistrationOverrides[regID]
keyOverride, keyOverrideExists := rlp.Overrides[key]
if regOverrideExists && !keyOverrideExists {
// If there is a regOverride and no keyOverride use the regOverride
return ... | [
"func",
"(",
"rlp",
"*",
"RateLimitPolicy",
")",
"GetThreshold",
"(",
"key",
"string",
",",
"regID",
"int64",
")",
"int",
"{",
"regOverride",
",",
"regOverrideExists",
":=",
"rlp",
".",
"RegistrationOverrides",
"[",
"regID",
"]",
"\n",
"keyOverride",
",",
"k... | // GetThreshold returns the threshold for this rate limit, taking into account
// any overrides for `key` or `regID`. If both `key` and `regID` have an
// override the largest of the two will be used. | [
"GetThreshold",
"returns",
"the",
"threshold",
"for",
"this",
"rate",
"limit",
"taking",
"into",
"account",
"any",
"overrides",
"for",
"key",
"or",
"regID",
".",
"If",
"both",
"key",
"and",
"regID",
"have",
"an",
"override",
"the",
"largest",
"of",
"the",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/ratelimit/rate-limits.go#L192-L214 |
31,176 | letsencrypt/boulder | sa/model.go | Error | func (e errBadJSON) Error() string {
return fmt.Sprintf(
"%s: error unmarshaling JSON %q: %s",
e.msg,
string(e.json),
e.err)
} | go | func (e errBadJSON) Error() string {
return fmt.Sprintf(
"%s: error unmarshaling JSON %q: %s",
e.msg,
string(e.json),
e.err)
} | [
"func",
"(",
"e",
"errBadJSON",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"msg",
",",
"string",
"(",
"e",
".",
"json",
")",
",",
"e",
".",
"err",
")",
"\n",
"}"
] | // Error returns an error message that includes the json.Unmarshal error as well
// as the bad JSON data. | [
"Error",
"returns",
"an",
"error",
"message",
"that",
"includes",
"the",
"json",
".",
"Unmarshal",
"error",
"as",
"well",
"as",
"the",
"bad",
"JSON",
"data",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L34-L40 |
31,177 | letsencrypt/boulder | sa/model.go | badJSONError | func badJSONError(msg string, jsonData []byte, err error) error {
return errBadJSON{
msg: msg,
json: jsonData,
err: err,
}
} | go | func badJSONError(msg string, jsonData []byte, err error) error {
return errBadJSON{
msg: msg,
json: jsonData,
err: err,
}
} | [
"func",
"badJSONError",
"(",
"msg",
"string",
",",
"jsonData",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"error",
"{",
"return",
"errBadJSON",
"{",
"msg",
":",
"msg",
",",
"json",
":",
"jsonData",
",",
"err",
":",
"err",
",",
"}",
"\n",
"}"
] | // badJSONError is a convenience function for constructing a errBadJSON instance
// with the provided args. | [
"badJSONError",
"is",
"a",
"convenience",
"function",
"for",
"constructing",
"a",
"errBadJSON",
"instance",
"with",
"the",
"provided",
"args",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L44-L50 |
31,178 | letsencrypt/boulder | sa/model.go | selectRegistration | func selectRegistration(s dbOneSelector, q string, args ...interface{}) (*regModel, error) {
var model regModel
err := s.SelectOne(
&model,
"SELECT "+regFields+" FROM registrations "+q,
args...,
)
return &model, err
} | go | func selectRegistration(s dbOneSelector, q string, args ...interface{}) (*regModel, error) {
var model regModel
err := s.SelectOne(
&model,
"SELECT "+regFields+" FROM registrations "+q,
args...,
)
return &model, err
} | [
"func",
"selectRegistration",
"(",
"s",
"dbOneSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"*",
"regModel",
",",
"error",
")",
"{",
"var",
"model",
"regModel",
"\n",
"err",
":=",
"s",
".",
"SelectOne",
"(",
"&",
... | // selectRegistration selects all fields of one registration model | [
"selectRegistration",
"selects",
"all",
"fields",
"of",
"one",
"registration",
"model"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L87-L95 |
31,179 | letsencrypt/boulder | sa/model.go | selectPendingAuthz | func selectPendingAuthz(s dbOneSelector, q string, args ...interface{}) (*pendingauthzModel, error) {
var model pendingauthzModel
err := s.SelectOne(
&model,
"SELECT id, identifier, registrationID, status, expires, LockCol FROM pendingAuthorizations "+q,
args...,
)
return &model, err
} | go | func selectPendingAuthz(s dbOneSelector, q string, args ...interface{}) (*pendingauthzModel, error) {
var model pendingauthzModel
err := s.SelectOne(
&model,
"SELECT id, identifier, registrationID, status, expires, LockCol FROM pendingAuthorizations "+q,
args...,
)
return &model, err
} | [
"func",
"selectPendingAuthz",
"(",
"s",
"dbOneSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"*",
"pendingauthzModel",
",",
"error",
")",
"{",
"var",
"model",
"pendingauthzModel",
"\n",
"err",
":=",
"s",
".",
"SelectOne... | // selectPendingAuthz selects all fields of one pending authorization model | [
"selectPendingAuthz",
"selects",
"all",
"fields",
"of",
"one",
"pending",
"authorization",
"model"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L98-L106 |
31,180 | letsencrypt/boulder | sa/model.go | selectAuthz | func selectAuthz(s dbOneSelector, q string, args ...interface{}) (*authzModel, error) {
var model authzModel
err := s.SelectOne(
&model,
"SELECT "+authzFields+" FROM authz "+q,
args...,
)
return &model, err
} | go | func selectAuthz(s dbOneSelector, q string, args ...interface{}) (*authzModel, error) {
var model authzModel
err := s.SelectOne(
&model,
"SELECT "+authzFields+" FROM authz "+q,
args...,
)
return &model, err
} | [
"func",
"selectAuthz",
"(",
"s",
"dbOneSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"*",
"authzModel",
",",
"error",
")",
"{",
"var",
"model",
"authzModel",
"\n",
"err",
":=",
"s",
".",
"SelectOne",
"(",
"&",
"m... | // selectAuthz selects all fields of one authorization model | [
"selectAuthz",
"selects",
"all",
"fields",
"of",
"one",
"authorization",
"model"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L111-L119 |
31,181 | letsencrypt/boulder | sa/model.go | selectSctReceipt | func selectSctReceipt(s dbOneSelector, q string, args ...interface{}) (core.SignedCertificateTimestamp, error) {
var model core.SignedCertificateTimestamp
err := s.SelectOne(
&model,
"SELECT id, sctVersion, logID, timestamp, extensions, signature, certificateSerial, LockCol FROM sctReceipts "+q,
args...,
)
re... | go | func selectSctReceipt(s dbOneSelector, q string, args ...interface{}) (core.SignedCertificateTimestamp, error) {
var model core.SignedCertificateTimestamp
err := s.SelectOne(
&model,
"SELECT id, sctVersion, logID, timestamp, extensions, signature, certificateSerial, LockCol FROM sctReceipts "+q,
args...,
)
re... | [
"func",
"selectSctReceipt",
"(",
"s",
"dbOneSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"core",
".",
"SignedCertificateTimestamp",
",",
"error",
")",
"{",
"var",
"model",
"core",
".",
"SignedCertificateTimestamp",
"\n",
... | // selectSctReceipt selects all fields of one SignedCertificateTimestamp object | [
"selectSctReceipt",
"selects",
"all",
"fields",
"of",
"one",
"SignedCertificateTimestamp",
"object"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L122-L130 |
31,182 | letsencrypt/boulder | sa/model.go | SelectCertificate | func SelectCertificate(s dbOneSelector, q string, args ...interface{}) (core.Certificate, error) {
var model core.Certificate
err := s.SelectOne(
&model,
"SELECT "+certFields+" FROM certificates "+q,
args...,
)
return model, err
} | go | func SelectCertificate(s dbOneSelector, q string, args ...interface{}) (core.Certificate, error) {
var model core.Certificate
err := s.SelectOne(
&model,
"SELECT "+certFields+" FROM certificates "+q,
args...,
)
return model, err
} | [
"func",
"SelectCertificate",
"(",
"s",
"dbOneSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"core",
".",
"Certificate",
",",
"error",
")",
"{",
"var",
"model",
"core",
".",
"Certificate",
"\n",
"err",
":=",
"s",
"."... | // SelectCertificate selects all fields of one certificate object | [
"SelectCertificate",
"selects",
"all",
"fields",
"of",
"one",
"certificate",
"object"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L135-L143 |
31,183 | letsencrypt/boulder | sa/model.go | SelectCertificates | func SelectCertificates(s dbSelector, q string, args map[string]interface{}) ([]core.Certificate, error) {
var models []core.Certificate
_, err := s.Select(
&models,
"SELECT "+certFields+" FROM certificates "+q, args)
return models, err
} | go | func SelectCertificates(s dbSelector, q string, args map[string]interface{}) ([]core.Certificate, error) {
var models []core.Certificate
_, err := s.Select(
&models,
"SELECT "+certFields+" FROM certificates "+q, args)
return models, err
} | [
"func",
"SelectCertificates",
"(",
"s",
"dbSelector",
",",
"q",
"string",
",",
"args",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"core",
".",
"Certificate",
",",
"error",
")",
"{",
"var",
"models",
"[",
"]",
"core",
".",
... | // SelectCertificates selects all fields of multiple certificate objects | [
"SelectCertificates",
"selects",
"all",
"fields",
"of",
"multiple",
"certificate",
"objects"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L146-L152 |
31,184 | letsencrypt/boulder | sa/model.go | SelectCertificateStatus | func SelectCertificateStatus(s dbOneSelector, q string, args ...interface{}) (certStatusModel, error) {
var model certStatusModel
err := s.SelectOne(
&model,
"SELECT "+certStatusFields+" FROM certificateStatus "+q,
args...,
)
return model, err
} | go | func SelectCertificateStatus(s dbOneSelector, q string, args ...interface{}) (certStatusModel, error) {
var model certStatusModel
err := s.SelectOne(
&model,
"SELECT "+certStatusFields+" FROM certificateStatus "+q,
args...,
)
return model, err
} | [
"func",
"SelectCertificateStatus",
"(",
"s",
"dbOneSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"certStatusModel",
",",
"error",
")",
"{",
"var",
"model",
"certStatusModel",
"\n",
"err",
":=",
"s",
".",
"SelectOne",
"... | // SelectCertificateStatus selects all fields of one certificate status model | [
"SelectCertificateStatus",
"selects",
"all",
"fields",
"of",
"one",
"certificate",
"status",
"model"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L157-L165 |
31,185 | letsencrypt/boulder | sa/model.go | SelectCertificateStatuses | func SelectCertificateStatuses(s dbSelector, q string, args ...interface{}) ([]core.CertificateStatus, error) {
var models []core.CertificateStatus
_, err := s.Select(
&models,
"SELECT "+certStatusFields+" FROM certificateStatus "+q,
args...,
)
return models, err
} | go | func SelectCertificateStatuses(s dbSelector, q string, args ...interface{}) ([]core.CertificateStatus, error) {
var models []core.CertificateStatus
_, err := s.Select(
&models,
"SELECT "+certStatusFields+" FROM certificateStatus "+q,
args...,
)
return models, err
} | [
"func",
"SelectCertificateStatuses",
"(",
"s",
"dbSelector",
",",
"q",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"core",
".",
"CertificateStatus",
",",
"error",
")",
"{",
"var",
"models",
"[",
"]",
"core",
".",
"Certificate... | // SelectCertificateStatuses selects all fields of multiple certificate status objects | [
"SelectCertificateStatuses",
"selects",
"all",
"fields",
"of",
"multiple",
"certificate",
"status",
"objects"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L168-L176 |
31,186 | letsencrypt/boulder | sa/model.go | registrationToModel | func registrationToModel(r *core.Registration) (*regModel, error) {
key, err := json.Marshal(r.Key)
if err != nil {
return nil, err
}
sha, err := core.KeyDigest(r.Key)
if err != nil {
return nil, err
}
if r.InitialIP == nil {
return nil, fmt.Errorf("initialIP was nil")
}
if r.Contact == nil {
r.Contac... | go | func registrationToModel(r *core.Registration) (*regModel, error) {
key, err := json.Marshal(r.Key)
if err != nil {
return nil, err
}
sha, err := core.KeyDigest(r.Key)
if err != nil {
return nil, err
}
if r.InitialIP == nil {
return nil, fmt.Errorf("initialIP was nil")
}
if r.Contact == nil {
r.Contac... | [
"func",
"registrationToModel",
"(",
"r",
"*",
"core",
".",
"Registration",
")",
"(",
"*",
"regModel",
",",
"error",
")",
"{",
"key",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"r",
".",
"Key",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",... | // newReg creates a reg model object from a core.Registration | [
"newReg",
"creates",
"a",
"reg",
"model",
"object",
"from",
"a",
"core",
".",
"Registration"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L242-L270 |
31,187 | letsencrypt/boulder | sa/model.go | hasMultipleNonPendingChallenges | func hasMultipleNonPendingChallenges(challenges []*corepb.Challenge) bool {
nonPending := false
for _, c := range challenges {
if *c.Status == string(core.StatusValid) || *c.Status == string(core.StatusInvalid) {
if !nonPending {
nonPending = true
} else {
return true
}
}
}
return false
} | go | func hasMultipleNonPendingChallenges(challenges []*corepb.Challenge) bool {
nonPending := false
for _, c := range challenges {
if *c.Status == string(core.StatusValid) || *c.Status == string(core.StatusInvalid) {
if !nonPending {
nonPending = true
} else {
return true
}
}
}
return false
} | [
"func",
"hasMultipleNonPendingChallenges",
"(",
"challenges",
"[",
"]",
"*",
"corepb",
".",
"Challenge",
")",
"bool",
"{",
"nonPending",
":=",
"false",
"\n",
"for",
"_",
",",
"c",
":=",
"range",
"challenges",
"{",
"if",
"*",
"c",
".",
"Status",
"==",
"st... | // hasMultipleNonPendingChallenges checks if a slice of challenges contains
// more than one non-pending challenge | [
"hasMultipleNonPendingChallenges",
"checks",
"if",
"a",
"slice",
"of",
"challenges",
"contains",
"more",
"than",
"one",
"non",
"-",
"pending",
"challenge"
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/sa/model.go#L503-L515 |
31,188 | letsencrypt/boulder | grpc/interceptors.go | observeLatency | func (si *serverInterceptor) observeLatency(clientReqTime string) error {
// Convert the metadata request time into an int64
reqTimeUnixNanos, err := strconv.ParseInt(clientReqTime, 10, 64)
if err != nil {
return berrors.InternalServerError("grpc metadata had illegal %s value: %q - %s",
clientRequestTimeKey, cl... | go | func (si *serverInterceptor) observeLatency(clientReqTime string) error {
// Convert the metadata request time into an int64
reqTimeUnixNanos, err := strconv.ParseInt(clientReqTime, 10, 64)
if err != nil {
return berrors.InternalServerError("grpc metadata had illegal %s value: %q - %s",
clientRequestTimeKey, cl... | [
"func",
"(",
"si",
"*",
"serverInterceptor",
")",
"observeLatency",
"(",
"clientReqTime",
"string",
")",
"error",
"{",
"// Convert the metadata request time into an int64",
"reqTimeUnixNanos",
",",
"err",
":=",
"strconv",
".",
"ParseInt",
"(",
"clientReqTime",
",",
"1... | // observeLatency is called with the `clientRequestTimeKey` value from
// a request's gRPC metadata. This string value is converted to a timestamp and
// used to calcuate the latency between send and receive time. The latency is
// published to the server interceptor's rpcLag prometheus histogram. An error
// is return... | [
"observeLatency",
"is",
"called",
"with",
"the",
"clientRequestTimeKey",
"value",
"from",
"a",
"request",
"s",
"gRPC",
"metadata",
".",
"This",
"string",
"value",
"is",
"converted",
"to",
"a",
"timestamp",
"and",
"used",
"to",
"calcuate",
"the",
"latency",
"be... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/grpc/interceptors.go#L100-L113 |
31,189 | letsencrypt/boulder | cmd/gen-key/ecdsa.go | ecArgs | func ecArgs(label string, curve *elliptic.CurveParams, keyID []byte) generateArgs {
encodedCurve := curveToOIDDER[curve.Name]
log.Printf("\tEncoded curve parameters for %s: %X\n", curve.Params().Name, encodedCurve)
return generateArgs{
mechanism: []*pkcs11.Mechanism{
pkcs11.NewMechanism(pkcs11.CKM_EC_KEY_PAIR_G... | go | func ecArgs(label string, curve *elliptic.CurveParams, keyID []byte) generateArgs {
encodedCurve := curveToOIDDER[curve.Name]
log.Printf("\tEncoded curve parameters for %s: %X\n", curve.Params().Name, encodedCurve)
return generateArgs{
mechanism: []*pkcs11.Mechanism{
pkcs11.NewMechanism(pkcs11.CKM_EC_KEY_PAIR_G... | [
"func",
"ecArgs",
"(",
"label",
"string",
",",
"curve",
"*",
"elliptic",
".",
"CurveParams",
",",
"keyID",
"[",
"]",
"byte",
")",
"generateArgs",
"{",
"encodedCurve",
":=",
"curveToOIDDER",
"[",
"curve",
".",
"Name",
"]",
"\n",
"log",
".",
"Printf",
"(",... | // ecArgs constructs the private and public key template attributes sent to the
// device and specifies which mechanism should be used. curve determines which
// type of key should be generated. | [
"ecArgs",
"constructs",
"the",
"private",
"and",
"public",
"key",
"template",
"attributes",
"sent",
"to",
"the",
"device",
"and",
"specifies",
"which",
"mechanism",
"should",
"be",
"used",
".",
"curve",
"determines",
"which",
"type",
"of",
"key",
"should",
"be... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/ecdsa.go#L57-L83 |
31,190 | letsencrypt/boulder | cmd/gen-key/ecdsa.go | ecPub | func ecPub(
ctx pkcs11helpers.PKCtx,
session pkcs11.SessionHandle,
object pkcs11.ObjectHandle,
expectedCurve *elliptic.CurveParams,
) (*ecdsa.PublicKey, error) {
pubKey, err := pkcs11helpers.GetECDSAPublicKey(ctx, session, object)
if err != nil {
return nil, err
}
if pubKey.Curve != expectedCurve {
return n... | go | func ecPub(
ctx pkcs11helpers.PKCtx,
session pkcs11.SessionHandle,
object pkcs11.ObjectHandle,
expectedCurve *elliptic.CurveParams,
) (*ecdsa.PublicKey, error) {
pubKey, err := pkcs11helpers.GetECDSAPublicKey(ctx, session, object)
if err != nil {
return nil, err
}
if pubKey.Curve != expectedCurve {
return n... | [
"func",
"ecPub",
"(",
"ctx",
"pkcs11helpers",
".",
"PKCtx",
",",
"session",
"pkcs11",
".",
"SessionHandle",
",",
"object",
"pkcs11",
".",
"ObjectHandle",
",",
"expectedCurve",
"*",
"elliptic",
".",
"CurveParams",
",",
")",
"(",
"*",
"ecdsa",
".",
"PublicKey"... | // ecPub extracts the generated public key, specified by the provided object
// handle, and constructs an ecdsa.PublicKey. It also checks that the key is of
// the correct curve type. | [
"ecPub",
"extracts",
"the",
"generated",
"public",
"key",
"specified",
"by",
"the",
"provided",
"object",
"handle",
"and",
"constructs",
"an",
"ecdsa",
".",
"PublicKey",
".",
"It",
"also",
"checks",
"that",
"the",
"key",
"is",
"of",
"the",
"correct",
"curve"... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/ecdsa.go#L88-L104 |
31,191 | letsencrypt/boulder | cmd/gen-key/ecdsa.go | ecVerify | func ecVerify(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, pub *ecdsa.PublicKey) error {
nonce, err := getRandomBytes(ctx, session)
if err != nil {
return fmt.Errorf("failed to construct nonce: %s", err)
}
log.Printf("\tConstructed nonce: %d (%X)\n", big.NewInt(0).SetBytes(no... | go | func ecVerify(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, object pkcs11.ObjectHandle, pub *ecdsa.PublicKey) error {
nonce, err := getRandomBytes(ctx, session)
if err != nil {
return fmt.Errorf("failed to construct nonce: %s", err)
}
log.Printf("\tConstructed nonce: %d (%X)\n", big.NewInt(0).SetBytes(no... | [
"func",
"ecVerify",
"(",
"ctx",
"pkcs11helpers",
".",
"PKCtx",
",",
"session",
"pkcs11",
".",
"SessionHandle",
",",
"object",
"pkcs11",
".",
"ObjectHandle",
",",
"pub",
"*",
"ecdsa",
".",
"PublicKey",
")",
"error",
"{",
"nonce",
",",
"err",
":=",
"getRando... | // ecVerify verifies that the extracted public key corresponds with the generated
// private key on the device, specified by the provided object handle, by signing
// a nonce generated on the device and verifying the returned signature using the
// public key. | [
"ecVerify",
"verifies",
"that",
"the",
"extracted",
"public",
"key",
"corresponds",
"with",
"the",
"generated",
"private",
"key",
"on",
"the",
"device",
"specified",
"by",
"the",
"provided",
"object",
"handle",
"by",
"signing",
"a",
"nonce",
"generated",
"on",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/ecdsa.go#L110-L132 |
31,192 | letsencrypt/boulder | cmd/gen-key/ecdsa.go | ecGenerate | func ecGenerate(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label, curveStr string) (*ecdsa.PublicKey, error) {
curve, present := stringToCurve[curveStr]
if !present {
return nil, fmt.Errorf("curve %q not supported", curveStr)
}
keyID := make([]byte, 4)
_, err := rand.Read(keyID)
if err != nil {
re... | go | func ecGenerate(ctx pkcs11helpers.PKCtx, session pkcs11.SessionHandle, label, curveStr string) (*ecdsa.PublicKey, error) {
curve, present := stringToCurve[curveStr]
if !present {
return nil, fmt.Errorf("curve %q not supported", curveStr)
}
keyID := make([]byte, 4)
_, err := rand.Read(keyID)
if err != nil {
re... | [
"func",
"ecGenerate",
"(",
"ctx",
"pkcs11helpers",
".",
"PKCtx",
",",
"session",
"pkcs11",
".",
"SessionHandle",
",",
"label",
",",
"curveStr",
"string",
")",
"(",
"*",
"ecdsa",
".",
"PublicKey",
",",
"error",
")",
"{",
"curve",
",",
"present",
":=",
"st... | // ecGenerate is used to generate and verify a ECDSA key pair of the type
// specified by curveStr and with the provided label. It returns the public
// part of the generated key pair as a ecdsa.PublicKey. | [
"ecGenerate",
"is",
"used",
"to",
"generate",
"and",
"verify",
"a",
"ECDSA",
"key",
"pair",
"of",
"the",
"type",
"specified",
"by",
"curveStr",
"and",
"with",
"the",
"provided",
"label",
".",
"It",
"returns",
"the",
"public",
"part",
"of",
"the",
"generate... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/gen-key/ecdsa.go#L137-L167 |
31,193 | letsencrypt/boulder | va/http.go | DialContext | func (d *preresolvedDialer) DialContext(
ctx context.Context,
network,
origAddr string) (net.Conn, error) {
deadline, ok := ctx.Deadline()
if !ok {
// Shouldn't happen: All requests should have a deadline by this point.
deadline = time.Now().Add(100 * time.Second)
} else {
// Set the context deadline slight... | go | func (d *preresolvedDialer) DialContext(
ctx context.Context,
network,
origAddr string) (net.Conn, error) {
deadline, ok := ctx.Deadline()
if !ok {
// Shouldn't happen: All requests should have a deadline by this point.
deadline = time.Now().Add(100 * time.Second)
} else {
// Set the context deadline slight... | [
"func",
"(",
"d",
"*",
"preresolvedDialer",
")",
"DialContext",
"(",
"ctx",
"context",
".",
"Context",
",",
"network",
",",
"origAddr",
"string",
")",
"(",
"net",
".",
"Conn",
",",
"error",
")",
"{",
"deadline",
",",
"ok",
":=",
"ctx",
".",
"Deadline",... | // DialContext for a preresolvedDialer shaves 10ms off of the context it was
// given before calling the default transport DialContext using the pre-resolved
// IP and port as the host. If the original host being dialed by DialContext
// does not match the expected hostname in the preresolvedDialer an error will
// be ... | [
"DialContext",
"for",
"a",
"preresolvedDialer",
"shaves",
"10ms",
"off",
"of",
"the",
"context",
"it",
"was",
"given",
"before",
"calling",
"the",
"default",
"transport",
"DialContext",
"using",
"the",
"pre",
"-",
"resolved",
"IP",
"and",
"port",
"as",
"the",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/http.go#L78-L132 |
31,194 | letsencrypt/boulder | va/http.go | httpTransport | func httpTransport(df dialerFunc) *http.Transport {
return &http.Transport{
DialContext: df,
// We are talking to a client that does not yet have a certificate,
// so we accept a temporary, invalid one.
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
// We don't expect to make multiple requests to a ... | go | func httpTransport(df dialerFunc) *http.Transport {
return &http.Transport{
DialContext: df,
// We are talking to a client that does not yet have a certificate,
// so we accept a temporary, invalid one.
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
// We don't expect to make multiple requests to a ... | [
"func",
"httpTransport",
"(",
"df",
"dialerFunc",
")",
"*",
"http",
".",
"Transport",
"{",
"return",
"&",
"http",
".",
"Transport",
"{",
"DialContext",
":",
"df",
",",
"// We are talking to a client that does not yet have a certificate,",
"// so we accept a temporary, inv... | // httpTransport constructs a HTTP Transport with settings appropriate for
// HTTP-01 validation. The provided dialerFunc is used as the Transport's
// DialContext handler. | [
"httpTransport",
"constructs",
"a",
"HTTP",
"Transport",
"with",
"settings",
"appropriate",
"for",
"HTTP",
"-",
"01",
"validation",
".",
"The",
"provided",
"dialerFunc",
"is",
"used",
"as",
"the",
"Transport",
"s",
"DialContext",
"handler",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/http.go#L141-L155 |
31,195 | letsencrypt/boulder | va/http.go | newHTTPValidationTarget | func (va *ValidationAuthorityImpl) newHTTPValidationTarget(
ctx context.Context,
host string,
port int,
path string,
query string) (*httpValidationTarget, error) {
// Resolve IP addresses for the hostname
addrs, err := va.getAddrs(ctx, host)
if err != nil {
// Convert the error into a ConnectionFailureError s... | go | func (va *ValidationAuthorityImpl) newHTTPValidationTarget(
ctx context.Context,
host string,
port int,
path string,
query string) (*httpValidationTarget, error) {
// Resolve IP addresses for the hostname
addrs, err := va.getAddrs(ctx, host)
if err != nil {
// Convert the error into a ConnectionFailureError s... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"newHTTPValidationTarget",
"(",
"ctx",
"context",
".",
"Context",
",",
"host",
"string",
",",
"port",
"int",
",",
"path",
"string",
",",
"query",
"string",
")",
"(",
"*",
"httpValidationTarget",
",",
"e... | // newHTTPValidationTarget creates a httpValidationTarget for the given host,
// port, and path. This involves querying DNS for the IP addresses for the host.
// An error is returned if there are no usable IP addresses or if the DNS
// lookups fail. | [
"newHTTPValidationTarget",
"creates",
"a",
"httpValidationTarget",
"for",
"the",
"given",
"host",
"port",
"and",
"path",
".",
"This",
"involves",
"querying",
"DNS",
"for",
"the",
"IP",
"addresses",
"for",
"the",
"host",
".",
"An",
"error",
"is",
"returned",
"i... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/http.go#L206-L254 |
31,196 | letsencrypt/boulder | va/http.go | extractRequestTarget | func (va *ValidationAuthorityImpl) extractRequestTarget(req *http.Request) (string, int, error) {
// A nil request is certainly not a valid redirect and has no port to extract.
if req == nil {
return "", 0, fmt.Errorf("redirect HTTP request was nil")
}
reqScheme := req.URL.Scheme
// The redirect request must u... | go | func (va *ValidationAuthorityImpl) extractRequestTarget(req *http.Request) (string, int, error) {
// A nil request is certainly not a valid redirect and has no port to extract.
if req == nil {
return "", 0, fmt.Errorf("redirect HTTP request was nil")
}
reqScheme := req.URL.Scheme
// The redirect request must u... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"extractRequestTarget",
"(",
"req",
"*",
"http",
".",
"Request",
")",
"(",
"string",
",",
"int",
",",
"error",
")",
"{",
"// A nil request is certainly not a valid redirect and has no port to extract.",
"if",
"re... | // extractRequestTarget extracts the hostname and port specified in the provided
// HTTP redirect request. If the request's URL's protocol schema is not HTTP or
// HTTPS an error is returned. If an explicit port is specified in the request's
// URL and it isn't the VA's HTTP or HTTPS port, an error is returned. If the
... | [
"extractRequestTarget",
"extracts",
"the",
"hostname",
"and",
"port",
"specified",
"in",
"the",
"provided",
"HTTP",
"redirect",
"request",
".",
"If",
"the",
"request",
"s",
"URL",
"s",
"protocol",
"schema",
"is",
"not",
"HTTP",
"or",
"HTTPS",
"an",
"error",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/http.go#L262-L339 |
31,197 | letsencrypt/boulder | va/http.go | setupHTTPValidation | func (va *ValidationAuthorityImpl) setupHTTPValidation(
ctx context.Context,
reqURL string,
target *httpValidationTarget) (*preresolvedDialer, core.ValidationRecord, error) {
if reqURL == "" {
return nil,
core.ValidationRecord{},
fmt.Errorf("reqURL can not be nil")
}
if target == nil {
// This is the on... | go | func (va *ValidationAuthorityImpl) setupHTTPValidation(
ctx context.Context,
reqURL string,
target *httpValidationTarget) (*preresolvedDialer, core.ValidationRecord, error) {
if reqURL == "" {
return nil,
core.ValidationRecord{},
fmt.Errorf("reqURL can not be nil")
}
if target == nil {
// This is the on... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"setupHTTPValidation",
"(",
"ctx",
"context",
".",
"Context",
",",
"reqURL",
"string",
",",
"target",
"*",
"httpValidationTarget",
")",
"(",
"*",
"preresolvedDialer",
",",
"core",
".",
"ValidationRecord",
"... | // setupHTTPValidation sets up a preresolvedDialer and a validation record for
// the given request URL and httpValidationTarget. If the req URL is empty, or
// the validation target is nil or has no available IP addresses, an error will
// be returned. | [
"setupHTTPValidation",
"sets",
"up",
"a",
"preresolvedDialer",
"and",
"a",
"validation",
"record",
"for",
"the",
"given",
"request",
"URL",
"and",
"httpValidationTarget",
".",
"If",
"the",
"req",
"URL",
"is",
"empty",
"or",
"the",
"validation",
"target",
"is",
... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/http.go#L345-L389 |
31,198 | letsencrypt/boulder | va/http.go | fetchHTTP | func (va *ValidationAuthorityImpl) fetchHTTP(
ctx context.Context,
host string,
path string) ([]byte, []core.ValidationRecord, *probs.ProblemDetails) {
body, records, err := va.processHTTPValidation(ctx, host, path)
if err != nil {
// Use detailedError to convert the error into a problem
return body, records, ... | go | func (va *ValidationAuthorityImpl) fetchHTTP(
ctx context.Context,
host string,
path string) ([]byte, []core.ValidationRecord, *probs.ProblemDetails) {
body, records, err := va.processHTTPValidation(ctx, host, path)
if err != nil {
// Use detailedError to convert the error into a problem
return body, records, ... | [
"func",
"(",
"va",
"*",
"ValidationAuthorityImpl",
")",
"fetchHTTP",
"(",
"ctx",
"context",
".",
"Context",
",",
"host",
"string",
",",
"path",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"[",
"]",
"core",
".",
"ValidationRecord",
",",
"*",
"probs",
"."... | // fetchHTTP invokes processHTTPValidation and if an error result is
// returned, converts it to a problem. Otherwise the results from
// processHTTPValidation are returned. | [
"fetchHTTP",
"invokes",
"processHTTPValidation",
"and",
"if",
"an",
"error",
"result",
"is",
"returned",
"converts",
"it",
"to",
"a",
"problem",
".",
"Otherwise",
"the",
"results",
"from",
"processHTTPValidation",
"are",
"returned",
"."
] | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/va/http.go#L394-L404 |
31,199 | letsencrypt/boulder | cmd/shell.go | StatsAndLogging | func StatsAndLogging(logConf SyslogConfig, addr string) (metrics.Scope, blog.Logger) {
logger := NewLogger(logConf)
scope := newScope(addr, logger)
return scope, logger
} | go | func StatsAndLogging(logConf SyslogConfig, addr string) (metrics.Scope, blog.Logger) {
logger := NewLogger(logConf)
scope := newScope(addr, logger)
return scope, logger
} | [
"func",
"StatsAndLogging",
"(",
"logConf",
"SyslogConfig",
",",
"addr",
"string",
")",
"(",
"metrics",
".",
"Scope",
",",
"blog",
".",
"Logger",
")",
"{",
"logger",
":=",
"NewLogger",
"(",
"logConf",
")",
"\n",
"scope",
":=",
"newScope",
"(",
"addr",
","... | // StatsAndLogging constructs a metrics.Scope and an AuditLogger based on its config
// parameters, and return them both. It also spawns off an HTTP server on the
// provided port to report the stats and provide pprof profiling handlers.
// Crashes if any setup fails.
// Also sets the constructed AuditLogger as the def... | [
"StatsAndLogging",
"constructs",
"a",
"metrics",
".",
"Scope",
"and",
"an",
"AuditLogger",
"based",
"on",
"its",
"config",
"parameters",
"and",
"return",
"them",
"both",
".",
"It",
"also",
"spawns",
"off",
"an",
"HTTP",
"server",
"on",
"the",
"provided",
"po... | a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf | https://github.com/letsencrypt/boulder/blob/a3d35f51ff716e0d4916ac2c8ce5b6df16a95baf/cmd/shell.go#L153-L157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.