Skip to content

Add AuthzClientCryptoProvider for authorization client cryptographic operations - #8

Open
ShashankFC wants to merge 1 commit into
feature-authz-crypto-baselinefrom
feature-authz-crypto-implementation
Open

Add AuthzClientCryptoProvider for authorization client cryptographic operations#8
ShashankFC wants to merge 1 commit into
feature-authz-crypto-baselinefrom
feature-authz-crypto-implementation

Conversation

@ShashankFC

@ShashankFC ShashankFC commented Jan 22, 2026

Copy link
Copy Markdown

Test 3nnn## Summary by CodeRabbitnn## Release Notesnn* New Featuresn * Enhanced cryptographic support with ECDSA algorithm implementation for authorization client operations.n * Improved crypto provider selection with priority ordering mechanism.nn* Testsn * Added test coverage for ECDSA algorithm variants (ES256, ES384, ES512).nn* Choresn * Added testing framework dependencies.nn✏️ Tip: You can customize this high-level summary in your review settings.nnn---nReplicated from ai-code-review-evaluation/keycloak-coderabbit#3


Note

Medium Risk
Touches shared crypto provider discovery/selection and adds new signature encoding/decoding logic; failures could impact cryptographic operations at runtime, though changes are relatively contained and backed by targeted tests.

Overview
Adds an AuthzClientCryptoProvider (registered via META-INF/services) and minimal ASN.1 DER encode/decode helpers to support ECDSA signature format conversion (DER ↔ concatenated R/S) in the authz client.

Updates CryptoIntegration/CryptoProvider to allow multiple providers on the classpath by introducing order()-based selection (highest wins) and logging ignored providers, and ensures AuthzClient.create(Configuration) initializes crypto integration. Adds JUnit/Hamcrest test dependencies and a new ECDSAAlgorithmTest covering ES256/ES384/ES512 round-trips.

Written by Cursor Bugbot for commit b95d12a. Configure here.

…tory

closes #33831

Signed-off-by: mposolda <mposolda@gmail.com>
@ShashankFC

Copy link
Copy Markdown
Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

BigInteger sBigInteger = new BigInteger(s);

ASN1Encoder.create().write(rBigInteger);
ASN1Encoder.create().write(sBigInteger);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code: unused ASN1Encoder instances in conversion method

Low Severity

Two ASN1Encoder.create().write(...) calls in concatenatedRSToASN1DER create encoder instances, write rBigInteger and sBigInteger to them, then immediately discard the results. The actual encoding happens in the return statement below. These appear to be leftover from an earlier implementation and are dead code that performs unnecessary allocations and I/O.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants