acmpesuecc / pasta

a pastebin written in go
https://polarhive.net/pasta
GNU General Public License v3.0
0 stars 5 forks source link

feat: auth #3

Closed polarhive closed 1 month ago

polarhive commented 1 month ago
ManishMDharani commented 1 month ago

can i get assigned?

polarhive commented 1 month ago

!assign @ManishMDharani

polarhive commented 1 month ago

!deassign @ManishMDharani

ManishMDharani commented 1 month ago

can i please get this assigned?

polarhive commented 1 month ago

!assign @ManishMDharani

polarhive commented 1 month ago

!deassign

polarhive commented 1 month ago

@ManishMDharani do you want to take this?

Delta18-Git commented 1 month ago

I kinda did this. Can I make a PR‌ real quick?

Delta18-Git commented 1 month ago

problem I'm facing is that the rate limit isn't expiring...

Delta18-Git commented 1 month ago

I was mistaken it works

Delta18-Git commented 1 month ago

11 is the PR

polarhive commented 1 month ago

What I'm looking for is a mechanism that tracks failed $PASSPHRASE header attempts by IP. For instance, after each failed passphrase, the cooldown for that IP could be increased by 5 minutes.


    // Check for passphrase in headers
    if r.Header.Get("X-Auth-Passphrase") != passphrase {
        http.Error(w, "Unauthorized", http.StatusUnauthorized)
        return

While your rate-limiting effectively prevents spammy behavior and limits excessive requests from the same IP, it doesn’t currently provide protection against brute force password attacks since failed passphrase attempts aren’t tracked separately.

I can !extend your time if you'd like to work on it for the rest of the bounty points.

Delta18-Git commented 1 month ago

Hi sorry, I was on my way home and didn't see the update, Thanks for the advice, I'll work on this when I have more time next week for fun. Thanks!