forgejo/modules/structs
steven.guiheux 0ef80f6b0f feat: expose access token creation date in API responses (#12620)
## Checklist

Following the previous contribution that added admin-level management of user access tokens (particularly useful for bot/service accounts), this change exposes the created_at field in the API response when listing or retrieving access tokens.

This information is needed to implement token rotation policies for these users — knowing when a token was created allows administrators to identify and revoke stale tokens.

### Tests for Go changes

- I added test coverage for Go changes...
  - [X] in their respective `*_test.go` for unit tests.
  - [X] `make pr-go` before pushing

### Documentation

- [X] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [X] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/12620): <!--number 12620 --><!--line 0 --><!--description ZXhwb3NlIGFjY2VzcyB0b2tlbiBjcmVhdGlvbiBkYXRlIGluIEFQSSByZXNwb25zZXM=-->expose access token creation date in API responses<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12620
Reviewed-by: Andreas Ahlenstorf <aahlenst@noreply.codeberg.org>
2026-05-20 18:45:38 +02:00
..
action.go feat: expose run_id in ...actions/runners/jobs endpoint (#12480) 2026-05-09 02:31:03 +02:00
activity.go [CHORE] Fix swagger deprecation message 2024-08-10 01:21:13 +02:00
activitypub.go Improved signature handling & instance actor (#8275) 2025-07-01 19:49:00 +02:00
admin_user.go feat: Add support for administrators to set email visibility on user accounts (#9668) 2025-10-15 03:21:15 +02:00
attachment.go fix(ui): Add pasted images to dropzone 2025-06-30 12:42:22 +02:00
commit_status.go feat: mark skipped checks as skipped (#12606) 2026-05-17 18:00:49 +02:00
commit_status_test.go feat: mark skipped checks as skipped (#12606) 2026-05-17 18:00:49 +02:00
cron.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
doc.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
fork.go feat: sync forks (#2364) 2025-04-07 07:00:38 +00:00
git_blob.go api: GitBlob consistent naming 2025-06-13 11:35:14 +02:00
git_hook.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
hook.go Revert "fix(api): document is_system_webhook field (#7784)" (#8286) 2025-06-26 00:36:18 +02:00
issue.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
issue_comment.go feat(api): more verbose error messages and swagger comments for posting issue comments (#11368) 2026-03-07 23:16:20 +01:00
issue_label.go Support using label names when changing issue labels (#30943) 2024-05-19 13:12:35 +02:00
issue_milestone.go [CHORE] Fix swagger deprecation message 2024-08-10 01:21:13 +02:00
issue_reaction.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
issue_stopwatch.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
issue_test.go chore: replace gopkg.in/yaml.v3 with go.yaml.in/yaml/v3 (#8956) 2025-08-20 15:31:12 +02:00
issue_tracked_time.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
lfs_lock.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
mirror.go feat: add configuration to only push mirror selected branches (#7823) 2025-07-12 00:39:35 +02:00
miscellaneous.go fix: Preview picture not visible on Markdown file (#5781) 2024-11-23 15:00:18 +00:00
moderation.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
nodeinfo.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
notifications.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
org.go Inclusion of rename organization api (#33303) 2025-02-02 12:01:58 +01:00
org_member.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
org_team.go fix: correct malformed CreateTeamOption example (#11093) 2026-02-16 05:55:20 +01:00
package.go Fix package webhook (#27839) 2023-10-31 04:43:38 +00:00
pull.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
pull_review.go Fix invalid swagger syntax of $ref with sibling (#7019) 2025-02-21 14:09:21 +00:00
quota.go feat(quota): Humble beginnings of a quota engine 2024-08-02 11:10:34 +02:00
release.go [FEAT]Add Option to hide Release Archive links (#3139) 2024-04-24 15:15:55 +00:00
repo.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
repo_actions.go feat: implement ephemeral runners (#9962) 2026-02-16 18:56:56 +01:00
repo_branch.go [FEAT] Configure if protected branch rule should apply to admins 2024-03-29 00:21:49 +01:00
repo_collaborator.go [CHORE] Fix swagger deprecation message 2024-08-10 01:21:13 +02:00
repo_commit.go Add file status for API "Get a single commit from a repository" (#16205) (#25831) 2023-07-20 16:35:47 +08:00
repo_compare.go feat: add files to compare (#6461) 2025-01-05 02:32:46 +00:00
repo_file.go feat(api): add last_commit_when to contents response (#7418) 2025-04-18 09:31:40 +00:00
repo_flags.go [FEAT] API support for repository flags 2024-02-05 16:09:42 +01:00
repo_key.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_note.go [FEAT]Allow changing git notes (#4753) 2024-11-18 22:56:17 +00:00
repo_refs.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_tag.go Add tag protection via rest api #17862 (#31295) 2024-06-16 13:42:59 +02:00
repo_topic.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_tree.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_watch.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
repo_wiki.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
runner.go chore: remove field ephemeral from runner registration response (#11350) 2026-02-18 16:49:44 +01:00
secret.go fix: normalize secrets consistently, display accurate help (#11052) 2026-02-09 17:02:18 +01:00
settings.go Allow instance-wide disabling of forking 2024-02-25 12:00:17 +01:00
status.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
task.go style: reenable switch check 2024-08-18 15:19:01 +02:00
user.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
user_app.go feat: expose access token creation date in API responses (#12620) 2026-05-20 18:45:38 +02:00
user_email.go fix: use ValidateEmail as binding across web forms 2024-08-28 22:25:17 -06:00
user_gpgkey.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
user_key.go fix: expose API fields for ssh keys (#12517) (#12625) 2026-05-18 17:44:37 +02:00
variable.go fix: normalize secrets consistently, display accurate help (#11052) 2026-02-09 17:02:18 +01:00
visible_type.go change org_type.go to visible_type.go and fix the notes (#22752) 2023-02-09 06:40:34 +00:00
workflow.go feat(api): return run_number in workflow dispatch (#7286) 2025-03-25 21:22:32 +00:00