Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
523 commits
Select commit Hold shift + click to select a range
6a32233
test(trace): reject normalized non-ASCII trace authority
seonghobae Aug 27, 2026
5022e3d
test(trace): keep production runtime-boundary coverage
seonghobae Aug 27, 2026
77c37ab
test(oidc): bound complete Authorization field
seonghobae Aug 27, 2026
9180520
fix(oidc): bound complete Authorization field
seonghobae Aug 27, 2026
1855b94
test(oidc): keep boundary JWT segments canonical
seonghobae Aug 27, 2026
95b3a23
test(oidc): require current central workflow source commit
seonghobae Aug 27, 2026
1fc7b3f
fix(oidc): trust current central workflow source commit
seonghobae Aug 27, 2026
cb35aed
docs(architecture): bind current central workflow source commit
seonghobae Aug 27, 2026
3deefca
test(rate-limit): reject BOM-prefixed JSON authority
seonghobae Aug 27, 2026
5af27a4
fix(rate-limit): reject BOM-prefixed JSON authority
seonghobae Aug 27, 2026
978bdc6
test(exchange): reject BOM-prefixed JSON authority
seonghobae Aug 27, 2026
2296610
fix(exchange): reject BOM-prefixed JSON authority
seonghobae Aug 27, 2026
173f77f
test(replay): reject BOM-prefixed authority JSON
seonghobae Aug 27, 2026
fe7d1d1
fix(replay): preserve BOM for canonical JSON rejection
seonghobae Aug 27, 2026
3c64ee2
test(exchange): reject non-HTTP media-type whitespace
seonghobae Aug 27, 2026
2c8f9f1
fix(exchange): reject non-HTTP media-type whitespace
seonghobae Aug 27, 2026
fc6db41
test(exchange): reject unsupported JSON media parameters
seonghobae Aug 27, 2026
7f089bf
fix(exchange): bind JSON body decoder to reviewed media parameters
seonghobae Aug 27, 2026
ad1e912
test(rate-limit): bind decision media type to UTF-8
seonghobae Aug 27, 2026
69002d2
fix(rate-limit): bind JSON media type to UTF-8
seonghobae Aug 27, 2026
9628188
test(rate-limit): bind internal endpoint authority
seonghobae Aug 27, 2026
70cebb2
fix(rate-limit): bind internal endpoint identity
seonghobae Aug 27, 2026
3538f29
test(rate-limit): cover fragment endpoint alias
seonghobae Aug 27, 2026
1242d9f
revert(rate-limit): preserve Durable Object URL origin semantics
seonghobae Aug 27, 2026
d4c52fb
test(oidc): bind replay JSON media authority
seonghobae Aug 27, 2026
8318a39
fix(oidc): bind replay JSON media authority
seonghobae Aug 27, 2026
529c753
test(oidc): reject replay decision shape drift
seonghobae Aug 27, 2026
b5e5b37
fix(oidc): reject replay decision shape drift
seonghobae Aug 27, 2026
24384db
revert(oidc): preserve forward-compatible replay decision fields
seonghobae Aug 27, 2026
c0f10ef
test(internal): bind Durable Object endpoint authority
seonghobae Aug 27, 2026
e9a19aa
fix(rate-limit): bind internal endpoint identity
seonghobae Aug 27, 2026
a1d2095
fix(replay): bind internal endpoint identity
seonghobae Aug 27, 2026
c00fa86
test(rate-limit): preserve malformed-request coverage on canonical en…
seonghobae Aug 27, 2026
197850e
test(replay): preserve malformed-request coverage on canonical endpoint
seonghobae Aug 27, 2026
686b47f
test: reject replay decisions with unknown members
seonghobae Aug 27, 2026
0faa125
fix: require exact replay decision schema
seonghobae Aug 27, 2026
1ed0fa7
test: align replay key integrity with exact schema
seonghobae Aug 27, 2026
df6a698
test: align replay residual coverage with exact schema
seonghobae Aug 27, 2026
f546234
test(oidc): require exact audience authority
seonghobae Aug 27, 2026
8441ecc
fix(oidc): require exact audience authority
seonghobae Aug 27, 2026
e06ce74
test(trace): reject normalized non-ASCII trace authority
seonghobae Aug 27, 2026
89fce32
test(trace): enforce public canonical trace authority
seonghobae Aug 27, 2026
c86e45b
fix(trace): preserve exact header authority
seonghobae Aug 27, 2026
52d9bc2
fix(trace): preserve exact public header authority
seonghobae Aug 27, 2026
877f592
test(oidc): reject non-object JWT JSON envelopes
seonghobae Aug 27, 2026
d5ef532
fix(oidc): require object JWT JSON envelopes
seonghobae Aug 27, 2026
717d6bd
test(oidc): align non-object rejection contract
seonghobae Aug 27, 2026
2e1cd10
fix(oidc): remove unreachable non-object claim branch
seonghobae Aug 27, 2026
22ff97b
test(worker): reject normalized trace authority
seonghobae Aug 27, 2026
16ba120
fix(worker): preserve canonical trace authority
seonghobae Aug 27, 2026
58caf63
test(oidc): require central workflow repository authority
seonghobae Aug 27, 2026
15d495f
test(oidc): bind regression to protected worker boundary
seonghobae Aug 27, 2026
01d7c3e
fix(oidc): require central workflow repository authority
seonghobae Aug 27, 2026
b42691e
fix(readiness): bind workflow authority to central repository
seonghobae Aug 27, 2026
517b9e6
test(oidc): model configured distributed limit in trust regression
seonghobae Aug 27, 2026
3529a4e
test(oidc): cover central repository owner mismatch
seonghobae Aug 27, 2026
b8c3e84
test(github): bound installation token authority
seonghobae Aug 27, 2026
e7486e4
fix(github): bound installation token authority
seonghobae Aug 27, 2026
05fcbb2
test(observability): require collision-resistant OIDC subject receipt
seonghobae Aug 27, 2026
2d08525
fix(observability): strengthen OIDC subject evidence identity
seonghobae Aug 27, 2026
ae6bd2a
test(exchange): reject unreviewed request authority
seonghobae Aug 27, 2026
ea50fb1
fix(exchange): reject unreviewed request authority
seonghobae Aug 27, 2026
2afc8f4
docs(api): close exchange request schema
seonghobae Aug 27, 2026
9329b00
test(exchange): converge exact-schema regressions
seonghobae Aug 27, 2026
498955e
test(readiness): preserve canonical trace correlation
seonghobae Aug 27, 2026
d58b6aa
fix(readiness): preserve canonical trace correlation
seonghobae Aug 27, 2026
0530be8
test(oidc): reject ambiguous JWKS key identifiers
seonghobae Aug 28, 2026
44702a3
fix(oidc): reject ambiguous JWKS key identifiers
seonghobae Aug 28, 2026
0dd4653
test(oidc): reject unsupported critical JOSE headers
seonghobae Aug 28, 2026
71cb7f3
test(oidc): bind critical JOSE rejection to bearer boundary
seonghobae Aug 28, 2026
bc6f4d6
fix(oidc): reject unsupported critical JOSE headers
seonghobae Aug 28, 2026
ff803d5
test(oidc): reject unsupported b64 signing semantics
seonghobae Aug 28, 2026
489ba34
fix(oidc): reject unsupported b64 signing semantics
seonghobae Aug 28, 2026
20edfc0
test(rate-limit): reject normalized IPv6 client aliases
seonghobae Aug 28, 2026
0b8ccec
fix(rate-limit): reject non-canonical IPv6 client aliases
seonghobae Aug 28, 2026
ec5ff0c
fix(rate-limit): preserve semantic IPv6 bucket identity
seonghobae Aug 28, 2026
6f952dd
test(oidc): reject mismatched metadata media types
seonghobae Aug 28, 2026
e2746c3
fix(oidc): bind metadata responses to JSON media type
seonghobae Aug 28, 2026
4115783
test(oidc): cover missing JWKS media type
seonghobae Aug 28, 2026
6bdc55f
test(oidc): cover absent metadata content types
seonghobae Aug 28, 2026
8788bd7
test(github-api): reject unreviewed JSON media type
seonghobae Aug 28, 2026
8bf2ec8
fix(github-api): bind JSON responses to reviewed media type
seonghobae Aug 28, 2026
f780dc0
chore(source): restore final newline after GitHub API repair
seonghobae Aug 28, 2026
26d2066
test(github-api): cover missing JSON media type
seonghobae Aug 28, 2026
25070d4
test(github-api): reject BOM-normalized credential JSON
seonghobae Aug 28, 2026
27e8930
test(oidc): reject BOM-normalized discovery JSON
seonghobae Aug 28, 2026
e2fc03d
fix(json): reject normalized external authority bytes
seonghobae Aug 28, 2026
aa8584f
test(github-api): reject duplicate credential keys
seonghobae Aug 28, 2026
3a5c314
fix(json): reject duplicate external authority keys
seonghobae Aug 28, 2026
9303644
test(oidc): reject duplicate nested JWK authority keys
seonghobae Aug 28, 2026
c305e4c
fix(json): reject nested duplicate authority keys
seonghobae Aug 28, 2026
07c1994
test(json): cover whitespace before authority separators
seonghobae Aug 28, 2026
c7d2e63
test(json): bound streamed external authority responses
seonghobae Aug 28, 2026
39af6c4
fix(json): bound external authority response bodies
seonghobae Aug 28, 2026
3488d91
test(json): cover empty external authority body
seonghobae Aug 28, 2026
bd19ad0
test(oidc): require current central workflow source
seonghobae Aug 28, 2026
02ff991
fix(oidc): roll trusted workflow source forward
seonghobae Aug 28, 2026
9f73921
docs(architecture): bind current central workflow trust
seonghobae Aug 28, 2026
9b175ee
test(oidc): reject non-string JOSE key ids
seonghobae Aug 28, 2026
c7b581c
fix(oidc): reject non-string JOSE key ids
seonghobae Aug 28, 2026
3f053f5
test(oidc): reject stale issued-at authority
seonghobae Aug 28, 2026
d6f572f
fix(oidc): bound issued-at token lifetime
seonghobae Aug 28, 2026
0479133
test(oidc): require current audited central trust source
seonghobae Aug 28, 2026
f4f7f52
fix(oidc): roll trusted central workflow source forward
seonghobae Aug 28, 2026
ce26183
docs(architecture): bind current audited workflow source
seonghobae Aug 28, 2026
dd95e3b
test(oidc): bound JOSE key-id discovery authority
seonghobae Aug 28, 2026
067609a
fix(oidc): bound JOSE key-id discovery selector
seonghobae Aug 28, 2026
c035471
test(ci): require reusable patch-validator build cache
seonghobae Aug 28, 2026
fdf4bd4
fix(ci): cache exact-head patch-validator builds
seonghobae Aug 28, 2026
b20ca3d
test(readiness): fail closed without credential fetch capability
seonghobae Aug 28, 2026
cdc9d83
fix(readiness): require credential fetch capability
seonghobae Aug 28, 2026
8b6f932
test(readiness): reject non-installable fetch capability
seonghobae Aug 28, 2026
740e126
fix(readiness): require replaceable credential fetch capability
seonghobae Aug 28, 2026
f28d02c
test(exchange): reject overlong GitHub repository authority
seonghobae Aug 28, 2026
0cde5cb
fix(exchange): bound GitHub repository name authority
seonghobae Aug 28, 2026
a20ded2
test(openapi): bound repository locator name segment
seonghobae Aug 28, 2026
39e4ded
fix(openapi): bound repository locator name segment
seonghobae Aug 28, 2026
0da20e3
docs(api): document repository-name authority bound
seonghobae Aug 28, 2026
ed63294
docs(security): align repository-name validation contract
seonghobae Aug 28, 2026
481889f
test(egress): reject overlong repository token scope
seonghobae Aug 28, 2026
3a905c8
fix(egress): bound repository token scope
seonghobae Aug 28, 2026
3feafcf
test(openapi): bind pre-limiter 405 headers
seonghobae Aug 28, 2026
eaa4b82
fix(openapi): align pre-limiter 405 headers
seonghobae Aug 28, 2026
a5b173a
test(openapi): align distributed header authority
seonghobae Aug 28, 2026
0a37077
test(oidc): require current central workflow source
seonghobae Aug 28, 2026
9233f62
fix(oidc): trust current central workflow source
seonghobae Aug 28, 2026
62b1527
docs(architecture): record current central trust rollforward
seonghobae Aug 28, 2026
7cbfcaa
test(oidc): roll trusted central workflow source
seonghobae Aug 28, 2026
1bed960
fix(oidc): trust current protected central source
seonghobae Aug 28, 2026
fba53f1
docs(architecture): record current central workflow trust
seonghobae Aug 28, 2026
6e3fddf
test(oidc): require authoritative metadata status
seonghobae Aug 28, 2026
f9771f6
fix(oidc): require authoritative metadata status
seonghobae Aug 28, 2026
806d13b
test(github): require endpoint-specific success status authority
seonghobae Aug 28, 2026
3734c00
fix(github): bind JSON success to endpoint status
seonghobae Aug 28, 2026
c199798
test(github): align app token fixtures with HTTP 201
seonghobae Aug 28, 2026
c00ee25
test(github): use HTTP 201 token-mint fixtures
seonghobae Aug 28, 2026
5a534ae
test(github): model token creation as HTTP 201
seonghobae Aug 28, 2026
3e49c9c
test(github): model successful token creation status
seonghobae Aug 28, 2026
cde6492
test(github): preserve token expiry semantics under HTTP 201
seonghobae Aug 28, 2026
2b1377f
test(github): model expiry fixture as HTTP 201
seonghobae Aug 28, 2026
ef25107
test(github): preserve token response semantics under HTTP 201
seonghobae Aug 28, 2026
ea58ea1
test(github): model worker token responses as HTTP 201
seonghobae Aug 28, 2026
6edea7a
test(oidc): reject contradictory JWKS key operations
seonghobae Aug 28, 2026
de5b2cf
fix(oidc): enforce JWKS verification key operations
seonghobae Aug 28, 2026
f899ad9
test(egress): reject unused app installation listing authority
seonghobae Aug 28, 2026
978c54b
fix(egress): remove unused app installation listing authority
seonghobae Aug 28, 2026
f5a2875
test(egress): keep redirect coverage on used installation lookup
seonghobae Aug 28, 2026
7cb8ca8
test(egress): bind authorization framing to used lookup
seonghobae Aug 28, 2026
e9193ed
test(rate-limit): bound local client bucket cardinality
seonghobae Aug 29, 2026
eb8c721
fix(rate-limit): bound local client bucket retention
seonghobae Aug 29, 2026
0c65c58
fix(rate-limit): restore canonical source newline
seonghobae Aug 29, 2026
bfb6f88
test(rate-limit): cover expired bucket cleanup at capacity
seonghobae Aug 29, 2026
33b6c1d
fix(rate-limit): remove unreachable capacity branch
seonghobae Aug 29, 2026
42fcb19
test(rate-limit): preserve renewed bucket eviction recency
seonghobae Aug 29, 2026
e2095a8
fix(rate-limit): refresh renewed bucket eviction recency
seonghobae Aug 29, 2026
9a62f08
test(ci): preserve in-flight validator cache seed
seonghobae Aug 29, 2026
e111bf3
fix(ci): let validator builds seed shared cache
seonghobae Aug 29, 2026
b8a9254
test(exchange): reject misleading JSON media types in base worker
seonghobae Aug 29, 2026
66982b4
fix(exchange): enforce reviewed JSON media type in base worker
seonghobae Aug 29, 2026
3a22b65
test(exchange): align helper coverage with reviewed media type
seonghobae Aug 29, 2026
07e0971
test(exchange): cover missing media type with request body
seonghobae Aug 29, 2026
91e7295
test(exchange): exercise truly missing media type
seonghobae Aug 29, 2026
895cd67
test(exchange): accept GitHub App PKCS#1 private key
seonghobae Aug 29, 2026
51df024
fix(exchange): normalize GitHub App PKCS#1 private keys
seonghobae Aug 29, 2026
dba837b
fix(runtime): accept GitHub App PKCS#1 private keys
seonghobae Aug 29, 2026
53206e0
test(runtime): verify GitHub App PKCS#1 readiness
seonghobae Aug 29, 2026
89580bb
fix(runtime): remove unreachable private-key branches
seonghobae Aug 29, 2026
48d0f40
test(runtime): cover private-key envelope rejection paths
seonghobae Aug 29, 2026
c12dc70
test(runtime): accept canonical PKCS8 terminal newline
seonghobae Aug 29, 2026
de79d57
fix(runtime): canonicalize PKCS8 terminal newline
seonghobae Aug 29, 2026
9900a6c
test(runtime): preserve private-key readiness cache after normalization
seonghobae Aug 29, 2026
5abf296
fix(runtime): preserve readiness cache across key normalization
seonghobae Aug 29, 2026
106dcb9
fix(runtime): type normalized credential cache source safely
seonghobae Aug 29, 2026
5aba3b5
test(runtime): reject stale cached binding authority
seonghobae Aug 29, 2026
14dcc58
fix(runtime): drop withdrawn cached bindings
seonghobae Aug 29, 2026
6324905
test(oidc): reject encryption-use JWKS keys
seonghobae Aug 29, 2026
8045096
test(trust): require current central workflow source
seonghobae Aug 29, 2026
efad421
fix(oidc): honor JWKS signing-use authority
seonghobae Aug 29, 2026
311c76e
fix(trust): roll forward audited central source
seonghobae Aug 29, 2026
a878de0
docs(architecture): record audited central trust roll-forward
seonghobae Aug 29, 2026
eb28212
test(trust): require latest central workflow source
seonghobae Aug 29, 2026
d307e4a
fix(trust): follow current protected central source
seonghobae Aug 29, 2026
6fe3e76
docs(architecture): track latest central trust authority
seonghobae Aug 29, 2026
0d4dc6f
test(egress): reject unreviewed anonymous GitHub API calls
seonghobae Aug 29, 2026
5e4c0f8
test(egress): preserve exact public metadata diagnostic
seonghobae Aug 29, 2026
237334a
chore(test): drop superseded egress experiment
seonghobae Aug 29, 2026
4e8b6f3
test(private-key): reject bare-CR PEM termination
seonghobae Aug 29, 2026
3d740e6
fix(private-key): reject bare-CR PEM termination
seonghobae Aug 29, 2026
ddc1df8
test(exchange): reject unreviewed query authority
seonghobae Aug 29, 2026
e504385
fix(exchange): reject unreviewed query authority
seonghobae Aug 29, 2026
8a30904
test(exchange): reject bare query delimiter authority
seonghobae Aug 29, 2026
5bc743a
fix(exchange): require exact resource-form URL
seonghobae Aug 29, 2026
609af78
fix(exchange): preserve stable validation message
seonghobae Aug 29, 2026
2a6a922
test(github-app): refresh stale installation cache
seonghobae Aug 29, 2026
b39b4f1
fix(github-app): refresh retired cached installation ids
seonghobae Aug 29, 2026
d3ea853
test(github-app): retry installation refresh only from cache
seonghobae Aug 29, 2026
484f39c
fix(github-app): refresh only cached installation authority
seonghobae Aug 29, 2026
bfae9ee
ci: retrigger exact-head patch validator
seonghobae Aug 29, 2026
3d2c4d3
test(egress): restrict anonymous GitHub API authority
seonghobae Aug 29, 2026
f2e0802
fix(egress): bound anonymous GitHub API authority
seonghobae Aug 29, 2026
9cce753
merge(main): adopt protected #505 integration for egress repair
seonghobae Aug 29, 2026
05e4a66
merge(main): retain licensing integration with egress repair
seonghobae Aug 29, 2026
cba0900
test(egress): align legacy cases with reviewed operations
seonghobae Aug 29, 2026
dc6c302
test(egress): reject unreviewed outbound header authority
seonghobae Aug 29, 2026
b2367eb
fix(egress): bound outbound header authority
seonghobae Aug 29, 2026
bbb4e98
test(egress): align retired listing destination verdict
seonghobae Aug 29, 2026
6ee5540
test(egress): use reviewed GitHub media type
seonghobae Aug 29, 2026
77c6b39
test(egress): match production token-mint headers
seonghobae Aug 29, 2026
75e6e1e
test(egress): require exact token-mint JSON media type
seonghobae Aug 29, 2026
fa11c84
fix(egress): bind token mint to JSON media type
seonghobae Aug 29, 2026
a3046ad
fix(egress): canonicalize token mint media type
seonghobae Aug 29, 2026
ac96ea4
test(egress): bind scope cases to JSON media type
seonghobae Aug 29, 2026
8d5f0c0
test(egress): bind token operation to JSON media type
seonghobae Aug 29, 2026
b802dc5
test(egress): prove canonical token media type on wire
seonghobae Aug 29, 2026
d94a069
test(egress): close token media-type branch coverage
seonghobae Aug 29, 2026
a4a318b
test(egress): cover noncanonical reviewed header value
seonghobae Aug 29, 2026
b4812ae
test(egress): cover rejected-header short circuit
seonghobae Aug 29, 2026
f4527e9
test(egress): prove reviewed production header contract
seonghobae Aug 29, 2026
cf3a756
test(github-app): bind configured installation to repository
seonghobae Aug 29, 2026
e87212d
fix(github-app): verify configured installation ownership
seonghobae Aug 29, 2026
71859c3
test(github-app): reflect repository-bound configured installs
seonghobae Aug 29, 2026
355ca3d
test(egress): require canonical Bearer framing
seonghobae Aug 29, 2026
cb7cf4d
fix(egress): enforce canonical Bearer scheme
seonghobae Aug 29, 2026
69cde35
test(egress): reject non-canonical HTTP method casing
seonghobae Aug 29, 2026
172cc90
fix(egress): preserve canonical HTTP method bytes
seonghobae Aug 29, 2026
39d9b63
test(egress): fail closed on malformed request headers
seonghobae Aug 29, 2026
0239b29
fix(egress): fail closed on malformed headers
seonghobae Aug 29, 2026
ab15f39
test(egress): require explicit installation token media authority
seonghobae Aug 29, 2026
b5eb23f
test(egress): preserve canonical media-type synthesis contract
seonghobae Aug 29, 2026
07c9b13
test(egress): fail closed on malformed cancellation authority
seonghobae Aug 29, 2026
5a550d5
fix(egress): fail closed on invalid cancellation signals
seonghobae Aug 29, 2026
e135ad9
test(egress): classify streamed deadline expiry as timeout
seonghobae Aug 29, 2026
c19549b
fix(egress): preserve streamed timeout authority
seonghobae Aug 29, 2026
2c065df
test(egress): reject pre-aborted caller authority before transport
seonghobae Aug 29, 2026
7615cfc
fix(egress): honor pre-aborted caller signal before transport
seonghobae Aug 29, 2026
6e71cbf
test(ci): require stale image runs to cancel
seonghobae Aug 29, 2026
8819ec6
fix(ci): cancel superseded image verification runs
seonghobae Aug 29, 2026
0c3f1f3
test(ci): require resilient image scanner downloads
seonghobae Aug 29, 2026
bd6e936
fix(ci): retry transient scanner release downloads
seonghobae Aug 29, 2026
1208839
test(egress): preserve mid-flight caller cancellation
seonghobae Aug 29, 2026
804f6ed
fix(egress): honor mid-flight caller cancellation
seonghobae Aug 29, 2026
ffa11e6
test(egress): cover bodyless late cancellation
seonghobae Aug 29, 2026
2828948
test(egress): preserve cancellation during body streaming
seonghobae Aug 29, 2026
439fa8f
fix(egress): honor cancellation during body streaming
seonghobae Aug 29, 2026
873496d
test(egress): preserve cancellation over late transport rejection
seonghobae Aug 29, 2026
3677562
fix(egress): preserve caller abort reason on late rejection
seonghobae Aug 29, 2026
2eb620d
test(egress): reject normalized reviewed header authority
seonghobae Aug 29, 2026
36bfd2c
fix(egress): preserve raw reviewed header authority
seonghobae Aug 29, 2026
0212ef8
test(egress): require timeout despite abort-ignoring body
seonghobae Aug 29, 2026
00c6161
fix(egress): enforce abort-aware response reads
seonghobae Aug 29, 2026
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
19 changes: 14 additions & 5 deletions .github/workflows/patch-validator-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

concurrency:
group: noema-patch-validator-image-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
cancel-in-progress: true

permissions:
contents: read
Expand Down Expand Up @@ -80,6 +80,17 @@ jobs:
scanner_dir="$RUNNER_TEMP/noema-binary-scanners"
mkdir -p "$scanner_dir"

download_scanner_asset() {
destination="$1"
url="$2"
curl --proto '=https' --tlsv1.2 --location --fail --silent --show-error \
--retry 3 \
--retry-all-errors \
--retry-delay 2 \
--retry-max-time 60 \
--output "$destination" "$url"
}

install_scanner() {
scanner="$1"
version="$2"
Expand All @@ -88,12 +99,10 @@ jobs:
checksums="${scanner}_${version}_checksums.txt"
release_base="https://github.com/anchore/${scanner}/releases/download/v${version}"

curl --proto '=https' --tlsv1.2 --location --fail --silent --show-error \
--output "$scanner_dir/$checksums" "$release_base/$checksums"
download_scanner_asset "$scanner_dir/$checksums" "$release_base/$checksums"
printf '%s %s\n' "$checksums_sha256" "$scanner_dir/$checksums" | sha256sum --check --strict

curl --proto '=https' --tlsv1.2 --location --fail --silent --show-error \
--output "$scanner_dir/$archive" "$release_base/$archive"
download_scanner_asset "$scanner_dir/$archive" "$release_base/$archive"
(
cd "$scanner_dir"
grep -E "^[0-9a-f]{64} ${archive}$" "$checksums" | sha256sum --check --strict
Expand Down
27 changes: 19 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -815,20 +815,19 @@ async function resolveInstallationId(
repository: string,
env: Env,
): Promise<InstallationIdResolution> {
if (env.GITHUB_APP_INSTALLATION_ID) {
const configuredInstallationId = env.GITHUB_APP_INSTALLATION_ID;
const configuredInstallationId = env.GITHUB_APP_INSTALLATION_ID;
if (configuredInstallationId) {
if (!/^[1-9]\d*$/.test(configuredInstallationId)) {
throw new ApiError("ERR_GITHUB_INSTALLATION", 500, "GitHub App installation id configuration is invalid");
}
const numericInstallationId = Number(configuredInstallationId);
if (!Number.isSafeInteger(numericInstallationId) || String(numericInstallationId) !== configuredInstallationId) {
throw new ApiError("ERR_GITHUB_INSTALLATION", 500, "GitHub App installation id configuration is invalid");
}
return { value: configuredInstallationId, source: "configured" };
}
const now = Date.now();
const cacheKey = `${env.GITHUB_API_BASE}:${env.GITHUB_APP_ID}:${repository}`;
const cached = installationIdCache.get(cacheKey);
const cached = configuredInstallationId ? undefined : installationIdCache.get(cacheKey);
if (cached && cached.expiresAtMs > now) {
return { value: cached.value, source: "cache" };
}
Expand All @@ -850,11 +849,23 @@ async function resolveInstallationId(
throw new ApiError("ERR_GITHUB_API", 502, "GitHub API returned invalid installation response");
}
const installationId = String(installation.id);
installationIdCache.set(cacheKey, {
if (configuredInstallationId && installationId !== configuredInstallationId) {
throw new ApiError(
"ERR_GITHUB_INSTALLATION",
500,
"GitHub App installation id does not match target repository",
);
}
if (!configuredInstallationId) {
installationIdCache.set(cacheKey, {
value: installationId,
expiresAtMs: now + configuredTtlMs(env.NOEMA_INSTALLATION_CACHE_TTL_SECONDS, 600, 3600),
});
}
return {
value: installationId,
expiresAtMs: now + configuredTtlMs(env.NOEMA_INSTALLATION_CACHE_TTL_SECONDS, 600, 3600),
});
return { value: installationId, source: "discovery" };
source: configuredInstallationId ? "configured" : "discovery",
};
}

async function createInstallationToken(repository: string, env: Env): Promise<InstallationToken> {
Expand Down
Loading
Loading