-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session retains credentials when disk full #5056
base: main
Are you sure you want to change the base?
Conversation
...re/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt
Outdated
Show resolved
Hide resolved
...re/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt
Outdated
Show resolved
Hide resolved
Qodana Community for JVM2 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
clientRegistrationCache(ssoRegion).tryDeleteIfExists() | ||
} | ||
|
||
override fun loadClientRegistration(cacheKey: ClientRegistrationCacheKey): ClientRegistration? { | ||
LOG.debug { "loadClientRegistration for $cacheKey" } | ||
val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists() | ||
val cacheFile = clientRegistrationCache(cacheKey) | ||
// try InMemoryCacheFirst in case of stale registration on full disk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the disk be the source of truth?
consider the case where multiple different JetBrains IDE instances are running
Types of changes
Description
Implemented an in-memory caching mechanism as a fallback when disk space is full
-Add InMemoryCache object to store credentials as ByteArrays
-Update writeKey to store data in memory if disk write fails due to space constraints
-Modify load functions to check in-memory cache is file read fails
-Maintain existing error handling and telemetry patterns
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.