Skip to content

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

Merged
susnux merged 2 commits into
masterfrom
fix/auth-token-settings
Jan 29, 2024
Merged

fix(settings): Disable renaming for tokens marked to be wiped#42331
susnux merged 2 commits into
masterfrom
fix/auth-token-settings

Conversation

@susnux

Copy link
Copy Markdown
Contributor

Summary

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

Checklist

@susnux
susnux requested review from a team, Altahrim, icewind1991 and nfebe and removed request for a teamDecember 16, 2023 17:32
@susnux
susnux requested a review from come-ncDecember 16, 2023 17:33
$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

Class OC\Authentication\Token\IToken is deprecated

@emoral435emoral435 left a comment

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.

LGTM!

@susnux
susnuxforce-pushed the fix/auth-token-settings branch from 15f7e5d to 1a35635CompareDecember 21, 2023 17:29
@emoral435
emoral435force-pushed the fix/auth-token-settings branch from 1a35635 to 9e47461CompareDecember 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
Copy Markdown
ContributorAuthor

/backport to stable28

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnuxforce-pushed the fix/auth-token-settings branch from 9e47461 to bba6813CompareJanuary 29, 2024 13:01
@susnux
susnux merged commit cff36b7 into masterJan 29, 2024
@susnux
susnux deleted the fix/auth-token-settings branch January 29, 2024 17:47
@blizzzblizzz mentioned this pull request Mar 5, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@susnux@github-advanced-security@come-nc@emoral435