stonith404 / pingvin-share

A self-hosted file sharing platform that combines lightness and beauty, perfect for seamless and efficient file sharing.
https://stonith404.github.io/pingvin-share/
BSD 2-Clause "Simplified" License
3.44k stars 238 forks source link

🚀 Feature: API Key support #603

Open COMPLEXWASTAKEN opened 2 months ago

COMPLEXWASTAKEN commented 2 months ago

🔖 Feature description

I would like to suggest the addition of API key support for each user in order to handle requests that come to the API much more safely. It will grant users authentication for uploading via API until debugging on the back-end is done. By having this feature, the user experience is definitely enhanced and their interaction is made smoother because users can easily access API endpoints safely.

🎤 Pitch

i would like to use it so i can setup a app so they upload files

COMPLEXWASTAKEN commented 2 months ago

i tryed making a self built one but i keep getting { message: 'Forbidden resource', error: 'Forbidden', statusCode: 403 } and i looked threw the code and couldnt find whats throwing it

COMPLEXWASTAKEN commented 2 months ago

found a way to do it i am using the refresh token to get a new token and then using request to upload but i would still like a full api key support if possible

WolverinDEV commented 2 months ago

Well personally I just login with some users credential.
The access token is usually valid for a longer time then the application requires:
https://github.com/WolverinDEV/pingvin-share-shell/blob/master/pingvin-share/src/main.rs#L109

COMPLEXWASTAKEN commented 2 months ago

for some reason when i used the access token it would turn forbidden unless i used the refresh token to get a new token it was werid but i would like api keys for users or somthing like that i would make it if i knew typescript