mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #4094] [MERGED] feat: introduce personal access tokens for authorization #4657
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4657
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/4094
Author: @jamesgeorge007
Created: 5/29/2024
Status: ✅ Merged
Merged: 6/24/2024
Merged by: @AndrewBastin
Base:
next← Head:feat/pat-ui-changes📝 Commits (5)
99d384ffeat: add the ability for creating/deleting PATs from the UIcc4db26refactor: replace generate modal title with i18n string900493cchore: address CR commentsd1e9fa6fix: accessplatform.auth.axiosPlatformConfigafter login info resolutionf1c23bechore: cleanup📊 Changes
9 files changed (+857 additions, -226 deletions)
View changed files
📝
packages/hoppscotch-common/locales/en.json(+30 -3)📝
packages/hoppscotch-common/src/components.d.ts(+214 -207)➕
packages/hoppscotch-common/src/components/accessTokens/GenerateModal.vue(+221 -0)➕
packages/hoppscotch-common/src/components/accessTokens/List.vue(+128 -0)➕
packages/hoppscotch-common/src/components/accessTokens/Overview.vue(+30 -0)➕
packages/hoppscotch-common/src/components/accessTokens/index.vue(+208 -0)📝
packages/hoppscotch-common/src/helpers/utils/date.ts(+11 -4)📝
packages/hoppscotch-common/src/pages/profile.vue(+14 -12)📝
packages/hoppscotch-common/src/platform/auth.ts(+1 -0)📄 Description
Description
This PR includes the UI changes adding support for Personal Access Tokens (tokens associated with a user) providing a mechanism for authorization to access certain services and APIs the Hoppscotch platform offers. Currently, collections and environments from any team workspace (user having access to) can be accessed via PAT primarily for usage in the CLI, #4095.
The BE changes were added in #4079.
Closes HFE-519.
Changes
profilepage corresponding to personal access tokens.AccessTokens(parent component where other presentational components are rendered and include all business logic),AccessTokensOverview,AccessTokensList, andAccessTokensGenerateModalcomponents compiling various flows wrt personal access tokens.i18nstring entry additions.includeTimeto the shortDateTime helper function that defaults totruefor an additional use case of conditionally including the time.Preview
https://github.com/hoppscotch/hoppscotch/assets/25279263/989bf51c-1a6f-45ef-a7e5-0fff8bb60552
Checks
Note to reviewers
Currently, the network call to fetch the list of access tokens gets triggered while at the
Accounttab. A potential optimization that can be done here is ensuring the data fetch happens only while the respective tab is visited. The existing implementation ensures inactive tab contents are rendered (via therender-inactive-tabsprop forHoppSmartTabs) while landing on the initialAccounttab and thought to revisit it separately as required.github.com/hoppscotch/hoppscotch@acbea3aa9c/packages/hoppscotch-common/src/pages/profile.vue (L74-L78)There's a layout shift while switching between the tabs under the profile page. A pre-existing issue that can be tackled separately.
Since more subviews are getting added under the profile page, we could think in the direction of having dedicated routes for subviews where the common header element gets rendered at the parent
/profileroute with a slot for child routes/profile/account, etc later on.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
vitest#4895