Skip to content

Conversation

@xmaxlad
Copy link
Contributor

@xmaxlad xmaxlad commented Feb 24, 2025

Proposed changes (including videos or screenshots)

Only allow creating PAT with a name.

If user clicks on 'Add' without giving a name, an error message is displayed, requiring the PAT name.
If users enters a name, the PAT is created as before with no changes.

Kapture 2025-05-29 at 14 28 51

Issue(s)

closes: #35314

Currently users can create a PAT without a name (an empty string). Which is not a appropriate case, creating tokens with no name can lead to confusion if there are multiple such tokens.

Steps to test or reproduce

  1. Go to root/account/tokens
  2. Click on Add

Further comments

The pull request displays a error message that informs the user to provide a name to the token rather than creating a PAT without no name.

Looking forward to any views or comments.

CORE-1085

@xmaxlad xmaxlad requested a review from a team as a code owner February 24, 2025 06:35
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 24, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2025

🦋 Changeset detected

Latest commit: 311f264

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@rocket.chat/i18n Minor
@rocket.chat/meteor Minor
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/ui-client Major
@rocket.chat/ui-voip Major
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/http-router Patch
@rocket.chat/model-typings Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Feb 24, 2025

CLA assistant check
All committers have signed the CLA.

@xmaxlad xmaxlad changed the title improve: only allow creating token with name (#35314) fix: only allow creating token with name Feb 24, 2025
@dougfabris dougfabris self-assigned this Feb 26, 2025
@dougfabris dougfabris added this to the 7.5.0 milestone Feb 26, 2025
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

@xmaxlad Hey, thanks for the contribution!
Instead of dispatching a toast, can we add a FieldError to the Field?
For your reference

@scuciatto scuciatto modified the milestones: 7.5.0, 7.6.0 Mar 24, 2025
@dougfabris dougfabris removed this from the 7.6.0 milestone Apr 23, 2025
@dougfabris dougfabris changed the title fix: only allow creating token with name feat: Only allow creating personal access token with name May 29, 2025
@dougfabris dougfabris removed their assignment May 29, 2025
@dougfabris dougfabris added this to the 7.8.0 milestone May 29, 2025
dougfabris
dougfabris previously approved these changes May 29, 2025
@dougfabris dougfabris force-pushed the improve/only-allow-creating-token-with-name branch from 3de1f21 to f60bcb3 Compare May 29, 2025 18:03
@gabriellsh gabriellsh changed the title feat: Only allow creating personal access token with name feat: Require token name when creating personal access token May 29, 2025
@FragaKrummenauer FragaKrummenauer added the stat: QA assured Means it has been tested and approved by a company insider label Jun 17, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 17, 2025
@codecov
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.75%. Comparing base (a0fd1f5) to head (311f264).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35315      +/-   ##
===========================================
- Coverage    64.35%   62.75%   -1.60%     
===========================================
  Files         3139     3024     -115     
  Lines       104662   102697    -1965     
  Branches     19759    19324     -435     
===========================================
- Hits         67350    64447    -2903     
- Misses       34628    35804    +1176     
+ Partials      2684     2446     -238     
Flag Coverage Δ
e2e 52.04% <100.00%> (-5.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kodiakhq kodiakhq bot merged commit 8033bdb into RocketChat:develop Jun 18, 2025
76 of 86 checks passed
jeanfbrito pushed a commit that referenced this pull request Jun 18, 2025
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
This was referenced Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve: only allow creating tokens with a name

7 participants