forgejo/models/fixtures
forgejo-backport-action facbdef3c1 [v15.0/forgejo] Exclude SSH certificate principals from output when viewing user's SSH keys (#12166)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/12079

Fixes #11590

When viewing a user's SSH keys, SSH principals are now excluded from the output.  This would previously either result in a panic in [OmitEmail](cfd4d53e32/models/asymkey/ssh_key.go (L67)), if the principal name didn't contain any spaces, or truncate the principal name, if it did contain spaces.

The TestExportUserSSHKeys test was also updated and fails if the fix(commit cfcbc33af0) is reverted.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. All work and communication must conform to Forgejo's [AI Agreement](https://codeberg.org/forgejo/governance/src/branch/main/AIAgreement.md). There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests for Go changes

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I ran...
  - [x] `make pr-go` before pushing
  - [x] `make test`
  - [x] `make test-sqlite#TestExportUserSSHKeys`

I have also manually tested the change.

The full integration tests(`make test-sqlite`) report some errors, but I get the same errors without this PR(tested on commit [6a5dda7116](6a5dda7116)).

I have not tested with the other database backends.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [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.
- [ ] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change.

*The decision if the pull request will be shown in the release notes is up to the mergers / release team.*

The content of the `release-notes/<pull request number>.md` file will serve as the basis for the release notes. If the file does not exist, the title of the pull request will be used instead.

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/12166): <!--number 12166 --><!--line 0 --><!--description RXhjbHVkZSBTU0ggY2VydGlmaWNhdGUgcHJpbmNpcGFscyBmcm9tIG91dHB1dCB3aGVuIHZpZXdpbmcgdXNlcidzIFNTSCBrZXlz-->Exclude SSH certificate principals from output when viewing user's SSH keys<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Alec Walsh <code@alecwalsh.name>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12166
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2026-04-17 21:34:12 +02:00
..
ModerationFeatures fix: make sure to use unaltered fields when saving a shadow copy for updated profiles or comments (#8533) 2025-07-20 23:52:58 +02:00
PrivateIssueProjects fix(models): deduplicate project sorting values and add unique constraints (#11334) 2026-02-27 16:25:20 +01:00
TestActivateUserEmail fix: user activation with uppercase email address (#8367) 2025-07-02 13:04:22 +02:00
TestAddTeamReviewRequest fix: PR not blocked by review request for a whitelisted team (#8511) 2025-07-15 23:21:42 +02:00
TestGetUnmergedPullRequestsByHeadInfoMax Add codespell support and fix a good number of typos with its help (#3270) 2024-05-09 13:49:37 +00:00
TestGetUsedForUser fix: ignore expired artifacts for quota calculation (#7976) 2025-05-28 18:22:10 +02:00
TestPackagesGetOrInsertBlob fix: package_blob.has_blake2b may be null (#7520) 2025-04-11 12:28:03 +00:00
TestParseCommitWithSSHSignature fix: prevent commit API from leaking user's hidden email address on valid GPG signed commits 2025-10-24 11:35:51 -06:00
TestPrivateRepoProjects fix(models): deduplicate project sorting values and add unique constraints (#11334) 2026-02-27 16:25:20 +01:00
TestTwoFactorWithPasswordChange fix: endless redirection loop between /user/settings/change_password and /user/settings/security (#10002) 2025-11-07 21:12:47 +01:00
access.yml Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
access_token.yml Fix more yaml lint errors (#27284) 2023-09-26 12:56:42 -04:00
action.yml fix: make the action feed resilient to database inconsistencies (#8617) 2025-07-22 23:40:30 +02:00
action_artifact.yml feat: artifacts can be downloaded using their id instead of their name (#8957) 2025-08-25 15:51:26 +02:00
action_run.yml feat: add more filters to actions run and tasks api (#11584) 2026-03-10 01:20:00 +01:00
action_run_job.yml feat: allow runners to request a particular job (#11676) 2026-03-25 17:27:05 +01:00
action_runner.yml feat: auto cleanup of offline runners (#7803) 2025-06-08 00:13:37 +02:00
action_runner_token.yml feat: add foreign keys to the action_runner_token table (#10756) 2026-01-12 21:59:40 +01:00
action_task.yml feat(ui): show cancel button until all jobs are finished (#9261) 2025-12-21 17:09:22 +01:00
action_task_output.yml Fix missing outputs for jobs with matrix (#32823) 2024-12-15 10:14:21 +01:00
action_user.yml feat: add ActionUser model & fields to ActionRun 2025-11-06 11:07:38 +01:00
attachment.yml Allow get release download files and lfs files with oauth2 token format (#26430) 2023-10-01 10:41:52 +00:00
branch.yml fix: Allow SHA-256 in PR commit URLs (#10309) 2025-12-16 00:45:00 +01:00
collaboration.yml Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
comment.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
commit_status.yml feat: improve GetLatestCommitStatusForPairs 2024-11-16 13:23:40 +01:00
commit_status_index.yml Fix more yaml lint errors (#27284) 2023-09-26 12:56:42 -04:00
email_address.yml Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
follow.yml fix(ui): ensure same width of usercards in grid (#6799) 2025-05-25 13:31:53 +02:00
forgejo_blocked_user.yml [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
gpg_key.yml Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
hook_task.yml chore: QoL improvements to tests (#7917) 2025-05-21 15:45:56 +02:00
issue.yml fix: Allow SHA-256 in PR commit URLs (#10309) 2025-12-16 00:45:00 +01:00
issue_assignees.yml Fix issue overview for teams (#19652) 2022-05-16 17:49:17 +08:00
issue_index.yml fix: Allow SHA-256 in PR commit URLs (#10309) 2025-12-16 00:45:00 +01:00
issue_label.yml Add Organization Wide Labels (#10814) 2020-04-01 01:14:46 -03:00
issue_user.yml [API] ListIssues add more filters (#16174) 2021-06-16 18:33:37 -04:00
issue_watch.yml Refactor Issues Subscription (#8738) 2019-11-20 22:50:54 +08:00
label.yml test: prevent XSS for label rendering 2025-06-27 13:27:06 +02:00
lfs_meta_object.yml test: LFS gc should not delete all metadata objects 2024-04-26 10:16:59 +02:00
milestone.yml Add some api integration tests (#18872) 2022-10-18 00:23:27 +08:00
mirror.yml Fix bug of branches API with tests (#25578) 2023-07-01 10:52:52 +08:00
notice.yml Unit tests for models/admin 2017-01-09 21:49:51 +01:00
notification.yml feat: rework notification table (#9926) 2025-11-29 23:03:56 +01:00
oauth2_application.yml test(oauth): RFC 6749 Section 10.2 conformance 2024-06-05 17:50:15 +02:00
oauth2_authorization_code.yml Record OAuth client type at registration (#21316) 2022-10-24 15:59:24 +08:00
oauth2_grant.yml Record OAuth client type at registration (#21316) 2022-10-24 15:59:24 +08:00
org_user.yml Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
project.yml fix: honor org/user project in new issue (#9906) 2026-02-16 05:52:47 +01:00
project_board.yml fix(models): deduplicate project sorting values and add unique constraints (#11334) 2026-02-27 16:25:20 +01:00
project_issue.yml fix(models): deduplicate project sorting values and add unique constraints (#11334) 2026-02-27 16:25:20 +01:00
protected_tag.yml Protected tag is no internal server error (#30962) 2024-05-19 13:12:35 +02:00
public_key.yml [v15.0/forgejo] Exclude SSH certificate principals from output when viewing user's SSH keys (#12166) 2026-04-17 21:34:12 +02:00
pull_request.yml fix: Allow SHA-256 in PR commit URLs (#10309) 2025-12-16 00:45:00 +01:00
reaction.yml Fix more yaml lint errors (#27284) 2023-09-26 12:56:42 -04:00
release.yml [GITEA] Improve HTML title on repositories 2024-02-05 16:05:50 +01:00
renamed_branch.yml Add a simple way to rename branch like gh (#15870) 2021-10-08 19:03:04 +02:00
repo_redirect.yml chore: add repo redirect unit test 2025-08-30 09:37:38 +02:00
repo_topic.yml Add API endpoint for accessing repo topics (#7963) 2019-09-03 23:46:24 +08:00
repo_transfer.yml Repository transfer has to be confirmed, if user can not create repo for new owner (#14792) 2021-03-01 01:47:30 +01:00
repo_unit.yml fix: Allow SHA-256 in PR commit URLs (#10309) 2025-12-16 00:45:00 +01:00
repository.yml fix: Allow SHA-256 in PR commit URLs (#10309) 2025-12-16 00:45:00 +01:00
review.yml Fix the logic of finding the latest pull review commit ID (#32139) 2024-10-06 07:44:28 +02:00
star.yml Unit tests for models/star (#752) 2017-01-25 18:37:10 +08:00
stopwatch.yml [API] extend StopWatch (#9196) 2019-12-11 23:23:05 -05:00
system_setting.yml disable gravatar in test (#32529) 2024-11-24 15:42:36 +00:00
team.yml refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
team_repo.yml Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
team_unit.yml fix: always render detailed team permissions table in sidebar (#8108) 2025-06-09 10:37:31 +02:00
team_user.yml Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
topic.yml Add some api integration tests (#18872) 2022-10-18 00:23:27 +08:00
tracked_time.yml feat: add foreign keys to stopwatch & tracked_time tables (#9373) 2025-10-01 00:31:38 +02:00
two_factor.yml feat: migrate TOTP secrets to keying 2024-11-27 00:34:16 +01:00
user.yml feat(activitypub): use structure @PreferredUsername@host.tld:port for actors (#9254) 2026-01-30 23:45:11 +01:00
user_open_id.yml Show user OpenID URIs in their profile (#1314) 2017-03-20 09:31:08 +01:00
user_redirect.yml chore: add unit test 2025-08-30 09:37:30 +02:00
watch.yml [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
webauthn_credential.yml [FEAT] Add support for webauthn credential level 3 2024-08-29 10:05:03 +02:00
webhook.yml test: webhook fix branch filter tests 2024-04-30 09:38:35 +02:00