aleph icon indicating copy to clipboard operation
aleph copied to clipboard

Refresh my personal API key

Open zufanka opened this issue 5 years ago • 6 comments

I did not keep my API key very private (posted it on Slack by accident, not a super breach but still). I'd like an option to "refresh" my API key, meaninig create a new one while the old one would hence become invalid.

Possible front end implementation: image

Clicking on the refresh button would prompt a warning "Are you sure you want to reset your API key?"

zufanka avatar Feb 25 '20 15:02 zufanka

As far as I can tell, the way that Aleph is handling changes to the users' data is by sending a POST towards the api/2/roles/user_id , which does not make much sense in the context of asking the backend to regen an API token, I'm going forward in creating a new endpoint for the user, something like api/2/roles/user_id/reset_api, that simply overrides the current api_key field (on the UI side there will need to be some kind of modal for warning and a refresh of the users data, I'm not much of a React developer but I can give it a shot)

PastNullInfinity avatar Jun 23 '20 14:06 PastNullInfinity

This makes perfect sense as an approach, I agree on not "beating" it into REST.

pudo avatar Jun 23 '20 14:06 pudo

Any luck, @PastNullInfinity ?

pudo avatar Jul 06 '20 07:07 pudo

Work got the best of me : ) I have a branch ready, I'll try to open the PR in the next couple of days @pudo

PastNullInfinity avatar Jul 07 '20 10:07 PastNullInfinity

@PastNullInfinity Hey there! So how did it end up? Did you manage to make a PR of that thing?

ozhyrenkov avatar Jun 07 '22 08:06 ozhyrenkov

@AZhyrenkov Hey! I've definitely dropped the ball on this PR, honestly hadn't had time in the past years to give real time to this project, that's on me : / I'm planning on getting more time for contributions in the next month, I'll make an effort to push a PR for this soon

PastNullInfinity avatar Jun 07 '22 10:06 PastNullInfinity