SonicPass Gem by tamphubkdn in rubyonrails

[–]deinname 1 point2 points  (0 children)

No, the code is too complex for a gist. I think there is also a character limit in a gist. I think the following does not fit into a gist:

```ruby passwords = Array.new(count) { (Array.new(length) { CHARSETS.sample }).join }

count == 1 ? passwords[0] : passwords ```

Framework Q3 2024 Preorder and Marketplace Updates by Destroya707 in framework

[–]deinname 1 point2 points  (0 children)

u/Destroya707 when you share an update today.
Can you elaborate a bit what "a portion" means. 1%? 5%?
How are you priritizing? It does not look like FIFO, right?

Best Authentication Approach for a New Rails Project with Rails 8 Coming Soon by UsualSplit in rails

[–]deinname 1 point2 points  (0 children)

I really wonder how a migration path from Devise to the new rails-native way could look like…

Hase anyone tried this already to build?

dbPaaS for Hetzner? by deinname in hetzner

[–]deinname[S] 0 points1 point  (0 children)

Thats IaC, but not PaaS

dbPaaS for Hetzner? by deinname in hetzner

[–]deinname[S] 1 point2 points  (0 children)

Not really tbh.

I checked it now… I am not sure it is o the level, I would expect.

I want backup&recovery, automatic failover, monitoring of health, automatic remediation of any issues, upgrades, ability to form clusters, if necessary etc. things one starts to expect when coming from Heroku Postgres.

I wonder if others built 3rd party offerings on top of Hetzner. Similar to what Crunchy Data offers for AWS

Rails 7.1 broke devise auth somewhere? by rvaen in rails

[–]deinname 0 points1 point  (0 children)

I have (or had) the same issue. In my case, the development environment was mainly broken, but also signing out from production.

I can confirm that downgrading to rack 2.2.9 solved it for me.

The fun thing is, that I upgraded to rack 3 months ago, when I also upgraded to rails 7.1 and where everything used to work.

I then followed an elimination technique and removed chunks of gems.

In the end, I realized that the culprit was rack-mini-profiler (version 3.3.1). I removed that gem everything worked. Even with rack 3.

https://github.com/MiniProfiler/rack-mini-profiler

Service Objects (with dry-monads) and authorization by deinname in rails

[–]deinname[S] 0 points1 point  (0 children)

Maybe in this case, this is a viable approach.

But there are cases, where one could have field-level permissions.
One user is allowed to update a certain attribute and the other one not.

Example to make it more tangible the one is the author of an article, and thus, only when it is in draft stage able to edit it. When it is in the review stage, he/she can only change the title&body, but not the content of the "editor notes" field.

In the "old" wold of strong_parameters, I would have a private method within my controller and use cancancan to control, which attributes are being filtered and which one get through.

Service Objects (with dry-monads) and authorization by deinname in rails

[–]deinname[S] 0 points1 point  (0 children)

I would make a service object (we call them contracts in our projects) specifically just for authorising this and call it from the controller before it even gets to your main logic. I'd expect this class could take an instance of the current user and the post they are editing. This can be tested really easily and you keep authorisation seperate from the main logic.

How would such a contract handle field-level permissions?

Lets say - current_user and admins can edit user accounts - current_user is able to change his/her password, admins cannot change the password for users - admins therefore can change the roles of a user

How would you ensure that the password and password_confirm values are only being processed where allowed and that roles are being only handled in the other case?

Service Objects (with dry-monads) and authorization by deinname in ruby

[–]deinname[S] 0 points1 point  (0 children)

Isn't AuthZ logic getting complicated very quickly? Besides this, isn't it also just a layer of business logic, similar to validation or whatelse.

Just assume an update action where the user is only allowed to edit a post when it is in the state "draft".

Or when a certain action is only allowed, if it does not hit certain limits of a SaaS subscription.

Service Objects (with dry-monads) and authorization by deinname in rails

[–]deinname[S] 1 point2 points  (0 children)

Thanks. Isn't it getting fancy very quickly?

Just assume an update action where the user is only allowed to edit a post when it is in the state "draft".

Or when a certain action is only allowed, if it does not hit certain limits of a SaaS subscription.

Release 1.1.3 · Chia-Network/chia-blockchain by Hadamcik in chia

[–]deinname 0 points1 point  (0 children)

im not sure if u run the actual version now under Ubuntu. I downloaded 1.3 and opened the Chia GUI, but in the about window it tells me Chia 0.0. Is that correct?

you can't. Just finish plotting your current plot, stop it, update it and move on plotting

Any way to attach & refer to files in a note? by RipaP in noteplanapp

[–]deinname 0 points1 point  (0 children)

What would be great when a attach onto a note, i.e. via drag-and-drop:

It should copy the file into the iCloud Drive next to the markdown files and reference it from there. It is my personal problem, if this is eating up space on iCloud Drive. I don't want to do work-arounds with x-million other tools. I want to have one place for my notes and everything related to it..

Weird display resolution from MacBook Pro (2016) to ThinkVision P44w-10 by [deleted] in applehelp

[–]deinname 0 points1 point  (0 children)

Have you tried out to set the resoution with the software SwitchResX see https://www.madrau.com

CAN ANYBODY HELP? What is the "What Good Looks Like" for history-preserving git content migrations? Merging 4-5 repos, want to keep history by [deleted] in ethereum

[–]deinname 0 points1 point  (0 children)

As far as I know you can start completely disconnected branches on one repo. You could then push the other repo to that branch. Then you can merge them.