<!-- Generated by website/scripts/sync-docs.mjs from docs/how-it-decides.md. Edit that file, not this one. -->

# How saysno decides

> Every page of this site: https://dyokto.github.io/saysno/llms.txt

AWS ([condition operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html), [multiple keys and values](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-logic-multiple-context-keys-or-values.html), [set operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-single-vs-multi-valued-context-keys.html), [OIDC context keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif)):

- An explicit Deny that applies wins. Otherwise an Allow must apply.
- Within a statement, all operators and all keys must hold (AND). Several values for one key are OR; for negated operators (`StringNotEquals`, `StringNotLike`, ...) they are NOR.
- A key missing from the request context makes a condition false, except: negated operators and `ForAllValues:` are true, `...IfExists` is true, `Null` tests presence.
- `StringLike` wildcards: `*` any sequence, `?` one character, case-sensitive. `StringEquals` treats `*` and `?` literally.
- Context keys come from the token per AWS's mapping: `amr`, `aud` (the `azp` claim when present, else `aud`), `email`, `oaud` (`aud`), `sub`, plus for `token.actions.githubusercontent.com`: `actor`, `actor_id`, `job_workflow_ref`, `repository`, `repository_id`, `repository_owner_id`, `workflow`, `ref`, `environment`, `enterprise_id`. A key outside that mapping is treated as missing; if a condition would pass only because of that, the result is "cannot evaluate".
- Policy variables are resolved from the token (`${*}`, `${?}`, `${$}` are literal characters). Request-side keys (`aws:*`, `sts:*`) are unknown unless given with `--context`.

Entra ([workload identity federation](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation), [flexible credentials](https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-flexible-federated-identity-credentials)):

- Issuer, subject and audience must match exactly. With several credentials, any one matching is enough.
- Flexible expressions: `claims['NAME'] eq|matches 'VALUE'` joined by ` and `, single spaces, `languageVersion` 1. `matches` uses `*` and `?`. Per issuer, only the documented claims and operators are accepted (GitHub: `sub` and `job_workflow_ref` with `eq`/`matches`, `repository_id` and `repository_owner_id` with `eq`, and `sub` plus one of the two IDs required; GitLab: `sub` with `eq`/`matches` and `project_id` with `eq`, both required; Terraform Cloud: `sub`). Anything else is "cannot evaluate".
