hecks 3.11.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hecks/adapters/driven/script_runner.adapter +3 -0
- data/lib/hecks/adapters/driven/script_runner.rb +93 -0
- data/lib/hecks/adapters/driven.rb +1 -0
- data/lib/hecks/adapters/driving/cli_runner/resolution.rb +6 -3
- data/lib/hecks/adapters/driving/cli_runner.rb +1 -0
- data/lib/hecks/adapters/driving/newcomer.rb +50 -0
- data/lib/hecks/bluebook/assembly/contracts/read_models.rb +1 -1
- data/lib/hecks/bluebook/assembly/marks.rb +3 -15
- data/lib/hecks/bluebook/assembly/scalars.rb +39 -0
- data/lib/hecks/bluebook/meta_validator/readings.rb +6 -0
- data/lib/hecks/bluebook/meta_validator/reconstruction.rb +6 -3
- data/lib/hecks/bluebook/meta_validator/syntax_boot.rb +16 -12
- data/lib/hecks/bluebook/meta_validator.rb +28 -21
- data/lib/hecks/bluebook.rb +1 -0
- data/lib/hecks/deploy/bluebook/deploy.bluebook +17 -3
- data/lib/hecks/framework/bluebook/change.behaviors +30 -0
- data/lib/hecks/framework/bluebook/change.bluebook +162 -0
- data/lib/hecks/framework/bluebook/change.hecksagon +21 -0
- data/lib/hecks/framework/change.oidc.json +34 -0
- data/lib/hecks/framework/console_settings.oidc.json +103 -0
- data/lib/hecks/framework/governance.oidc.json +28 -0
- data/lib/hecks/framework/identity.oidc.json +18 -0
- data/lib/hecks/framework/privacy.oidc.json +30 -0
- data/lib/hecks/gate/stages.yml +35 -0
- data/lib/hecks/grammar/translation.oidc.json +48 -0
- data/lib/hecks/hecks/adapters/codebase/test_runner.rb +12 -1
- data/lib/hecks/hecks/adapters/deploy_toolchain.rb +2 -1
- data/lib/hecks/hecks/adapters/rehearsal/postgres_store.rb +5 -1
- data/lib/hecks/hecks/hecks.world +3 -0
- data/lib/hecks/language/bluebook/bluebook.behaviors +23 -0
- data/lib/hecks/language/bluebook/policy.behaviors +19 -0
- data/lib/hecks/language/bluebook/vocabulary.bluebook +52 -0
- data/lib/hecks/projection_files/expression_tables.rb +7 -2
- data/lib/hecks/projections/deploy/box/compose.rb +6 -4
- data/lib/hecks/projections/deploy/box/edge.rb +62 -0
- data/lib/hecks/projections/deploy/box/logging.rb +99 -0
- data/lib/hecks/projections/deploy/box/roll_scripts.rb +16 -8
- data/lib/hecks/projections/deploy/box/settings/cdn.rb +40 -0
- data/lib/hecks/projections/deploy/box/settings/logs.rb +40 -0
- data/lib/hecks/projections/deploy/box/settings/patterns.rb +11 -0
- data/lib/hecks/projections/deploy/box/settings/types.rb +16 -1
- data/lib/hecks/projections/deploy/box/settings.rb +6 -2
- data/lib/hecks/projections/deploy/box/stack_yaml.rb +5 -2
- data/lib/hecks/projections/deploy/box/templates/Makefile.tmpl +16 -0
- data/lib/hecks/projections/deploy/box/templates/box.yaml.tmpl +8 -4
- data/lib/hecks/projections/deploy/box/templates/deploy-box.sh.tmpl +3 -0
- data/lib/hecks/projections/deploy/box/templates/edge.mk.tmpl +17 -0
- data/lib/hecks/projections/deploy/box/templates/edge.yaml.tmpl +65 -0
- data/lib/hecks/projections/deploy/box/templates/log-group.yaml.tmpl +12 -0
- data/lib/hecks/projections/deploy/box/templates/log-policy.yaml.tmpl +7 -0
- data/lib/hecks/projections/deploy/box/templates/render-compose-taskdef.sh.tmpl +5 -4
- data/lib/hecks/projections/deploy/box/templates/render-compose.sh.tmpl +5 -4
- data/lib/hecks/projections/deploy/box.rb +15 -3
- data/lib/hecks/projections/deploy/fargate/cdn/lines.rb +12 -1
- data/lib/hecks/projections/site/admin_cms/templates/membership.rb +10 -7
- data/lib/hecks/projections/site/edge/behaviours.rb +10 -6
- data/lib/hecks/projections/site/edge/checks.rb +2 -0
- data/lib/hecks/projections/site/edge/function_checks.rb +104 -0
- data/lib/hecks/projections/site/edge/function_code.rb +86 -0
- data/lib/hecks/projections/site/edge/redirect_host.js.tmpl +65 -0
- data/lib/hecks/projections/site/edge.rb +35 -9
- data/lib/hecks/projections/site/site_cdn.rb +21 -7
- data/lib/hecks/projections/site/site_root/workflow.rb +5 -0
- data/lib/hecks/projections/site/table/row_builder.rb +12 -2
- data/lib/hecks/projections/site/table.rb +4 -2
- data/lib/hecks/projector/cli_audience.rb +20 -0
- data/lib/hecks/projector/cli_projector/usage.rb +15 -4
- data/lib/hecks/rust_build/host.rb +11 -4
- data/lib/hecks/rust_build/prebuilt_binary.rb +101 -0
- data/lib/hecks/site/bluebook/site.bluebook +16 -1
- data/lib/hecks/tools/ci_gate_decision.rb +35 -0
- data/lib/hecks/tools/ci_gates.rb +20 -1
- data/lib/hecks/tools/lanes/files.rb +8 -0
- data/lib/hecks/tools/lanes/prebuilt_workflow.rb +81 -0
- data/lib/hecks/tools/lanes.rb +1 -0
- data/lib/hecks/tools/oidc_manifests.rb +44 -6
- data/lib/hecks/tools/release_only.rb +111 -0
- data/lib/hecks/tools/site_routes/templates.rb +13 -9
- data/lib/hecks/version.rb +1 -1
- data/lib/hecks/vocabulary.rb +15 -1
- data/prebuilt/2b59737fbdbd5f44edda0fddce2611f45d76087b3a7c782d1f1a17ea58c77948.marshal +0 -0
- data/prebuilt/58208399bada10b0db99928c48e38789288fc58f7b71a72b21bfa386680e32ed.marshal +0 -0
- data/prebuilt/{verdicts-230ac18c25abfd3d92ede032bee2661a4c2cd2773ab0cf0e2ae52546ba2f7af9.json → verdicts-48318ca172edd21443b1ad02801c697fff100b746e828f09db987647641a5df2.json} +1 -1
- data/rust/host/HECKS_RELEASE +1 -1
- data/rust/host/src/auth.rs +58 -0
- data/rust/host/src/extension.rs +13 -1
- data/rust/host/src/lib.rs +1 -0
- data/rust/host/src/platform_signin/attack_tests.rs +1100 -0
- data/rust/host/src/platform_signin/config.rs +512 -0
- data/rust/host/src/platform_signin/cookie.rs +237 -0
- data/rust/host/src/platform_signin/extension.rs +190 -0
- data/rust/host/src/platform_signin/fetcher.rs +322 -0
- data/rust/host/src/platform_signin/handler.rs +251 -0
- data/rust/host/src/platform_signin/handler_tests.rs +554 -0
- data/rust/host/src/platform_signin/jti.rs +196 -0
- data/rust/host/src/platform_signin/jwks.rs +542 -0
- data/rust/host/src/platform_signin/jws.rs +249 -0
- data/rust/host/src/platform_signin/known_answer_tests.rs +237 -0
- data/rust/host/src/platform_signin/mapping_tests.rs +254 -0
- data/rust/host/src/platform_signin/mod.rs +75 -0
- data/rust/host/src/platform_signin/mode_tests.rs +382 -0
- data/rust/host/src/platform_signin/pages.rs +204 -0
- data/rust/host/src/platform_signin/query.rs +233 -0
- data/rust/host/src/platform_signin/session.rs +151 -0
- data/rust/host/src/platform_signin/settings.rs +385 -0
- data/rust/host/src/platform_signin/strict_json.rs +351 -0
- data/rust/host/src/platform_signin/test_support.rs +235 -0
- data/rust/host/src/platform_signin/ttl_tests.rs +94 -0
- data/rust/host/src/platform_signin/verify.rs +604 -0
- data/rust/host/src/platform_signin/wiring_support.rs +319 -0
- data/rust/host/src/web.rs +50 -6
- data/rust/parser/src/parse/value_object.rs +22 -10
- metadata +59 -7
- data/prebuilt/05c358d38d661a3774f813d49c66f5b68939af94432d66257a56f49ee2598994.marshal +0 -0
- data/prebuilt/26c40c61f09b09b11651c64668eda3ceb180f83cf2a3802d3033d2fd99ac841b.marshal +0 -0
- /data/lib/hecks/framework/{oidc.json → compliance.oidc.json} +0 -0
- /data/lib/hecks/grammar/{oidc.json → expression.oidc.json} +0 -0
data/rust/host/HECKS_RELEASE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.13.0
|
data/rust/host/src/auth.rs
CHANGED
|
@@ -260,6 +260,43 @@ fn identity_id_from_state(state: &Value) -> Option<String> {
|
|
|
260
260
|
})
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
/// Resolves an external identity the way the Google callback does: the PostgresEra head first,
|
|
264
|
+
/// then the flat journal's `instances`. A domain whose Identity chapter keeps no head of its own
|
|
265
|
+
/// (its heads cover its own aggregates and the membership aggregate) holds the link only there.
|
|
266
|
+
///
|
|
267
|
+
/// # Errors
|
|
268
|
+
///
|
|
269
|
+
/// Returns the flat journal's read error, except that a missing flat journal means no link there. A
|
|
270
|
+
/// head that cannot be read is logged and skipped, as the Google callback does, so the flat journal
|
|
271
|
+
/// still gets its turn.
|
|
272
|
+
pub async fn resolve_identity_anywhere(
|
|
273
|
+
client: &Mutex<Client>,
|
|
274
|
+
wasm_path: &Path,
|
|
275
|
+
domain_ir: &Value,
|
|
276
|
+
issuer: &str,
|
|
277
|
+
subject: &str,
|
|
278
|
+
) -> anyhow::Result<Option<String>> {
|
|
279
|
+
match resolve_identity_from_head(client, domain_ir, issuer, subject).await {
|
|
280
|
+
Ok(Some(found)) => return Ok(Some(found)),
|
|
281
|
+
Ok(None) => {}
|
|
282
|
+
Err(error) => eprintln!("resolve_identity: identity head: {error:#}"),
|
|
283
|
+
}
|
|
284
|
+
let read = match dispatch::read(client, wasm_path).await {
|
|
285
|
+
Ok(read) => read,
|
|
286
|
+
Err(error) if flat_journal_is_absent(&error) => return Ok(None),
|
|
287
|
+
Err(error) => return Err(error),
|
|
288
|
+
};
|
|
289
|
+
Ok(resolve_identity(read.get("instances").unwrap_or(&Value::Null), issuer, subject))
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// A store with heads only has no flat journal to read; that is "no link there", not an outage.
|
|
293
|
+
fn flat_journal_is_absent(error: &anyhow::Error) -> bool {
|
|
294
|
+
error
|
|
295
|
+
.chain()
|
|
296
|
+
.filter_map(|cause| cause.downcast_ref::<tokio_postgres::Error>())
|
|
297
|
+
.any(|db| db.code() == Some(&tokio_postgres::error::SqlState::UNDEFINED_TABLE))
|
|
298
|
+
}
|
|
299
|
+
|
|
263
300
|
/// Identity lives in the PostgresEra head, not `dispatch::read`'s
|
|
264
301
|
/// `instances` — tries both the domain-qualified and the bare relation name.
|
|
265
302
|
pub async fn resolve_identity_from_head(
|
|
@@ -1102,6 +1139,27 @@ mod tests {
|
|
|
1102
1139
|
assert!(resolve_identity(&instances, "google", "nope").is_none());
|
|
1103
1140
|
}
|
|
1104
1141
|
|
|
1142
|
+
#[test]
|
|
1143
|
+
fn resolve_identity_finds_a_link_that_only_the_flat_journal_holds() {
|
|
1144
|
+
// The shape `ExternalIdentifier.Link` leaves in the flat snapshot of a domain whose Identity
|
|
1145
|
+
// chapter has no head of its own; the key carries the issuer URL and the subject.
|
|
1146
|
+
let instances = json!({
|
|
1147
|
+
"Identity::ExternalIdentifier#https://accounts.google.com:111": {
|
|
1148
|
+
"identity": "471ef402-8609-4fa4-9288-6372fc74650d",
|
|
1149
|
+
"key": {"value": "https://accounts.google.com:111"},
|
|
1150
|
+
"issuer": {"value": "https://accounts.google.com"},
|
|
1151
|
+
"subject": {"value": "111"},
|
|
1152
|
+
},
|
|
1153
|
+
});
|
|
1154
|
+
let read = json!({ "instances": instances });
|
|
1155
|
+
assert_eq!(
|
|
1156
|
+
resolve_identity(read.get("instances").unwrap_or(&Value::Null), "https://accounts.google.com", "111").as_deref(),
|
|
1157
|
+
Some("471ef402-8609-4fa4-9288-6372fc74650d")
|
|
1158
|
+
);
|
|
1159
|
+
assert!(resolve_identity(read.get("instances").unwrap_or(&Value::Null), "https://accounts.google.com", "112").is_none());
|
|
1160
|
+
assert!(resolve_identity(&Value::Null, "https://accounts.google.com", "111").is_none());
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1105
1163
|
#[test]
|
|
1106
1164
|
fn resolve_identity_reads_the_2_0_identity_field() {
|
|
1107
1165
|
let instances = json!({
|
data/rust/host/src/extension.rs
CHANGED
|
@@ -81,7 +81,19 @@ pub fn installed() -> &'static [Arc<dyn HostExtension>] {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
fn default_extensions() -> Vec<Arc<dyn HostExtension>> {
|
|
84
|
-
|
|
84
|
+
let vars = crate::platform_signin::settings::PROCESS_VARIABLES
|
|
85
|
+
.iter()
|
|
86
|
+
.filter_map(|name| std::env::var(name).ok().map(|value| (name.to_string(), value)))
|
|
87
|
+
.collect();
|
|
88
|
+
default_extensions_from(&vars)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/// The default extensions for an explicit set of settings: commerce, plus platform sign-in when
|
|
92
|
+
/// it is switched on (or its boot refusal when its settings are wrong).
|
|
93
|
+
pub(crate) fn default_extensions_from(vars: &HashMap<String, String>) -> Vec<Arc<dyn HostExtension>> {
|
|
94
|
+
let mut extensions: Vec<Arc<dyn HostExtension>> = vec![Arc::new(crate::web::Commerce)];
|
|
95
|
+
extensions.extend(crate::platform_signin::extension::extensions_for(vars));
|
|
96
|
+
extensions
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
/// The loaded domain IR, for an extension that needs it in the guest phase.
|