Skip to content
← Free FDE training guides

Free learning / 40-minute configuration lab + 30-minute rotation proof

Configuration 101: what did the program actually load?

Trace settings into a running process, then observe two replicas through credential overlap, early revocation and rollback with safe diagnostics.

No account needed. Use your own copy for writing and keep the original as a reference.

Engineering lab library / Run locally

See the settings your process actually received.

Predict six startup and update cases, then remove an override and repair an invalid value in separate copies.

Real Node.js processes and a generated dotenv file in a temporary folder. No inherited terminal credentials, model, network or existing-project changes; only approved diagnostic fields are returned.

Search titles, outcomes and prerequisites, then narrow by runtime.

2 of 2 labs · All labs

  1. Start here / Node.js 24 · Offline exercise

    Configuration 101 · real local processes

    Observe loading, inherited precedence, validation, file edits and process-local changes.

    Node.js 24 · Standard library · No model or network

  2. Node.js 24 · Offline exercise

    Two-replica credential rotation

    Observe partial rollout, early revocation and rollback using per-process startup state and actual local authentication responses.

    Node.js 24 · Owned child processes · Loopback HTTP · Generated fixtures only

A fictional service prepares a maintenance-response draft. Before it can create a model client, it needs settings: an attempt limit and a credential. The code works in one launch but stops in another. Start with the settings reaching the program, before changing the model or framework.

The original 40-minute lab in sections 1–6 runs real Node.js processes and reads a generated local dotenv file. It uses no model, network, provider credential, package installation or cloud account. Its generated credential has no authority anywhere. The optional companion in section 7 adds a separate loopback HTTP exercise. Do not put real credentials into this exercise.

1. Name the pieces before configuring a client

Configuration means settings that control how a program runs. An attempt limit is ordinary configuration. A credential is sensitive configuration. Both might reach an application through environment variables, but they need different handling in logs, source control and access policy.

A process is one running instance of a program. An environment variable is a named text value available to that process. A dotenv file is a text file of name=value lines. It is an input to a loader, not the process environment itself. In this lab, Node's --env-file option performs the loading. A framework can have its own automatic loading and precedence rules; do not generalize this command's behavior to every framework.

Think of the same function run with different arguments: the implementation stays the same while inputs change its behavior. The analogy has a limit. Configuration often arrives when the application starts and remains in memory; it is not automatically refreshed with every request.

An SDK is another component. It uses the configuration your application supplies, then prepares a service request. Loading a nonempty credential does not prove that it is valid, scoped correctly or accepted by that service.

2. Trace one setting and decide what may be shown

The fictional setting DEMO_MAX_ATTEMPTS is a limit from 1 to 5. The program reads it as text and explicitly converts a valid value to a number. DEMO_CREDENTIAL is generated inside the exercise. The output reports only credentialConfigured: true or false, never its value.

Follow this path: file and launch settings → process environment → application validation → allowlisted diagnostic. Precedence is the rule for deciding which source wins when two define the same name. For Node's --env-file, an inherited value takes priority over the file's value.

Do not confuse parsing with validation. A dotenv parser can load the word many. The application's startup rule still rejects it as an attempt limit. The rule names the expected range without echoing an arbitrary rejected input. A missing required credential also stops the example before client creation; there is no silent fallback to another account.

The script never creates a client or tries authentication. configuration-ready means only that this example's local startup checks passed. It is not a service-health result.

UNDERSTAND THE SYSTEM

How does a setting reach the running program?

A fictional draft service needs an attempt limit and a credential before creating a client. Follow six views of a real local Node.js experiment. Credentials are represented only as present or absent; no service is contacted.

FOLLOW THE WORK

Watch one example, step by step.

6 authored stepsYou control the pace
01 / EXPLORE THE PARTSControls loading · written explanations below
Direction of information or workReturn / feedback

WHAT THIS PART DOES

Configuration file

A dotenv file holds name=value text on disk. In this plain Node.js lab, it is read only when startup includes --env-file. It is not a secret vault.

CONNECTED TO
  • Load at startup: Running process
Read the full worked example
  1. 01
    A file exists, but nothing loaded it

    The plain Node command does not automatically read .env.demo. The program sees missing variables and stops before creating a client. A framework may have its own loading rules; inspect those separately.

    NOT-LOADED: Missing settings · stop-before-client · exit 2

  2. 02
    Load and validate the file

    With --env-file, the string 2 and generated fixture reach the process. Our check converts the limit to number 2 and reports credential presence only. This establishes configuration readiness, not a successful provider call.

    FILE-LOADED: String input → number 2 · configuration-ready · exit 0

  3. 03
    An inherited value wins

    The launch environment supplies limit 4 while the file says 2. Node's --env-file preserves the inherited value. Editing the file will not fix that conflicting launch setting.

    INHERITED-WINS: File 2 · inherited 4 · effective limit 4

  4. 04
    Reject a string the app cannot use

    The file contains many instead of a bounded integer. The file parser accepts text, but our startup check refuses it. The diagnostic names the expected shape without echoing the rejected value.

    INVALID-STRING: Application validation fails · no client created · exit 2

  5. 05
    Edit the file while a process is running

    The driver changes the file from 2 to 5. The existing process still reads 2 from its environment, even when asked again. A newly launched process loads 5. This program has no reload mechanism; other systems may implement one explicitly.

    FILE-EDIT: Same process 2 → 2 · new process 5

  6. 06
    Change one child’s environment

    A child begins with inherited limit 3, then sets its own value to 5. A later sibling launched with the parent's unchanged settings still sees 3. The child did not reconfigure the parent or a deployment.

    CHILD-CHANGE: Child 3 → 5 · next sibling 3

Read the connections in plain English
  1. 01
    Configuration file → Running process

    --env-file loads this fixture before the program runs.

  2. 02
    Launch environment → Running process

    For Node's --env-file, an inherited value wins over the same name in the file.

  3. 03
    Running process → Startup check

    Read only the required names, then validate their types and allowed range.

  4. 04
    Startup check → Safe diagnostic

    Presence is observable without publishing a credential value.

Check your understanding: The configuration file says 2, but the app reports 4. What evidence would you ask for?

Identify the running process, launch settings, exact loading command and loader precedence. Inspect the allowlisted effective limit and required-setting presence. Do not request a credential value or a dump of the entire environment.

3. Predict and run six local cases

Download fde-configuration-lab.mjs into a new folder. Use Node.js 24 and an ordinary local terminal. The script creates one temporary folder, writes its own .env.demo, launches only its own worker and removes that folder afterward. Existing files, shell settings and deployment settings are unchanged. Children receive an explicit lab environment, not the parent terminal's environment. The temporary file uses owner-only permissions where the operating system supports them; this is still a teaching fixture, not a production secret store.

Code example
node --version
node fde-configuration-lab.mjs

Before running, predict each result. The JSON report is the actual output of local child processes, not expected-output text printed as though it were observed. Cases intentionally stop on missing or invalid settings; exit code 2 is this example's startup refusal. The overall command exits successfully when it completes the experiment, including those refusals.

CaseWhat changesPredict before running
not-loadedThe file exists, but plain Node starts without --env-fileDoes the process have the required variables?
file-loadedThe launcher includes --env-fileWhat type does the limit have before conversion?
inherited-winsThe file says 2; the launcher supplies 4Which limit does the process actually use?
invalid-stringThe file contains a word instead of a bounded integerDoes loading the file make the app ready?
file-editA process starts with 2; the driver changes the file to 5 while it stays aliveWhat does the existing process see? What does a new process see?
child-changeA child starts with 3, then changes its own variable to 5What does the next sibling receive from the unchanged launcher?

Read inspectConfiguration first. It is the application rule. Then locate the env option passed to each child process and the --env-file argument. The script uses the current Node executable directly; it does not ask a shell to expand a command. The file-edit case uses a local inter-process message to coordinate when to reread the existing process environment. That message is a timing signal, not a file reload.

4. Compare the observations with your predictions

not-loaded: the process reports missing credential and invalid/missing limit, then exits 2. The nearby file did not load itself. file-loaded: input type is string, the validated limit is number 2, credential presence is true and exit is 0. Those are the startup conditions this app checks.

inherited-wins: the effective limit is 4, despite the file's 2. Diagnose the launch environment and its precedence before editing the same file repeatedly. invalid-string: the parser accepts text, while the application stops with maxAttempts: null. The diagnostic gives a fixed rule rather than copying an untrusted or potentially sensitive value into logs.

file-edit: the first process reports 2 before and after the driver edits the file. A newly launched process reports 5. This program does not reread the file after startup. Some applications implement reloads or watch configuration stores; those mechanisms need their own consistency, validation and failure behavior.

child-change: one child's own environment changes from 3 to 5. The next sibling reports 3. Neither the parent's launch dictionary nor the file was modified by that child change. A process-local assignment does not reconfigure every process or update a cloud deployment.

These observations establish behavior of this local program on the recorded Node version. They do not test a cloud secret manager, credential rotation, a framework's client bundling, provider authentication or multiple production replicas. Keep those receiving checks separate from the evidence this lab supplies.

5. Change one cause at a time

Make two independent copies of the downloaded file. Never edit the generated credential or add a real one.

In the first copy, change INHERIT_OVERRIDE = true to INHERIT_OVERRIDE = false. Predict inherited-wins, run the copy and record its effective limit. It should now use 2 from the file because the competing launch value was removed. This explains the cause of the difference; merely changing the diagnostic would not repair it.

In the second copy, start from the original and change INVALID_ATTEMPTS = "many" to INVALID_ATTEMPTS = "3". Run again. The invalid-string case retains its case label but now passes the startup rule with number 3. It is the changed input and actual decision that matter, not the label. Explain why this still says nothing about credential validity.

Keep the original observations beside each changed-copy result. Record the exact constant you changed and one outcome you expected to remain unchanged. Do not combine the changes until you can explain each independently.

6. Hand over configuration without handing over secrets

Create a small configuration card for an application you understand. Name each required setting, its purpose, its owner, where it comes from, which process consumes it and whether a change requires restart or explicit reload. Record types and safe ranges, loader precedence and a missing-setting response. For a credential, record the approved reference or delivery mechanism and a presence check; omit the value.

In a real project, keep sensitive files out of source control and use the organization's approved secret storage and workload identity mechanisms. A .env file is plain text, and placing a value in an environment variable does not make it encrypted or inaccessible. Avoid environment dumps, secrets in command arguments, browser-visible configuration, screenshots and diagnostic exports. An example file can document names with empty placeholders; a public example must not contain a usable credential.

For a deployment, distinguish settings supplied during a build from those supplied to the running service. Some toolchains substitute build-time values into generated browser code. A server credential belongs in a restricted server-side path, not a public browser bundle. Verify your actual framework's behavior and the intended running version; do not assume that changing one console setting updates every existing process.

Explain the fictional incident to a colleague: “The file says two, but this process received four from its launcher. I can show the effective nonsecret limit and whether the required credential is present. I do not need the credential value to diagnose precedence.” Then continue to the SDK lesson and distinguish configuration readiness from the first actual request.

Primary references checked 22 October 2026: Node.js 24 environment variables, process environment and Node's env-file option. The instruction and experiment here are original LockedIn Labs material.

7. Rotate a credential across two local replicas

Optional 30 minutes · Node.js 24 · Standard library · Loopback HTTP. Download the replica rotation companion. It starts an HTTP fixture on 127.0.0.1 at an automatically assigned port and two owned child processes. It generates its own powerless credentials in memory and uses no provider, cloud account, package installation or external network. Never supply a real credential. The command stops its children and local server.

A replica is another running instance of the same application. Each child captures its settings once through a startup IPC message (inter-process communication). Its launch environment is empty; fixture credentials arrive through that owned channel, not the shell environment. The driver can change the reference used for a future launch without changing either existing child. A local verifier checks the actual credential sent in an authorization header; a successful response reports an allowed version label, never the credential value.

Rotation introduces a replacement credential and moves its consumers. Revocation makes the previous credential unacceptable at the service. These are separate operations. This fixture permits a controlled overlap where v1 and v2 both work. That is a teaching contract, not a promise that every provider supports simultaneous credentials. Suspected compromise may require immediate revocation with controlled service interruption; preserving overlap is not an incident-response rule.

Follow the visual before running. Predict both replicas, including the one that has not restarted. A single successful request cannot tell you what every other process loaded.

UNDERSTAND THE SYSTEM

A new reference does not update every replica

Follow two real local child processes through the companion's separately reset cases. Version labels are safe teaching metadata; HTTP responses come from a loopback fixture. These frames explain the experiment and do not perform a rotation.

FOLLOW THE WORK

Watch one example, step by step.

5 authored stepsYou control the pace
01 / EXPLORE THE PARTSControls loading · written explanations below
Direction of information or workReturn / feedback

WHAT THIS PART DOES

Next launch

The driver chooses a credential reference for future launches. An already-running child retains the value captured at startup. The reference label is not the credential itself.

CONNECTED TO
  • Start A: Replica A
  • Start B: Replica B
Read the full worked example
  1. 01
    Change the future reference

    The driver selects v2 for the next launch while both existing replicas still hold v1. Their process identities stay unchanged. Editing a reference is not a reload of live configuration.

    BEFORE REPLACEMENT: Reference v2 · A v1 · B v1

  2. 02
    Observe a partial rollout

    In overlap, the service accepts both versions. Replace A with v2 and keep B running on v1. Both return 200, but acceptedVersion identifies different credentials. Healthy samples do not mean the rollout is finished.

    OVERLAP CASE: A: 200 / v2 · B: 200 / v1

  3. 03
    Revoke before B moves

    Start early-revoke afresh. After replacing only A, remove v1 from the service's accepted set. A still returns 200; the unchanged B returns 401. Recovery replaces B with a process using v2 rather than silently changing B's captured value.

    EARLY-REVOKE CASE: A: 200 / v2 · B: 401

  4. 04
    Move both, then retire

    Return to the overlap case. After B is replaced, observe v2 accepted from both instances, then retire v1 and sample again. A separate request with retired v1 receives 401. These samples prove the fixture's transition, not uninterrupted traffic.

    OVERLAP CASE · FINAL: Both v2 accepted · retired v1 refused

  5. 05
    Separate rollback from credentials

    In a fresh rollback case, an old appRevision label paired with revoked v1 gets 401. Replacing it with the same old label and current v2 succeeds. Both labels use the same worker code: this tests configuration selection, not compatibility of an older binary or schema.

    ROLLBACK CASE: Old app label + current v2 → 200

Read the connections in plain English
  1. 01
    Next launch → Replica A

    A replacement process receives the selected reference at startup; the original instance is stopped.

  2. 02
    Next launch → Replica B

    B changes only when it too is replaced. Updating the driver's future reference alone changes neither existing child's captured configuration.

  3. 03
    Replica A → Local verifier

    The actual credential travels only in a request header to the owned loopback service.

  4. 04
    Replica B → Local verifier

    The service accepts or rejects the value B really uses, independently of A's result.

  5. 05
    Local verifier → Per-replica evidence

    The report retains status and accepted version, without returning or printing the credential.

Check your understanding: A and B both return 200 during overlap. Is it time to revoke v1?

Those status codes alone are insufficient. B may still be using v1. Inspect each running instance's configured version and the service's accepted version, then verify the retirement boundary. The fixture permits overlap; a real service may not. Compromise can require immediate revocation and controlled interruption rather than an overlap window.

8. Compare overlap, early revocation and rollback

Spend five minutes predicting, ten executing and inspecting, and fifteen on independent receiving and the changed-service discussion.

Code example
node --version
node fde-replica-rotation.mjs --all > rotation-results.jsonl
node fde-replica-rotation.mjs --case early-revoke
node fde-replica-rotation.mjs --self-test

Run without Node debug tracing. The companion refuses NODE_DEBUG or NODE_DEBUG_NATIVE settings before generating fixtures so diagnostics stay within its safe output contract.

The output is newline-delimited JSON: read each observation as one record. The three cases start fresh. Do not combine a failed observation from one case with a successful observation from another and describe them as one rollout.

Fresh caseBoundary to inspectObservation to explain
overlapChange the future reference, replace A, then replace B before retiring v1Two 200 responses during the partial rollout still use different versions; after both move, v1 is rejected
early-revokeRetire v1 after replacing only AA returns 200 while the same running B returns 401; replacing B with v2 restores its request
rollbackRestore an old app label after v1 was retiredPairing that label with v1 fails; pairing it with current v2 succeeds

For each observation, compare futureReference and allowedVersions with each replica's instanceId, pid, appRevision, configuredVersion, httpStatus and acceptedVersion. The first two describe driver policy. The configured version describes startup input. The accepted version comes from the verifier matching the credential it received. On 401, there is no accepted version. credentialConfigured: true does not establish acceptance.

Locate the code that supplies each child's environment, captures startup configuration, matches the request header and replaces a process. Find the observation after the future reference changes but before any replacement. Confirm both original instance identities remain and both still use v1. Then inspect A's replacement while B's identity remains unchanged. A rollout command or desired reference is not evidence that every consumer changed.

The app-v1 and app-v2 labels describe the exercise's selected application revision. Both run the same worker implementation. The rollback case proves that credential selection can break or restore this local request; it does not test an older executable, database migration or real SDK's compatibility.

9. Give the receiving engineer a rotation record

Assign a rollout author, credential owner and receiving engineer. The author predicts one case. The receiver chooses another, runs it independently and identifies an observation that would stop retirement. Record each participant's own explanation, help and takeover. Solo completion is self-review.

Text example
Candidate file / revision or digest:
Case / step / my prediction:
Future reference / service's accepted versions:
A instance / app label / configured version / HTTP status / accepted version:
B instance / app label / configured version / HTTP status / accepted version:
Retired-credential probe / observed response:
My contribution / receiving action / assistance:
Retirement or rollback decision / specific evidence gap:
Responsible owner / next check / stop condition:

Keep only the safe fields; never attach headers, credential values, hashes or a whole environment dump. A version label is not a secret fingerprint or proof of the real deployed artifact. The credential owner defines issuance, overlap, revocation and compromise behavior. The application owner defines startup or reload behavior and rollback compatibility. The receiving engineer checks both consumer evidence and service acceptance; a pod lead keeps an unresolved gap assigned instead of treating command success as client readiness.

10. Change the receiving contract

Now assume the real service allows only one active credential. Explain why this lab's overlap sequence no longer applies. Name the coordinated cutover or workload-identity design to investigate, its interruption budget and the owner who can approve it. Do not implement the fixture's two-key policy in a provider that does not support it.

Then assume there are background workers, cached connection pools and a consumer that was offline during rotation. List the consumers missing from the two-replica report. Define how the receiving team would discover them and test their next connection. A request that passed once does not prove continuous availability, least privilege, downstream business correctness or completion across a fleet.

Finally, identify the actual previous application artifact and the current credential delivery mechanism before proposing rollback. Retain the revocation boundary; restoring a compromised or retired credential is not a rollback plan. Test binary, schema and service compatibility separately. This local exercise has no TLS, provider identity system, secret manager, workload discovery, production traffic or readiness routing.

The scenario, code and visual are original. Kubernetes secret delivery and OWASP secret lifecycle guidance, checked 26 October 2026, support the distinction between consumer updates and service-side revocation. They are further study, not evidence that this fixture implements Kubernetes or a managed secrets service.

Before you move on

Keep the evidence of your work.

  • Six predictions compared with actual local process results.
  • Two controlled changes separating precedence from validation.
  • A configuration card with owners and update behavior, containing no credential values.

Keep these in your own working copy. Reading this page does not save work or record completion.

Suggested next free session

SDK 101: follow your first client call

Use the configuration contract to understand what a client SDK does at the next boundary. This is a suggested sequence; choose the practice that addresses your current gap.

Open the next free guide

Free account

Give your practice a home.

Try a role exercise with account drafts and a downloadable worksheet. Keep the files you made in this guide in your own working copy.

Create a free learning account

Guided training · by application

Build toward a program.

Request structured lessons and a training seat. Scope, schedule, feedback arrangements and tuition are confirmed in writing before you commit.

Explore a training application
Have Academy access?

Use your existing training seat to open worked explanations and practice in the related lesson. Creating a free account does not grant a seat.

Open the related Academy lesson →
Back to top ↑