Repository navigation
feat: the OAuth2 client file of an application folder follows the key set rule - #1364
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A pull of applications wrote the key set of the OAuth2 client of an application (
signEncOAuth2ClientConfig.jwkSet) intooauth2-client.jsonas 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 wayAPP_<NAME>_CLIENT_SECRETis 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
src/ops/ApplicationConfigOps.ts):clientFilecalls 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 applicationspulls the application again, so it follows the same rule.readApplicationFolderreadsoauth2-client.jsonwithreadAgentFileof 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).redactKeySetstakes 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_2from that variable.pull applicationsandpush applicationsname the placeholder (sentences insrc/utils/PlaceholderValues.ts); the two-hsnapshots changed, and each diff is only the added sentence.proposed, so edited, not superseded): the application folder is in "Every writer",applies-toandissueslist 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)
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).Verification
npx tsc --noEmitexit 0;npm run checkexit 0 (0 errors, the 8 warnings ofmain, none in a changed file); Prettier clean on the changed tests.npm run test:guidance: 699 passed, exit 0.git statusclean afterwards; the master key file that the suite creates (it is ignored by git) was deleted.-Eas 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 ofredactKeySets.AgentKeySetsrun, then reverted;git statusclean 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 inKEYSET11; 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 isappkey-mutate.pyin the maintainer's scratch folder, not in the repository.-hsnapshots: 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 applicationsandpush applicationswith a private key set in the client of an application is the maintainer's, with the recordings task of #1177.🤖 Generated with Claude Code