Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dag/extdeps/cloud/gcp/gcp.dag
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import std.types { Bool, FilePath, Int, List, Map, NonEmptyStr, Secret, Unit }
import std.string_type { String }
import v2.std.network { POST }
import extdeps.ietf.http_semantics { POST }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/cloud/gcp/iam.dag
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import extdeps.cloud.gcp.gcp { GcpProjectId, ServiceAccountEmail, GcpOperation }
import extdeps.transports.rest { RestOutcome }
import std.types { Bool, Int, Json, List, NonEmptyStr, Secret, String }
import v2.std.algebra { filter, fold_list }
import v2.std.network { GET, POST }
import v2.std.optional { Absent, Present }
import extdeps.ietf.http_semantics { GET, POST }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/cloud/gcp/iam_admin.dag
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import extdeps.cloud.gcp.gcp { GcpProjectId, ServiceAccountEmail }
import extdeps.cloud.gcp.iam { GcpPolicy, GcpBinding }
import std.types { Int, List, Map, NonEmptyStr, Secret, String }
import extdeps.transports.rest { RestOutcome }
import v2.std.network { POST }
import extdeps.transports.rest { RestOutcome }
import extdeps.ietf.http_semantics { POST }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
Expand Down
2 changes: 1 addition & 1 deletion dag/extdeps/cloud/gcp/secret_manager.dag
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import std.types { Bool, Bytes, Int, List, Map, NonEmptyStr, Secret, String }
import v2.std.algebra { fold_list, length, skip }
import v2.std.network { GET, POST }
import v2.std.optional { Present }
// GcpProjectId and GcpErrorShape were reached as BARE references before this
// import existed, which resolves only when some unrelated module in the assembled
Expand All @@ -18,6 +17,7 @@ import extdeps.cloud.gcp.gcp { GcpProjectId }
import extdeps.cloud.gcp.errors { GcpErrorShape }
import extdeps.transports.rest { RestOutcome }
import v2.std.operation_argv { OperationRef }
import extdeps.ietf.http_semantics { GET, POST }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/cloud/gcp/serviceusage.dag
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.cloud.gcp.gcp { GcpProjectId }
import std.types { List, Secret, String }
import v2.std.network { POST, GET }
import extdeps.transports.rest { RestOutcome }
import extdeps.ietf.http_semantics { POST, GET }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/cloud/gcp/sts.dag
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module extdeps.cloud.gcp.sts
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import std.types { Int, NonEmptyStr, Secret }
import v2.std.network { GET, POST }
import extdeps.ietf.http_semantics { GET, POST }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/ebay/inventory.dag
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module extdeps.ebay.inventory

import std.types { NonEmptyStr, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, AuthScheme }
import extdeps.currency.currency { CurrencyCode }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.coverage { CoverageClosureEntry, CoverageClosureFact }
import extdeps.ebay.ebay { production_api_base, MarketplaceEnum }
import extdeps.ebay.errors { EbayErrorShape }
import extdeps.ebay.ebay_contracts { condition_wire_contract, format_type_wire_contract }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/ebay/oauth.dag
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module extdeps.ebay.oauth

import std.types { NonEmptyStr, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, AuthScheme }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.ebay.ebay { production_api_base }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/github/gists.dag
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module extdeps.github.gists

import extdeps.github.github { GitHubUser, default_api_base }
import std.types { Timestamp, GistId, NonEmptyStr, HttpMethod, AuthScheme }
import std.types { Timestamp, GistId, NonEmptyStr, AuthScheme }
import extdeps.github.errors { GitHubErrorShape }

import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/github/pulls.dag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module extdeps.github.pulls

import extdeps.github.github { GitHubUser, default_api_base, default_per_page }
import std.types { CommitSha, EpochMs, FilePath, GitRef, NonEmptyStr, Timestamp, HttpMethod, AuthScheme }
import std.types { CommitSha, EpochMs, FilePath, GitRef, NonEmptyStr, Timestamp, AuthScheme }
import std.string_type { String }
import extdeps.github.errors { GitHubErrorShape }
import std.credentials { CredentialSource, EnvVar }
Expand All @@ -15,6 +15,7 @@ import extdeps.github.pulls_contracts {
review_state_wire_contract,
review_event_wire_contract
}
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
66 changes: 37 additions & 29 deletions dag/extdeps/github/rulesets.dag
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,19 @@ fn required_status_check_standing(rules: List<RulesetRuleWire>) -> RequiredStatu
MultipleRequiredStatusChecksRules { count: length(matched) }
} else {
fold(matched, init: NoRequiredStatusChecksRule, f: fn(_, rule) {
let missing = required_status_check_missing_fields(p: rule.parameters)
if length(missing) > 0 {
RequiredStatusChecksParametersIncomplete { missing: missing }
} else {
RequiredStatusChecks {
contexts: map(rsc_checks(v: rule.parameters.required_status_checks), c => c.context),
strict: rsc_bool(v: rule.parameters.strict_required_status_checks_policy),
do_not_enforce_on_create: rsc_bool(v: rule.parameters.do_not_enforce_on_create),
}
match rule.parameters {
Absent => RequiredStatusChecksParametersIncomplete { missing: ["parameters"] }
Present { value: params } =>
let missing = required_status_check_missing_fields(p: params)
if length(missing) > 0 {
RequiredStatusChecksParametersIncomplete { missing: missing }
} else {
RequiredStatusChecks {
contexts: map(rsc_checks(v: params.required_status_checks), c => c.context),
strict: rsc_bool(v: params.strict_required_status_checks_policy),
do_not_enforce_on_create: rsc_bool(v: params.do_not_enforce_on_create),
}
}
}
})
}
Expand Down Expand Up @@ -588,26 +592,30 @@ fn merge_queue_standing(rules: List<RulesetRuleWire>) -> MergeQueueStanding {
MultipleMergeQueueRules { count: length(matched) }
} else {
fold(matched, init: NoMergeQueueRule, f: fn(_, rule) {
let missing = merge_queue_missing_fields(p: rule.parameters)
if length(missing) > 0 {
MergeQueueParametersIncomplete { missing: missing }
} else {
MergeQueueConfigured {
grouping_strategy: parse_merge_queue_grouping_strategy(
raw: merge_queue_str(v: rule.parameters.grouping_strategy)),
merge_method: parse_merge_queue_merge_method(
raw: merge_queue_str(v: rule.parameters.merge_method)),
check_response_timeout: minute(
count: merge_queue_int(v: rule.parameters.check_response_timeout_minutes)),
max_entries_to_build: merge_queue_entry_count(
count: merge_queue_int(v: rule.parameters.max_entries_to_build)),
max_entries_to_merge: merge_queue_entry_count(
count: merge_queue_int(v: rule.parameters.max_entries_to_merge)),
min_entries_to_merge: merge_queue_entry_count(
count: merge_queue_int(v: rule.parameters.min_entries_to_merge)),
min_entries_to_merge_wait: minute(
count: merge_queue_int(v: rule.parameters.min_entries_to_merge_wait_minutes)),
}
match rule.parameters {
Absent => MergeQueueParametersIncomplete { missing: ["parameters"] }
Present { value: params } =>
let missing = merge_queue_missing_fields(p: params)
if length(missing) > 0 {
MergeQueueParametersIncomplete { missing: missing }
} else {
MergeQueueConfigured {
grouping_strategy: parse_merge_queue_grouping_strategy(
raw: merge_queue_str(v: params.grouping_strategy)),
merge_method: parse_merge_queue_merge_method(
raw: merge_queue_str(v: params.merge_method)),
check_response_timeout: minute(
count: merge_queue_int(v: params.check_response_timeout_minutes)),
max_entries_to_build: merge_queue_entry_count(
count: merge_queue_int(v: params.max_entries_to_build)),
max_entries_to_merge: merge_queue_entry_count(
count: merge_queue_int(v: params.max_entries_to_merge)),
min_entries_to_merge: merge_queue_entry_count(
count: merge_queue_int(v: params.min_entries_to_merge)),
min_entries_to_merge_wait: minute(
count: merge_queue_int(v: params.min_entries_to_merge_wait_minutes)),
}
}
}
})
}
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/google/sheets.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module extdeps.google.sheets

import std.types { NonEmptyStr, String, Int, List, Secret, Bool, Float, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, String, Int, List, Secret, Bool, Float, AuthScheme }
import extdeps.transports.rest { RestOutcome, RestOk }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import std.credentials { EnvVar }
Expand All @@ -15,6 +15,7 @@ import extdeps.external_authority {
import extdeps.uri { Uri, Https }
import extdeps.api_rate_limit { UpstreamRateLimit, RateLimitPeriod, PerMinute }
import extdeps.coverage { CoverageClosureEntry, CoverageClosureFact }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
7 changes: 6 additions & 1 deletion dag/extdeps/http/server.dag
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ module extdeps.http.server

import extdeps.tailscale.identity { TailnetIdentity }
import extdeps.uri_path { PathTemplate, PathParamBinding }
import std.types { HttpMethod, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, HttpStatus, Port }
import std.types { HttpStatus, Port }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.uri_path {
PathTemplateMatch, PathMatched, PathNotMatched,
match_path_template,
ParsedPathTemplate, MalformedPathTemplate, parse_path_template,
}
import extdeps.ietf.http_semantics { HttpMethod, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, TRACE }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down Expand Up @@ -143,6 +144,8 @@ fn http_method_label(method: HttpMethod) -> String {
DELETE => "DELETE"
HEAD => "HEAD"
OPTIONS => "OPTIONS"
CONNECT => "CONNECT"
TRACE => "TRACE"
}
}

Expand All @@ -161,6 +164,8 @@ fn parse_http_method_label(label: String) -> HttpMethodParse {
else if label == "DELETE" { KnownMethod { method: DELETE } }
else if label == "HEAD" { KnownMethod { method: HEAD } }
else if label == "OPTIONS" { KnownMethod { method: OPTIONS } }
else if label == "CONNECT" { KnownMethod { method: CONNECT } }
else if label == "TRACE" { KnownMethod { method: TRACE } }
else { UnknownMethod { label: label } }
}

Expand Down
55 changes: 55 additions & 0 deletions dag/extdeps/ietf/http_semantics.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module extdeps.ietf.http_semantics

import std.decl_ref { DeclarationRef, WholeDeclaration }
import extdeps.external_authority { ExternalAuthority, ExternalModelScope, ExternalSubjectRef }
import extdeps.uri { Uri, Https }

// RFC 9110 (HTTP Semantics, June 2022; obsoletes RFC 7231) section 9 METHODS, plus PATCH from
// RFC 5789 -- the one home of the request-method set. It was declared twice before this module: std.types HttpMethod with
// seven arms and v2.std.network HttpMethod with nine. Neither was the upstream: the method set is
// an IETF fact, so it lives beside the other extdeps.ietf modules and both std declarations are
// gone rather than one re-exporting the other (DESIGN section 3, external upstream decomposition).
// The seven-arm copy was not a narrower concept but an incomplete transcription: CONNECT (9.3.6)
// and TRACE (9.3.8) are registered methods, and a consumer that could not name them had no way to
// refuse them by name.
data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "www.rfc-editor.org/rfc/rfc9110#section-9"
}
}

data extdeps_model_scope: ExternalModelScope = ExternalModelScope {
subject: ExternalSubjectRef {
declaration: DeclarationRef {
module_path: "extdeps.ietf.http_semantics",
decl_name: "HttpMethod",
field: WholeDeclaration
}
},
first_citation: extdeps.ietf.http_semantics.extdeps_external_authority_anchor,
further_citations: [rfc5789_patch_authority]
}

// PATCH is not an RFC 9110 method: it is defined by RFC 5789, which is why it is cited separately.
data rfc5789_patch_authority: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "www.rfc-editor.org/rfc/rfc5789"
}
}

// The eight RFC 9110 section 9.3 method definitions in the RFC's order, then RFC 5789 PATCH. The
// IANA HTTP Method Registry also lists WebDAV and other extension methods; they are not modeled
// here, and a consumer reading a wire label outside this set refuses it by name
// (extdeps.http.server parse_http_method_label UnknownMethod).
type HttpMethod
= GET
| HEAD
| POST
| PUT
| DELETE
| CONNECT
| OPTIONS
| TRACE
| PATCH
2 changes: 1 addition & 1 deletion dag/extdeps/ntfy/ntfy.dag
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module extdeps.ntfy.ntfy
import std.types { NonEmptyStr, String, Int, Secret, List, Bool }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import v2.std.network { POST }
import extdeps.transports.rest { RestOutcome, RestOk, RestStatusRefused, RestTransportRefused, RestBodyUndecodable }
import extdeps.ietf.http_semantics { POST }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/sec/edgar_rest.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module extdeps.sec.edgar_rest

import std.types { NonEmptyStr, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, AuthScheme }
import extdeps.sec.edgar {
CompanyConceptResponse,
CompanyFactsResponse,
Expand All @@ -9,6 +9,7 @@ import extdeps.sec.edgar {
}
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/tailscale/acl_api.dag
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module extdeps.tailscale.acl_api

import std.types { String, Secret, NonEmptyStr, HttpMethod, AuthScheme, HttpStatus }
import std.types { String, Secret, NonEmptyStr, AuthScheme, HttpStatus }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/tcgplayer/catalog.dag
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module extdeps.tcgplayer.catalog

import std.types { NonEmptyStr, Timestamp, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, Timestamp, AuthScheme }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.coverage { CoverageClosureEntry, CoverageClosureFact }
import extdeps.tcgplayer.tcgplayer { production_api_base, TcgplayerErrorEnvelope }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/tcgplayer/pricing.dag
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module extdeps.tcgplayer.pricing

import std.types { NonEmptyStr, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, AuthScheme }
import std.disposition { Disposition, Scaffold, SingleAuthority }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.tcgplayer.tcgplayer { production_api_base, TcgplayerErrorEnvelope }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/tcgplayer/store.dag
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module extdeps.tcgplayer.store

import std.types { NonEmptyStr, HttpMethod, AuthScheme }
import std.types { NonEmptyStr, AuthScheme }
import std.disposition { Disposition, Scaffold, SingleAuthority }
import std.decl_ref { DeclarationRef, NamedField }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import extdeps.tcgplayer.tcgplayer { production_api_base, TcgplayerErrorEnvelope }
import extdeps.ietf.http_semantics { HttpMethod }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
Expand Down
Loading