Skip to content

Cache parsed RSA key objects in UaaVerificationKeys#5272

Merged
johha merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix/rsa-object-creation
Jul 8, 2026
Merged

Cache parsed RSA key objects in UaaVerificationKeys#5272
johha merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix/rsa-object-creation

Conversation

@serdarozerr

Copy link
Copy Markdown
Contributor

Previously, format_keys stored raw PEM strings. On every request, CF::UAA::TokenCoder.new(pkey: pem_string) re-parsed the RSA key via OpenSSL::PKey::RSA#initialize, consuming ~25% CPU under load.

Parse the RSA key once when keys are fetched from UAA (every 30s) and cache the OpenSSL::PKey::RSA object directly.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Previously, `format_keys` stored raw PEM strings. On every request,
`CF::UAA::TokenCoder.new(pkey: pem_string)` re-parsed the RSA key via
`OpenSSL::PKey::RSA#initialize`, consuming ~25% CPU under load.

Parse the RSA key once when keys are fetched from UAA (every 30s) and
cache the `OpenSSL::PKey::RSA` object directly.

@johha johha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@johha johha merged commit 13faf2a into cloudfoundry:main Jul 8, 2026
11 checks passed
@johha johha deleted the fix/rsa-object-creation branch July 8, 2026 16:31
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jul 8, 2026
Changes in cloud_controller_ng:

- Cache parsed RSA key objects in UaaVerificationKeys
    PR: cloudfoundry/cloud_controller_ng#5272
    Author: serdar özer <serdar.oezer@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants