-
Notifications
You must be signed in to change notification settings - Fork 3
feat: local-session-token-storage-modules #229
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
Conversation
|
View your CI Pipeline Execution ↗ for commit 44f4b9e.
☁️ Nx Cloud last updated this comment at |
05fd6f1
to
983a555
Compare
ported over many features of the SDK, and did a best effort to maintain API surface.
initial implementation of local,session, and token storage to port from old SDK into effects style patterns
Deployed c98d503 to https://ForgeRock.github.io/ping-javascript-sdk/pr-229/c98d5036c5b68dcd5f4634bfe370d69cb0dfa117 branch gh-pages in ForgeRock/ping-javascript-sdk |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## effects-package #229 +/- ##
================================================
Coverage 47.35% 47.35%
================================================
Files 29 29
Lines 1472 1472
Branches 148 148
================================================
Hits 697 697
Misses 775 775 🚀 New features to boost your workflow:
|
tokenStore: TokenStoreObject, | ||
): Promise<Tokens | TokensError>; | ||
export async function getTokens(config: ConfigOptions): Promise<Tokens | TokensError>; | ||
export async function getTokens( |
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.
So this function is a perfect example of a function coloring problem.
This is because of the optional tokenStore we allow, which basically turns everything here async, even though localStorage and sessionStorage have sync methods.
In the legacy sdk we just turn localStorage and sessionStorage methods to async they really don't need to be
If i'm being honest i'm dying to use effect
for code like this because it solves this problem (and a million others).
I think effect
would work within the effects
(haha) package and probably would be used in utilities as well.
The only outlier here is that I think we would need to use effect
within the *-client folders for the run*
methods to actually run the effect.
effect
(the package) also fits exactly into the architecture design of calling "effects" at the edge (hence run*
methods).
Note: I have not considered the use case of this code outside of using the client, so we would probably need to have a wrapper around this code in this concept, if effects
itself was to be installed by a consumer and used directly.
JIRA Ticket
https://pingidentity.atlassian.net/browse/SDKS-3903 (has no details though)
Description
Took some liberties here, feel free to critique if this was not the direction we were thinking. there's a lot in here though in terms of how I went about errors, and I used function overloading for typing the functions since they can have two valid signatures which is obviously a different take than usual.
Open to changes