Skip to content
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

fix(settings): Disable renaming for tokens marked to be wiped #42331

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Dec 16, 2023

Summary

This otherwise a WipeException will be thrown when trying to rename (by getTokenById in PublicKeyTokenProvider).

Checklist

@susnux susnux requested review from a team, icewind1991, Altahrim and nfebe and removed request for a team December 16, 2023 17:32
@susnux susnux requested a review from come-nc December 16, 2023 17:33
@@ -105,7 +105,7 @@
return array_map(function (IToken $token) use ($sessionToken) {
$data = $token->jsonSerialize();
$data['canDelete'] = true;
$data['canRename'] = $token instanceof INamedToken;
$data['canRename'] = $token instanceof INamedToken && $data['type'] !== IToken::WIPE_TOKEN;

Check notice

Code scanning / Psalm

DeprecatedClass Note

Class OC\Authentication\Token\IToken is deprecated
@susnux susnux requested a review from emoral435 December 21, 2023 16:01
Copy link
Contributor

@emoral435 emoral435 left a comment

Choose a reason for hiding this comment

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

LGTM!

@susnux susnux force-pushed the fix/auth-token-settings branch from 15f7e5d to 1a35635 Compare December 21, 2023 17:29
@emoral435 emoral435 force-pushed the fix/auth-token-settings branch from 1a35635 to 9e47461 Compare December 22, 2023 15:43
This otherwise a WipeException will be thrown when trying to rename

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
Copy link
Contributor Author

susnux commented Jan 29, 2024

/backport to stable28

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the fix/auth-token-settings branch from 9e47461 to bba6813 Compare January 29, 2024 13:01
@susnux susnux merged commit cff36b7 into master Jan 29, 2024
135 checks passed
@susnux susnux deleted the fix/auth-token-settings branch January 29, 2024 17:47
@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants