Skip to content

feat: the OAuth2 client file of an application folder follows the key set rule - #1364

Merged
vscheuber merged 1 commit into
mainfrom
feat/app-folder-key-set-placeholder
Nov 17, 2026
Merged

vscheuber merged 1 commit into
mainfrom
feat/app-folder-key-set-placeholder

Conversation

@vscheuber

Copy link
Copy Markdown
Contributor

Summary

A pull of applications wrote the key set of the OAuth2 client of an application (signEncOAuth2ClientConfig.jwkSet) into oauth2-client.json as it was, also when it holds a private or a symmetric key. The other config-manager pulls that write a key set replace such a key set since #1362. This applies the same rule to the application folder, with the variable name the maintainer chose in conversation: APP_<NAME>_JWKSET, made the way APP_<NAME>_CLIENT_SECRET is made (the name of the application in upper case, every run of other characters as one underscore). It applies core 0013, secrets are never exported in the clear.

Closes #1363.

What changes

  • Pull (src/ops/ApplicationConfigOps.ts): clientFile calls the function of feat: a config-manager pull replaces a key set with private key material by a placeholder #1362 (redactKeySets, src/ops/AgentKeySets.ts), so there is one rule for the test of the key material. A key set with a private or symmetric JWK member (d, p, q, dp, dq, qi, oth, k) is replaced as a whole by ${APP_<NAME>_JWKSET}; a key set with public keys only is written as before. The secret of a confidential client keeps ${APP_<NAME>_CLIENT_SECRET}. One warning per application names the application, the realm, the property and the variable and never prints a key part; it is not a failure and changes no exit code. The key set is not counted as a left-out property in the verbose output of record 0054. migrate applications pulls the application again, so it follows the same rule.
  • Push: readApplicationFolder reads oauth2-client.json with readAgentFile of feat: a config-manager pull replaces a key set with private key material by a placeholder #1362: the variable holds the key set as JSON text and is put into the string of the file correctly, a value somebody escaped by hand still works, and the values of the library's state are put back. A variable without a value fails that application as before (the summary names the variable, nothing is sent for it, the placeholder is never stored).
  • redactKeySets takes an optional third argument, the variable of the first key set, so that a kind with its own naming can choose it. Without it nothing changes (the id of the object names the variable). A second key set of one object gets _2 from that variable.
  • Help: pull applications and push applications name the placeholder (sentences in src/utils/PlaceholderValues.ts); the two -h snapshots changed, and each diff is only the added sentence.
  • Docs: decision record 0055 (still proposed, so edited, not superseded): the application folder is in "Every writer", applies-to and issues list it, "Not covered" is gone, and the consequence for two applications with names that make the same variable is added; the index row follows. MIGRATION.md has an entry next to the one of feat: a config-manager pull replaces a key set with private key material by a placeholder #1362.

Decisions taken (maintainer: change on review)

  • The warning calls the object "OAuth2 client of application" and names the application (not the id of the client), because the variable is named after the application.
  • The two variables that are named after the application (APP_<NAME>_CLIENT_SECRET, APP_<NAME>_JWKSET) share one function for the name part (variablePartOf), so they cannot drift apart. The behaviour of the secret variable is unchanged (its test table is untouched).
  • Two applications whose names make the same variable (they differ in case or in the characters that become an underscore) share it, as they already do for the secret. The record says so.

Verification

  • npx tsc --noEmit exit 0; npm run check exit 0 (0 errors, the 8 warnings of main, none in a changed file); Prettier clean on the changed tests.
  • Whole suite after the last commit, with a fresh temporary HOME and the dist rebuilt: 1105 suites passed, 10 skipped; 10,880 tests passed, 149 skipped; 10,293 snapshots passed; exit 0. npm run test:guidance: 699 passed, exit 0. git status clean afterwards; the master key file that the suite creates (it is ignored by git) was deleted.
  • New tests: 10 for the pull (private RSA key set as AM stores it, a symmetric one, public only, one private key among public ones, no key set, a null key set, a public client, a name that needs the underscore rule, the verbose left-out count, a second pull gives the same file, and the exact warning text; no key part in the file or in anything printed), 5 for the push (the key set from the process environment and from -E as JSON text with its quotes, a value escaped by hand, a variable without a value fails that application and names it, a public key set, a variable that is not a JSON object), 1 pull-then-push round trip (no key in the tree, the same key set in what the client import receives, the state of the library as it was), 2 for the name of the variable, 2 for the optional argument of redactKeySets.
  • Negative proofs (one production change at a time, the tests of the application kind and of AgentKeySets run, then reverted; git status clean after all): the pull does not replace the key set 7 failed; the pull does not warn 1; the application variable not passed on 6; the variable ends in KEYSET 11; the name not normalised 9; the push reads without the key set fill 3; the module ignores the variable it is asked for 7; a second key set shares the first variable 2; the pull help without the sentence 1; the push help without the sentence 1. All ten failed the tests. The script is appkey-mutate.py in the maintainer's scratch folder, not in the repository.
  • -h snapshots: the two of the application commands, every diff is the added sentence.

Not covered

No tenant was contacted and no recording was made: the unit tests use a fake library with the real files, the same technique as the application tests next to them. A live check of pull applications and push applications with a private key set in the client of an application is the maintainer's, with the recordings task of #1177.

🤖 Generated with Claude Code

… set rule

A pull of applications replaces a key set of the OAuth2 client that holds
a private or a symmetric key with ${APP_<NAME>_JWKSET} and says so in one
warning that never prints the key; a push fills the placeholder from the
variable as JSON text. The name is made like the one of APP_<NAME>_CLIENT_SECRET.
The rule is the function of decision record 0055, which gets an optional
variable name for this. The record, the help of the two commands and
MIGRATION.md say so.

Refs #1363

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vscheuber vscheuber added the no-auto-processing Concierge never touches this item; remove the label to hand it over label Nov 17, 2026
@vscheuber
vscheuber merged commit 524dd16 into main Nov 17, 2026
23 checks passed
@vscheuber
vscheuber deleted the feat/app-folder-key-set-placeholder branch November 17, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-auto-processing Concierge never touches this item; remove the label to hand it over

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config-manager: the application folder's OAuth2 client file must not hold a private key set

1 participant