feat: add ability to edit API token scopes #699
Reference in New Issue
Block a user
Delete Branch "feature/edit-token-scopes"
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?
Summary
/users/{username}/tokens/{id}API endpoint to edit token name and scopesUpdateAccessToken()already existed — this exposes it through API and UICloses #697 (partially — licensing scope was PR #698, this adds editability)
Changes
modules/structs/user_app.go: NewEditAccessTokenOptionstructrouters/api/v1/user/app.go: NewUpdateAccessToken()handler with swagger docsrouters/api/v1/api.go: PATCH route on/tokens/{id}routers/web/user/setting/applications.go: NewEditApplication()handlerrouters/web/web.go: POST/editroutetemplates/user/settings/applications.tmpl: Edit button + scope modal with JSoptions/locale/locale_en-US.json: New locale stringsTest plan
allscoped tokens are unaffectedAdd PATCH /users/{username}/tokens/{id} API endpoint and web UI edit button so token scopes can be modified after creation without having to delete and recreate the token.9a418d40f5tof7c2b205c5