-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-2224] Access Token Edit Scopes #2022
[ENG-2224] Access Token Edit Scopes #2022
Conversation
Pull Request Test Coverage Report for Build 6584020659
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked this out locally. When I try to delete the token after hitting Edit scopes
the modal freezes and it toasts an error even though the deletion succeeds.
Apart from the buggy behavior when deleting, this fix introduces a security problem. The personal access token should only be viewable once. Setting the tokenValue
on the token
model to undefined
will bring back the edit form for sure, but the model's tokenValue
can easily be found by calling rollbackAttributes
on the model, therefore revealing the tokenValue
again. That is why we need to invoke clearTokenValue()
when we go back to edit the scopes to unload the token
model from store and reload from the BE.
e204f61
to
a79e7b0
Compare
Hi @adlius the changes for the token value are now persisted with save(). The buggy behavior with the delete button has been mitigated but from local testing may still not be fully awaiting. An await has been added to the delete's save which seemed to improve the delete's functionality. |
8336d78
to
f85e223
Compare
… to cleared token value, updated hardConfirm value to false.
5a1a713
to
1f43e14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last minor thing, otherwise, looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm catching this after an initial approval! It looks like the deleteToken
action in the edit-form
component should do this.token.deleteRecord();
followed by an await this.token.save();
, instead of the await this.token!.destroyRecord();
that's in there right now. Not 100% sure why the delete
and save
works but the destroy
does not, but it was correct in being there 🙇
Thank you and understood. They have been re-added. If you would also like to see validation for the token in an if statement, just let me know. Currently, it is using the |
Purpose
The purpose of these changes is to have the edit token page and its scopes properly displayed following new access token creation.
Summary of Changes
Screenshot(s)
Figure 1: Initial access token scope selection
Figure 2: Display of a new access token if the token value is present
Figure 3: Scopes properly display when clicking the 'Edit scopes' button
Figure 4: Saving the changes results in the token's scopes being updated
Figure 5: Clicking on the access token within the list view properly displays updated scopes
Figure 6: Deletion of token following clicking the 'Edit token' button
Side Effects
There should be no side effects.
QA Notes