style(autoconfig): optimize auto configuration code style#3
Merged
Conversation
cyyever
added a commit
to cyyever/aap-resource-server
that referenced
this pull request
May 25, 2026
Mark hot spots alibaba#2-5 done. alibaba#2 (WptValidator.convertToJWK cache) was already in place when the doc was last updated — corrected. alibaba#3 (JWKS) had TTL + single-flight + not-found throttle already; only the SWR addition landed this session. alibaba#4 and alibaba#5 are this session's work. Only the M1-renames-pending items remain in the list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cyyever
added a commit
to cyyever/aap-resource-server
that referenced
this pull request
May 25, 2026
… → CT/DPoP Lands the rename half of M1 alibaba#3 (DPoP semantic claims htm/htu/iat/jti/ath deferred). Aligns the codebase with the AAP spec's wire-message vocabulary: two wire messages CT (credential token) and DPoP (proof of possession). Package + class renames (git mv preserves history): - protocol/wimse/wit/ → protocol/ct/ - protocol/wimse/wpt/ → protocol/dpop/ - WitParser → CtParser - WitValidator → CtValidator - WptParser → DpopParser - WptValidator → DpopValidator - WorkloadIdentityToken → CredentialToken - WorkloadProofToken → DpopToken - Empty protocol/wimse parent dir removed. Identifier + wire-format updates: - JOSE typ values: "wit+jwt" → "ct+jwt", "wpt+jwt" → "dpop+jwt" - DefaultResourceServer log/error strings: WIT/WPT → CT/DPoP - ResourceRequest fields + JSON properties: wit/wpt → ct/dpop (and getWit/getWpt → getCt/getDpop, builder methods .wit()/.wpt() → .ct()/.dpop()). - Internal var/method renames: witParser→ctParser, wptValidator→ dpopValidator, buildWorkloadIdentityToken→buildCredentialToken, etc. wimse:// URI scheme stripped: - TrustDomain: dropped getDomainName() + the startsWith("wimse://") prefix-strip. The class now stores domainId verbatim and compares it against the iss claim as-is — no scheme is implied. - TrustDomainTest: dropped getDomainName test nest, fixture switched from "wimse://example.com" to "example.com". - All protocol test fixtures: wimse://example.com → example.com. KEY_WIT_VERIFICATION + Workload-Identity-Token HTTP header from CLAUDE.md's M1 alibaba#3 list were already gone in earlier trims. mvn -B test: 290 / 290 pass (was 293; -3 deleted getDomainName tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cyyever
added a commit
to cyyever/aap-resource-server
that referenced
this pull request
May 25, 2026
Sweep matching the post-rename / post-trim state of the repo. No code
changes — javadoc and prose only.
CLAUDE.md:
- "trim phase is mostly done" → "trim phase is done"; record that
M1 alibaba#1–alibaba#3 (alg=EdDSA lock, JOSE header whitelist, CT/DPoP rename)
have landed; remaining work is the M1 retrofit tail.
- Mark items 1, 2, 3 in the M1 list as done with their commits.
- Drop the "After M1, also rename" list entries that have shipped
(package rename, class renames, KEY_WIT_VERIFICATION).
- Update perf hot spots wording for accuracy (no stale class refs).
READMEs (en + zh-CN):
- Reference the new ai.shao.openagentauth.core.server.* package path.
- Drop "WIT/WPT" references in favour of CT/DPoP wherever they
described the current code (kept upstream-WIMSE-history context).
In-source javadoc:
- Strip @SInCE 1.0 tags throughout — bit-rot during the trim, no
consumers track @SInCE here.
- Drop the "Workload" / WIT-era language where it described current
types: DpopToken talks about CT (not WIT); CtValidator talks about
Credential Tokens; ResourceServer's @OverRide javadoc references
CT/DPoP.
- Update @link / @see references that pointed at removed types.
mvn -B test: 293 / 293 pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cyyever
added a commit
to cyyever/aap-resource-server
that referenced
this pull request
May 25, 2026
Reframe the project description around what it IS (the RP-side Java reference implementation of AAP) rather than what it WAS (a fork baseline being trimmed). Both en + zh-CN. - Title: "Open Agent Auth — AAP fork baseline" → "AAP Resource Server (Java)". - Lead paragraph describes the actual surface — parses + verifies CT and DPoP, returns a typed TokenValidationResult ADT. - Scope section keeps the spec's hard rules verbatim (EdDSA, two wire messages, JOSE header whitelist, HTTPS-only, no AuthZ/OIDC/X.509/VC). - Module section drops the "Spring Boot was removed" framing — that context belongs in git history, not the README. - New "Build & quality gates" section documents the four mvn profiles + their current state (293/293, 0 NullAway, 0 SpotBugs) so contributors see at a glance what runs on each push. - Status section refreshed: M1 alibaba#1–alibaba#3 marked done; M1 tail re-scoped to ~330–390 LoC (post spec v0.9.4/v0.9.5) with the actual remaining items (DPoP claims, keyset+trust-set, CRL, PIC, blacklist, JSONL, HTTP header enforcer). - License footer unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Description
Optimize code readability across AutoConfiguration classes by applying the Facade pattern to
OpenAgentAuthProperties, reducing deeply nested chain calls (4-6 levels) to simple one-level convenience method calls. This follows the Law of Demeter (Least Knowledge Principle) and keeps all lines within the 120-character best practice.Additionally, this PR fixes the CI test report summary trimming warning, removes the noisy auto-update coverage badge mechanism, and fixes incorrect build status badge links in README.
Type of Change
Changes Made
Code Refactoring — Convenience Methods on
OpenAgentAuthPropertiesAdded 7 Facade-style convenience methods to
OpenAgentAuthPropertiesto eliminate repetitive deep chain calls:getTrustDomain()getInfrastructures().getTrustDomain()getKeyDefinition(name)getInfrastructures().getKeyManagement().getKeys().get(name)getServiceDefinition(name)getInfrastructures().getServiceDiscovery().getServices().get(name)getServiceUrl(name)getInfrastructures().getServiceDiscovery().getServices().get(name).getBaseUrl()getJwksConsumer(name)getInfrastructures().getJwks().getConsumers().get(name)getRole(name)getRoles().get(name)getRoleIssuer(name)getRoles().get(name).getIssuer()(with null safety)Refactored 10 source files (70+ call sites):
CoreAutoConfiguration.javaAgentAutoConfiguration.javaAgentIdpAutoConfiguration.javaAuthorizationServerAutoConfiguration.javaResourceServerAutoConfiguration.javaJweEncryptionAutoConfiguration.javaSharedCapabilityAutoConfiguration.javaDiscoveryController.javaOaaConfigurationController.javaRoleAwareEnvironmentPostProcessor.javaCI Improvements
only-summary: 'true'andlist-tests: 'failed'todorny/test-reporter@v1to resolve the "Test report summary exceeded limit of 65535 bytes" warningchore: update coverage badgecommits on every push to mainDocumentation
README.mdandREADME.zh-CN.mdTest Fixes
AuthorizationServerAutoConfigurationTest: Updated assertion to match the refined error message"AS User IDP issuer configuration not found"(more precise than the previous"AS User IDP configuration not found")DiscoveryControllerTest: Updated all 11 test methods to stubproperties.getRole()convenience method instead of manipulatingproperties.getRoles()map directly, aligning with the refactoredDiscoveryControllerTesting
Test Instructions:
Checklist
Breaking Changes
No breaking changes. All modifications are internal refactoring — the public API and configuration schema remain unchanged.
Additional Context
Design Rationale
This refactoring applies the Facade pattern from GoF to
OpenAgentAuthProperties:getServiceUrl()returnsnullinstead of throwing NPE when the service is not configured)Files Changed Summary
Net reduction of 44 lines while improving readability across the codebase.