Skip to content

ADR: The code is public and the secrets are not

ADR: The code is public and the secrets are not

Status
accepted
Date
2026-09-13
Shipped as
1.0.0.117

Steve's ruling, on the day the visitor table went behind a key: "There should be no secret keys in the code, it should all be managed in other ways", so that "anyone who has the code doesn't have full access to the data", and then, on the key itself: "do that as long as I can see the table from the deployed website."

In plain words

The code is on GitHub for anyone to read, so it holds no passwords and no keys. Each secret is a name in the code, and its value lives in GitHub's secret store and in the site's Azure settings, where only the deploy and the running site can read it. Settings that change from one machine to the next work the same way: the code reads them from configuration, and each server fills in its own.

What that is worth: a developer can clone, build and run the whole project without being trusted with anything, and an organization can publish its code or hand it to a contractor without a key leaving with it. Changing a key means changing the secret and rolling the same build, never editing the code.

Context

This repository is public and always has been. Anybody can read every line and run it, and the site's own docs sidebar serves the source of every decision back to the visitor. That is the point of a portfolio, and it sets the one security question the project has to get right: what does a person who holds the whole repository not hold? The answer has to be "nothing that opens the live data", and it has to stay true under a full clone, a fork, a search of the git history and a read of every workflow log.

Until 1.0.0.114 the project had exactly one secret, the session signing key, and one convention for it, written when it arrived (ADR: Three readers with no memory of the project): a repository secret, filled into the container manifest at roll time, never a value in a file. The Admin tab's visitor rows (ADR: Site activity, and the line an address does not cross) added a second, the operator's key that opens the per-visitor table, and with two of them the convention deserved a record of its own, written as the security decision it is rather than a paragraph inside a feature.

Decision

No secret is a value in this repository. Not in code, not in configuration, not in a manifest, not in a test, not in the history. A secret is a name here and a value somewhere the code cannot read.

There are two secrets, and they travel one way. YARD_AUTH_SIGNING_KEY and ADMIN_KEY are repository secrets on GitHub. The deploy workflow receives each as an environment variable of one step, substitutes it into a copy of the container manifest under $RUNNER_TEMP in python (never sed, because a secret may carry a shell's syntax), and hands the copy to az container create. The manifest in the repository carries the placeholders __YARD_AUTH_SIGNING_KEY__ and __ADMIN_KEY__ as secureValue entries, which Azure keeps out of az container show and out of the portal. GitHub masks each secret in the workflow log, and the step's own echo never prints them. The running process reads Auth:SigningKey and Admin:Key from configuration, and the code knows only the names.

Everything else authenticates as the machine, with no secret at all. The workflow signs in to Azure with OpenID Connect (azure/login with a client id, a tenant id and a subscription id, all three repository variables and none of them secret): GitHub proves to Entra ID that this workflow on this branch is running, and Entra ID issues a token for the job. The container reaches Azure SQL Database as its own managed identity: the connection string is composed in the workflow from the server name, the database name and the identity's client id, with Authentication=Active Directory Managed Identity and no password, because there is none. The container reaches Azure Cosmos DB the same way, Cosmos__Credential: managed-identity, so the account's keys are never read, never copied and never in a place a leak could start. Application Insights' connection string is read from Azure at roll time and masked; it is an address rather than a credential, and it is not in the repository either.

A missing secret degrades, never crashes, and never opens anything. The substitution checks its own work: a placeholder left behind is detected in the workflow, logged as a warning, and the container starts with the setting reading as "no value". No signing key means the process invents one at startup and sessions end on the next roll. No admin key means the endpoint the key guards answers 404 to everybody, including the operator. A lost secret makes the site smaller. It never makes it open.

The keys in the tests are fixtures, and they unlock nothing. the-test-key in the xUnit suite and e2e-admin-key in the Playwright configuration are plain strings in the repository on purpose. Each is handed to a throwaway host the test itself starts, compared in constant time against the same string, and discarded with the host. They are on the public side of the line because they open nothing on the other side.

What the repository holder does get. The aggregate activity graph, the metrics card, the proof card and the health page, because those are public by design (ADR: Observability). The ability to run the whole system against their own stores, which is the point. What they do not get is a session signed as anybody else, a row from the live visitor table, or a byte from either live database, because none of the values that would allow it exist anywhere they can reach.

Rotation is a two-minute operation with no code change. Set the secret to a new value on GitHub, roll. The signing key's rotation ends every session, by design; the admin key's rotation changes the operator's URL and nothing else.

Alternatives

Azure Key Vault, read by the container at startup. The right answer at the next size up, and not this one. Two secrets, both consumed by one deploy step, do not earn a vault, a role assignment, a network rule and a second thing to be unreadable at three in the morning. The GitHub secret store is already the thing a roll trusts. If a third party ever needs a secret this pipeline does not hand it, a vault is where it goes, and this record gets an addendum.

The admin key in the code, "obfuscated". Rejected outright. A value in a public repository is public whatever shape it is written in, and the history keeps it after it is removed. His ruling is the whole reason this record exists.

A signed-in operator instead of a key. The Admin tab could ask for the owner's account and check a role. Rejected for now because an account here is a bidder (ADR: Accounts and per-user bids) and carries no role to anchor a check to; a key in a URL he keeps is the smaller surface. Reversible in one record if the account model ever grows a role.

A secret scanner in the gate. Considered, and held back because it would be a test asserting an absence it cannot define: the two fixture strings are meant to be there, and a scanner that allows them by name is a list, and a list proves nothing. What holds the line instead is the shape: no setting in the repository carries a value that opens anything, and this record is the place a reviewer checks that against.

Consequences

  • Two repository secrets, YARD_AUTH_SIGNING_KEY and ADMIN_KEY, are the whole secret inventory. Anything added to that list gets an addendum here before it ships. The email sender added the same evening added nothing to it: Azure Communication Services is reached as the containers' identity, and its endpoint and sender address are plain values in the manifests.
  • The workflow's identity, the SQL identity and the Cosmos DB identity are all federated or managed; there is no password or account key to rotate, leak or find in a log.
  • A fork runs, on the forker's own stores, with no secret copied from anyone.
  • The operator's admin URL carries the key as a query parameter, so it is his to keep out of screenshots and bookmarks he shares. The page reads it once at load and drops it from the address bar on the first render.

Where it sits

The only ring involved is the host Api, where the Composition steps read Admin:Key and Auth:SigningKey by name and hand them to AdminKey and TokenIssuer; the rest is the deploy workflow and the container manifests. No SOLID principle is at stake, because this rule governs where secret values live and says nothing about how classes depend on each other. A lost secret shrinks the site, and rotating the signing key signs every visitor out. A third consumer of secrets outside this one deploy step would justify Azure Key Vault and a role for the site's identity.

Files

# The session signing key and the operator's key, from the repository
# secrets of the same names, handed to the step through env and written
# to a file by python, so neither is ever part of a command line and
# neither appears in a log: GitHub masks them, and the settings call
# prints nothing. A value this job does not hold is left out, and the
# site keeps what it has: the template's placeholder on a new site,
# which the app reads as "no key", or the last roll's value
# (ADR: Three readers with no memory of the project; ADR: Site
# activity, and the line an address does not cross).
CONN="$CONN" YARD_SQL="$YARD_SQL" python3 - "$RUNNER_TEMP/settings.json" <<'PY'
import json, os, sys
wanted = {
    "APPLICATIONINSIGHTS_CONNECTION_STRING": os.environ.get("CONN", ""),
    "ConnectionStrings__YardSql": os.environ.get("YARD_SQL", ""),
    "Auth__SigningKey": os.environ.get("YARD_AUTH_SIGNING_KEY", ""),
    "Admin__Key": os.environ.get("ADMIN_KEY", ""),
}
# The Netlify token is optional: the edge card says in a sentence when
# it is missing, so an unset secret is a plain line here, not a warning
# (ADR: One frame for every resource).
# The LinkedIn app's two values are optional too: until they exist the LinkedIn
# posting card says "Not set up yet" (ADR: LinkedIn posting through the
# self-serve API).
optional = {
    "Netlify__Token": os.environ.get("NETLIFY_TOKEN", ""),
    "LinkedIn__ClientId": os.environ.get("LINKEDIN_CLIENT_ID", ""),
    "LinkedIn__ClientSecret": os.environ.get("LINKEDIN_CLIENT_SECRET", ""),
}
held = [{"name": name, "value": value, "slotSetting": False} for name, value in {**wanted, **optional}.items() if value]
for name, value in wanted.items():
    if not value:
        print(f"::warning::{name} is not held by this job; the site keeps the value it has")
for name, value in optional.items():
    if not value:
        print(f"{name} is not set; the card that reads it says so")
json.dump(held, open(sys.argv[1], "w", encoding="utf-8"))
print(f"{len(held)} of {len(wanted) + len(optional)} values go to the site (values masked)")
PY

Live from .github/workflows/deploy.yml, region secrets, read from this build at 99df7a8.

Enforced by

Not machine-checked. Held by review.

Store

The Yard, home

Steven StoutStaff .NET engineerRemote

Production .NET that stays up. Built with AI, measured on every version.

Steven Stout

Hi, I'm Steve. I build the systems that make delivery boring in the best way, then coach people inside them.

  • 200+

    production releases, none took the platform down

    Conway Investment Research, 2019 to 2024. Sole engineer for the first three years on a live financial advisory platform.

    See how
  • 50%

    shorter release cycle

    Storee Construction, 2024 to 2026. Four ASP.NET applications onto one .NET 10 platform on Azure, with a four-person team I hired and mentored.

    See how

01Verified

Steven Stout

A real person, and the work is mine.

  • Identity

    Checked by LinkedIn, not by me.

    LinkedIn verified my government ID.

  • Running system

    You are looking at it.

    Version 1.0.5.273 is live. Nothing ships unless it passes the automated gates first.

That's who I am. Here's how I work.

02Strengths

Ten strengths, each with the proof beside it. The numbers match my resume and LinkedIn, and the live ones are read from this site as you look.

  • 01

    Keeps production alive

    200+ releases on a live financial platform, and none took it down. Sole engineer for the first three years.

    See the Conway work

  • 02

    Simplifies messy systems

    Four ASP.NET applications onto one .NET 10 platform on Azure, and a release cycle 50% shorter.

    See the Storee work

  • 03

    Marries dev and infrastructure

    Blue-green releases at Storee that flipped in about 5 seconds with nobody signed out, and Azure Front Door at two employers.

    See this site's cloud

  • 04

    Designs data that holds up

    White-label clients on one shared database, the isolation built into the data, and no cross-client issues.

    See the Conway work

  • 05

    Keeps AI-written code honest

    15 quality numbers that may only improve: 273 releases in a row with none worse.

    See the quality numbers

  • 06

    Resourceful

    $30,000+ cut from Azure and vendor spend at Conway. This site's Azure bill is public, resource by resource.

    See the bill

  • 07

    Builds people up

    Hired and mentored a four-person team. 13 colleagues recommend me by name.

    Read the recommendations

  • 08

    Takes ideas to production

    This site: designed, built and run solo, with 352 versions measured through one gate.

    How it was built

  • 09

    Writes clearly

    Posts on real engineering problems, in plain words.

    Read the blog

  • 10

    Owns decisions

    153 decision records, each with its tradeoff and the call I made.

    See the decision records

Built with AI. Gated so quality never slides.

Steven Stout’s showcase: a used-vehicle auction on .NET and React, built and run by one engineer, live on Azure, with its decisions written down.

No quality number has gotten worse at any release since 1.0.5.1 on 10 November: 273 releases in a row.

One engineer, an AI agent and a gate that checks 15 quality numbers on every release. 352 versions measured, with every result public, the worst days included.

82 releases in the last 7 days, each through the same gate.

Async methods with no CancellationToken, may only fall

11091.0.3.1391.0.5.2731.0.4.115, the ratchet
Every number, on the Quality page

TheYard, right nowLive

Answering in

unread

02505007501,000

server time at p95, the usual five minutes of the last day.

Azure this month

unread

the bill, by resource, read from Azure. The Admin tab shows every line.

Since the last roll

unread

 

rolled in place by the pipeline, behind one gate.

People who have visited

unread

30 days agotoday

Scanners, my own tools' and my own reads left out.

03Start here

04Where teams are heading

How I see engineering with AI, and the setup on this site that backs it.

AI-augmented teams · Architecture and ownership

AI writes more of the code. Someone still has to own what ships.

Teams are going to be heavily AI-augmented. That moves the senior job toward architecture and technical ownership: deciding what to build in pieces small enough to verify, and owning what ships.

  • Task tracking will get automated too. Judgment stays human: seeing a design fail at scale before it does.
  • On this site the AI's first design held the whole catalogue in memory. I caught it when the App Service plan hit 82 per cent and moved the work to the store.

What the AI wrote, what I decided

07Tech stack

  •    
  •    
  •    

Read from the build, never typed by hand

What TheYard runs on

What we use, where it runs, its AWS twin, the version as built, and the file that proves it.

Cloud patterns, not one vendor: every Azure piece in this stack has a named AWS twin. Mapped, not yet run on AWS.

  • .NET 1114 projects
  • React 19.3TypeScript 7.0
  • Azure9 Bicep files
  • 11GitHub Actions workflows
The whole stack, with the file that proves each line

The last release the gate stopped was 1.0.5.258 on 2 December, at its browser 1 of 2 job.

08How it is built

09How it is run

10Who and why

Next step

11What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn