File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class DiskCache(
101101 clientRegistrationCache(ssoRegion).tryDeleteIfExists()
102102 }
103103
104- override fun loadClientRegistration (cacheKey : ClientRegistrationCacheKey ): ClientRegistration ? {
104+ override fun loadClientRegistration (cacheKey : ClientRegistrationCacheKey , source : String ): ClientRegistration ? {
105105 LOG .info { " loadClientRegistration for $cacheKey " }
106106 val inputStream = clientRegistrationCache(cacheKey).tryInputStreamIfExists()
107107 if (inputStream == null ) {
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ class SsoAccessTokenProvider(
194194
195195 @Deprecated(" Device authorization grant flow is deprecated" )
196196 private fun registerDAGClient (): ClientRegistration {
197- loadDagClientRegistration()?.let {
197+ loadDagClientRegistration(SourceOf )?.let {
198198 return it
199199 }
200200
@@ -505,6 +505,11 @@ class SsoAccessTokenProvider(
505505 }
506506 }
507507
508+ enum class SourceOfLoadRegistration {
509+ REGISTER_CLIENT ,
510+ REFRESH_TOKEN ,
511+ }
512+
508513 private enum class RefreshCredentialStage {
509514 VALIDATE_REFRESH_TOKEN ,
510515 LOAD_REGISTRATION ,
@@ -514,13 +519,13 @@ class SsoAccessTokenProvider(
514519 SAVE_TOKEN ,
515520 }
516521
517- private fun loadDagClientRegistration (): ClientRegistration ? =
518- cache.loadClientRegistration(dagClientRegistrationCacheKey)?.let {
522+ private fun loadDagClientRegistration (source : String ): ClientRegistration ? =
523+ cache.loadClientRegistration(dagClientRegistrationCacheKey, source )?.let {
519524 return it
520525 }
521526
522- private fun loadPkceClientRegistration (): PKCEClientRegistration ? =
523- cache.loadClientRegistration(pkceClientRegistrationCacheKey)?.let {
527+ private fun loadPkceClientRegistration (source : String ): PKCEClientRegistration ? =
528+ cache.loadClientRegistration(pkceClientRegistrationCacheKey, source )?.let {
524529 return it as PKCEClientRegistration
525530 }
526531
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ interface SsoCache {
77 fun invalidateClientRegistration (ssoRegion : String )
88 fun invalidateAccessToken (ssoUrl : String )
99
10- fun loadClientRegistration (cacheKey : ClientRegistrationCacheKey ): ClientRegistration ?
10+ fun loadClientRegistration (cacheKey : ClientRegistrationCacheKey , source : String ): ClientRegistration ?
1111 fun saveClientRegistration (cacheKey : ClientRegistrationCacheKey , registration : ClientRegistration )
1212 fun invalidateClientRegistration (cacheKey : ClientRegistrationCacheKey )
1313
You can’t perform that action at this time.
0 commit comments