Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Add endpoints to rotate password and API key#39

Merged
tbroden84 merged 3 commits intomainfrom
rotate-password
Oct 26, 2023
Merged

Add endpoints to rotate password and API key#39
tbroden84 merged 3 commits intomainfrom
rotate-password

Conversation

@tbroden84
Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Endpoints that support to rotate password and API key for an account.

Trello
Require fix: https://github.com/84codes/account-console/pull/56

WHAT is this pull request doing?

  • Clean up variables
  • Add endpoint for rotate password
  • Add endpoint for rotate API key

Comment thread api/account.go Outdated
if err != nil {
return err
}
if response.StatusCode != 204 {
Copy link
Copy Markdown
Contributor

@dentarg dentarg Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make sense to future proof here and allow response code 200 as success too

I recall someone asking for the password/key to be part of the reply when they rotate, and "204 No Content" wouldn't be suitable if we started doing that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea on how we want the response body if we choose to add password/apikey in the response?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples

  1. string
  2. { "password": "<password>" }, { "apikey": "<apikey>"
  3. { "result": "<password/apikey>" }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know :) I was thinking we don't need to know it here right now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh :) Now I get what you talked about.

Not sure now how and if the content will be returned as response
from rotate password or apikey. Just make sure we can handle
status code 200 if we choose to return rotated password or apikey.
@tbroden84 tbroden84 requested a review from dentarg October 24, 2023 08:19
@tbroden84 tbroden84 merged commit 1dc6073 into main Oct 26, 2023
@tbroden84 tbroden84 deleted the rotate-password branch October 26, 2023 11:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants