-
Notifications
You must be signed in to change notification settings - Fork 21
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
[#IP-339] Migrate fp-ts version from 1.x to 2.x #87
Conversation
* [#174991105] Upgrade passport-saml dependency to v1.3.5 * [#174991105] Update README, tip for errors on cached containers Co-authored-by: Emanuele De Cupis <[email protected]>
…pi/io-spid-commons into IP-339--migrate-fp-ts
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.
fp-ts
-related changes look good to me. I advocate we move unrelated changes into dedicated PRs for better discussion and review.
@balanza @fabriziopapi Seems that some changes in this PR are already included into the master branch. Maybe a merge/rebase github issue. For example the update of |
I already rebased the branch: this is why passport-saml related code is in the branch. Unluckily, I had to manual resolve conflict and commit the resolutions. |
@fabriziopapi You're right, such changes are from #60. Fun fact: I've approved them 😅. that's weird: why is it considered a change? |
Replaced by PR #91 |
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.
Sorry I've these pending comments. I'll move all the newer comments on the PR #91
TE.fromEither( | ||
E.fromOption( | ||
() => | ||
new Error( | ||
`SAML#ExtendedRedisCacheProvider: missing AuthnRequest ID` | ||
) | ||
)(getIDFromRequest(RequestXML)) | ||
), |
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.
We can use the more compact TE.fromOption
TE.fromEither( | |
E.fromOption( | |
() => | |
new Error( | |
`SAML#ExtendedRedisCacheProvider: missing AuthnRequest ID` | |
) | |
)(getIDFromRequest(RequestXML)) | |
), | |
TE.fromOption( | |
() => | |
new Error( | |
`SAML#ExtendedRedisCacheProvider: missing AuthnRequest ID` | |
) | |
)(getIDFromRequest(RequestXML)), |
TE.chain(value => | ||
TE.fromEither( | ||
pipe( | ||
E.parseJSON(value, E.toError), |
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.
use parse
from fp-ts/lib/Json
instead, E.parseJson
is deprecated
E.parseJSON(value, E.toError), | |
parse(value), | |
E.mapLeft(E.toError), |
import { TaskEither } from "fp-ts/lib/TaskEither"; | ||
import * as TE from "fp-ts/lib/TaskEither"; |
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.
Duplicated import, use TE.TaskEither
Update fp-ts version from 1.x to 2.x
List of Changes
Update fp-ts, io-ts, ts-commons and openapigen versions.
Fixed compilation errors due to different fp-ts 2.x version mode.
Fixed unit test compilation errors.
Refactor of saml.ts functions.
Motivation and Context
Reduce technical debt and enable dev to use new fp-ts feature.
How Has This Been Tested?
Already existing unit tests.
Types of changes
Checklist: