Skip to content

SecureRandom.javaSecuritySecureRandom for two effect types #4338

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

Open
wants to merge 3 commits into
base: series/3.x
Choose a base branch
from

Conversation

dpevunov-cp
Copy link

Im not sure this is the right and idiomatic way to implement this, but this greatly helps in real app wiring when you have to create instance for some effect G(for example ConnectioIO) when the wiring is done in F(IO for example)

This is my first PR here, please let me know if this should be done somehow differently

@dpevunov-cp dpevunov-cp force-pushed the series/3.x-secure-random-fg branch from 4289911 to b44494d Compare April 2, 2025 08:22
@dpevunov-cp
Copy link
Author

dpevunov-cp commented Apr 2, 2025

@armanbilge @djspiewak Could you have a look please?

Copy link
Contributor

@BalmungSan BalmungSan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpevunov-cp
Copy link
Author

Maybe add some docs to both versions? Similar to Ref.in, also I think that in name is semi standard for this kind of F & G

I have added docs. But thinking of .in Im not sure it fits here moreover it would be incompatible and need to release in new MINOR version. I would like to have it in new PATCH

@dpevunov-cp dpevunov-cp force-pushed the series/3.x-secure-random-fg branch from 08fb6b3 to ce4325a Compare April 8, 2025 15:11
@armanbilge armanbilge added this to the v3.7.0 milestone Apr 8, 2025
@dpevunov-cp dpevunov-cp force-pushed the series/3.x-secure-random-fg branch from ce4325a to 4bcd1a4 Compare April 8, 2025 15:19
@armanbilge
Copy link
Member

it would be incompatible and need to release in new MINOR version. I would like to have it in new PATCH

Unfortunately, adding a new API always breaks forward compatibility, no matter what it's called. We won't be able to get this into a patch, but I've added it to the milestone for the next minor.


Similar to Ref.in, also I think that in name is semi standard for this kind of F & G API

Yes, this is a good point. Let's follow this convention.

@armanbilge
Copy link
Member

armanbilge commented Apr 8, 2025

but this greatly helps in real app wiring when you have to create instance for some effect G(for example ConnectioIO) when the wiring is done in F(IO for example)

Btw, there is probably a workaround: create a SecureRandom in ConnectionIO and then mapK it to IO (or vice versa).

@geny200
Copy link
Contributor

geny200 commented May 23, 2025

@dpevunov-cp Do you mind if I take PR and finish it? (as a part of the #4410 )

@dpevunov-cp
Copy link
Author

@dpevunov-cp Do you mind if I take PR and finish it? (as a part of the #4410 )

I don't mind but I can try to update PR today

@dpevunov-cp
Copy link
Author

@dpevunov-cp Do you mind if I take PR and finish it? (as a part of the #4410 )

@geny200 I have updated PR but for some reason some ci build tasks failed and I could not reproduce it locally. Could you take a look please?

@geny200
Copy link
Contributor

geny200 commented May 27, 2025

I tried to reproduce it, and and I couldn't either. It looks like a flaky test to me, because this functionality has nothing to do with your changes.

Failed job - https://github.com/typelevel/cats-effect/actions/runs/15239205886/job/42857139080?pr=4338
Failed test - cats.effect.std.SupervisorSuite.async - restart / cancel race
Error - java.util.concurrent.TimeoutException: test timed out after 20 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants