-
Notifications
You must be signed in to change notification settings - Fork 16
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
Move caching stuff off the IAccessTokenProvider API into the factory #373
Conversation
|
||
return new CachedAccessTokenProvider( noCacheTokenProvider, authEndpoint, Timeout.InfiniteTimeSpan ); | ||
return new CachedAccessTokenProvider( new NullCache(), noCacheTokenProvider, authEndpoint, Timeout.InfiniteTimeSpan ); |
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.
tests
) { | ||
if( inner != null && cache == null ) { | ||
throw new InvalidOperationException( "If you provide an inner you need to also provide its cache" ); |
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.
The idea here is that this factory is either for wrapping your IAccessTokenProvider in our caching layer (for which you provide an ICache for us to use) or for using our jwt-bearer-grant based impl with or without caching.
The reason I'm doing this is I want to implement an IamGrant IAccessTokenProvider impl. I want to do that inside the LMS because I'd really like to use the LMS Lambda framework. It would make sense to implement it in this library, and I mean you could at least define the input/output here, but meh.
/// check for token expiration or grace period because the | ||
/// <see cref="IAccessTokenProvider"/> will handle it internally.</param> | ||
/// <returns>An access token containing an expiry and the provided claims and scopes.</returns> | ||
[GenerateSync] | ||
Task<IAccessToken> ProvisionAccessTokenAsync( | ||
IEnumerable<Claim> claims, | ||
IEnumerable<Scope> scopes, | ||
ICache cache = null | ||
IEnumerable<Scope> scopes |
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.
Consolidating on one interface, equivalent to the old non-caching one, and taking the cache inside the factory+constructor.
The LMS cache is instantiated each call but it can be safely cached.
I jumped the gun on bumping the version after the previous PR... on auto-pilot. |
No description provided.