orhun / rustypaste

A minimal file upload/pastebin service.
https://blog.orhun.dev/blazingly-fast-file-sharing
MIT License
760 stars 47 forks source link

auth logging is too chatty #209

Closed tessus closed 8 months ago

tessus commented 8 months ago

I think that the new auth logging is too chatty:

        } else if token_type == TokenType::Auth {
            // not configured `auth_tokens` means that the user is allowed to access the endpoints
            warn!("auth_tokens not configured, allowing the request without auth header");
            user_tokens.insert(token_type);
        }

Doesn't this mean that this is logged/printed for every request, if no auth_tokens are set? So, iff one doesn't use auth tokens, their log is spammed with these messages.

This shouldn't be a warning, rather an info message or debug message. IMO, there doesn't need to be a message at all.

orhun commented 8 months ago

I think this is a good point. Would you be down to create a PR to remove the log message?

tessus commented 8 months ago

Sure. I also have to fix a typo.

warn!("delete endpoints is not served because there are no delete_tokens set");

should be

warn!("delete endpoint is not served because there are no delete_tokens set");