Skip to content

chore(lambda): remove github-oauth-bridge, redeploy scheduler-handler on al2023 (#716) - #720

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/716-remove-oauth-bridge-redeploy-scheduler
Oct 5, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/716-remove-oauth-bridge-redeploy-scheduler

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #716. The two operational items are done, and doing them surfaced three defects — two in the deploy script, one in the census I wrote an hour earlier.

github-oauth-bridge removed

A Lambda exchanging a GitHub login for AWS credentials via STS, deployed January 2026 and superseded by the current portal. Verified unused before touching anything:

  • zero invocations on the function and its API Gateway over 60 days
  • no page on spore.host references its endpoint (the single match on the homepage was the literal word "OAuth" in copy)
  • the spawn-dashboard Cognito pool uses Google and Globus, not its OIDC issuer — and the OIDC discovery handler wasn't even routed

Gone: function, API Gateway, IAM role, the role's custom policy, and lambda/github-oauth/. Code and config archived first.

One action left, and it isn't mine to take. Its GITHUB_CLIENT_SECRET and JWT_SECRET sat in plaintext environment variables, and the client id was a hardcoded default in the source. Deleting the AWS resources does not invalidate the GitHub OAuth app — that secret stays valid until the app is revoked on GitHub.

scheduler-handler on provided.al2023, and why the script could never have done it

update-function-code does not change a runtime, and --runtime appeared only in the create path — which never runs for an existing function. So the script could declare provided.al2023 and redeploy forever while the deployed function stayed on provided.al2. That is exactly what happened between January and October.

The configuration update now carries the runtime. It also used to end in &>/dev/null || true, swallowing failures silently — a poor property for the step you are relying on.

The region trap, which I walked straight into

REGION came from ${AWS_REGION:-us-east-1}. AWS_REGION is ambient, mine was still us-west-2 from the reaper work, and the script created a second scheduler-handler in us-west-2 instead of updating the real one. The create path then had no wait, so the configuration update failed against a Creating function.

Region is now us-east-1 — what cmd/schedule.go hardcodes, so anywhere else is unreachable by its only caller — overridable only through an explicit SPAWN_LAMBDA_REGION, with a mismatched AWS_REGION reported rather than obeyed. The create path waits for function-active-v2. The stray function was deleted; us-west-2 had 0 schedules and the copy had no invoke policy.

The census overclaimed, and that was the error

It greps for the function name, and github-oauth-bridge's source was lambda/github-oauth/ — byte-identical to the deployed code and newer — because the directory is named for the service, not the function. So it asserted "NOT in this repo at all" about code sitting in the repo.

A name grep cannot prove absence, so it no longer claims to: the message says no file mentions the name, and lists lambda/*/ as candidates. The grep wasn't wrong; the strong claim was.

Verified

The redeploy took the update path in us-east-1, and a before/after diff of the function configuration shows exactly three changes:

Runtime      provided.al2  →  provided.al2023
Sha          DNlVjA7+...   →  /gfQDHIHb...
Modified     2026-01-24    →  2026-10-05

Role, handler, timeout, memory and environment untouched — zero unintended drift. The census is clean across declared and deployed runtimes in both accounts.

One honest limit: the runtime is applied and the function is Active, but the new static binary will not have executed until the next schedule fires. There is one schedule in us-east-1.

… on al2023 (#716)

Closes the two operational items left on #716, and fixes three defects found doing
them — two in the deploy script, one in the census I wrote an hour ago.

--- github-oauth-bridge removed

A Lambda exchanging a GitHub login for AWS credentials via STS, deployed January
2026 and superseded by the current portal. Verified unused before touching it:
zero invocations on BOTH the function and its API Gateway over 60 days, no page on
spore.host referencing its endpoint, and the spawn-dashboard Cognito pool uses
Google and Globus rather than its OIDC issuer. Code and config archived first.

Gone: function, API Gateway, IAM role, the role's custom policy, and
lambda/github-oauth/.

Its GITHUB_CLIENT_SECRET and JWT_SECRET were in plaintext environment variables and
the client id was a hardcoded default in the source. Deleting AWS resources does
NOT invalidate the GitHub OAuth app — that secret stays valid until revoked on
GitHub, which is the one remaining action and not mine to take.

--- scheduler-handler on provided.al2023, and why the script could never do it

update-function-code does not change a runtime, and --runtime appeared only in the
CREATE path, which never runs for an existing function. The script could therefore
declare provided.al2023 and redeploy forever while the deployed function stayed on
provided.al2 — exactly what happened from January to October. The configuration
update now carries the runtime.

That block also ended in `&>/dev/null || true`, swallowing failures silently. A
step that hides its errors is a poor place to put the thing you are relying on, so
it no longer does.

--- the region trap, which I walked straight into

REGION came from ${AWS_REGION:-us-east-1}. AWS_REGION is ambient — mine was still
us-west-2 from the reaper work — so the script CREATED a second scheduler-handler
in us-west-2 instead of updating the real one in us-east-1. The create path then
had no wait, so the configuration update failed against a 'Creating' function.

Region is now us-east-1, which is what cmd/schedule.go hardcodes
(LoadInfraAWSConfig(ctx, "us-east-1")) — so a deployment anywhere else is
unreachable by its only caller. Overridable only through an explicit
SPAWN_LAMBDA_REGION, and a mismatched AWS_REGION is reported rather than obeyed.
The create path waits for function-active-v2. The stray function was deleted;
us-west-2 had 0 schedules and the copy had no invoke policy, so nothing used it.

--- the census overclaimed

It greps for the function NAME, and github-oauth-bridge's source was
lambda/github-oauth/ — byte-identical to the deployed code and NEWER — because the
directory is named for the service, not the function. So the census said "NOT in
this repo at all" about code sitting in the repo. A name grep cannot prove absence,
so it no longer claims to: the message says no file mentions the name and lists
lambda/*/ as candidates. The strong claim was the error, not the grep.

Verified: the redeploy took the UPDATE path in us-east-1; a before/after diff of
the function configuration shows exactly three changes — runtime al2 to al2023,
CodeSha256, and LastModified — with role, handler, timeout, memory and environment
untouched. The census is now clean across declared and deployed runtimes in both
accounts.
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 9949061 into main Oct 5, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/716-remove-oauth-bridge-redeploy-scheduler branch October 5, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing tracks deployed Lambda runtime versions: two are already stale (provided.al2, python3.11) and a runtime reaching EOL would be silent

1 participant