You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
Wim 9066d09c57
Add ssh certificate support (#12281)
* Add ssh certificate support

* Add ssh certificate support to builtin ssh

* Write trusted-user-ca-keys.pem based on configuration

* Update app.example.ini

* Update templates/user/settings/keys_principal.tmpl

Co-authored-by: silverwind <me@silverwind.io>

* Remove unused locale string

* Update options/locale/locale_en-US.ini

Co-authored-by: silverwind <me@silverwind.io>

* Update options/locale/locale_en-US.ini

Co-authored-by: silverwind <me@silverwind.io>

* Update models/ssh_key.go

Co-authored-by: silverwind <me@silverwind.io>

* Add missing creation of SSH.Rootpath

* Update cheatsheet, example and locale strings

* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>

* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>

* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>

* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>

* Update models/ssh_key.go

* Optimizations based on feedback

* Validate CA keys for external sshd

* Add filename option and change default filename

Add a SSH_TRUSTED_USER_CA_KEYS_FILENAME option which default is
RUN_USER/.ssh/gitea-trusted-user-ca-keys.pem

Do not write a file when SSH_TRUSTED_USER_CA_KEYS is empty.

Add some more documentation.

* Remove unneeded principalkey functions

* Add blank line

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>

* Add SSH_AUTHORIZED_PRINCIPALS_ALLOW option

This adds a SSH_AUTHORIZED_PRINCIPALS_ALLOW which is default
email,username this means that users only can add the principals
that match their email or username.

To allow anything the admin need to set the option anything.

This allows for a safe default in gitea which protects against malicious
users using other user's prinicipals. (before that user could set it).

This commit also has some small other fixes from the last code review.

* Rewrite principal keys file on user deletion

* Use correct rewrite method

* Set correct AuthorizedPrincipalsBackup default setting

* Rewrite principalsfile when adding principals

* Add update authorized_principals option to admin dashboard

* Handle non-primary emails

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add the command actually to the dashboard template

* Update models/ssh_key.go

Co-authored-by: silverwind <me@silverwind.io>

* By default do not show principal options unless there are CA keys set or they are explicitly set

Signed-off-by: Andrew Thornton <art27@cantab.net>

* allow settings when enabled

* Fix typos in TrustedUserCAKeys path

* Allow every CASignatureAlgorithms algorithm

As this depends on the content of TrustedUserCAKeys we should allow all
signature algorithms as admins can choose the specific algorithm on their
signing CA

* Update models/ssh_key.go

Co-authored-by: Lauris BH <lauris@nix.lv>

* Fix linting issue

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
5 years ago
..
fixtures Use argon as default password hash algorithm (#12688) 5 years ago
migrations Add configurable Trust Models (#11712) 5 years ago
access.go Upgrade xorm to v1.0.0 (#10646) 5 years ago
access_test.go Fix "access" fixtures and tests (#10247) 5 years ago
action.go Make dashboard newsfeed list length a configurable item (#12469) 5 years ago
action_list.go refactor: reduce sql query in retrieveFeeds (#3547) 7 years ago
action_test.go Add gitea-vet (#10948) 5 years ago
admin.go Add default storage configurations (#12813) 5 years ago
admin_test.go Fix tests code to prevent some runtime errors (#2381) 8 years ago
attachment.go Add a storage layer for attachments (#11387) 5 years ago
attachment_test.go Reading pull attachments should depend on read UnitTypePullRequests (#10346) 5 years ago
avatar.go Open transaction when adding Avatar email-hash pairs to the DB (#12577) 5 years ago
branches.go Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure EnvPusherEmail is set (#12646) 5 years ago
branches_test.go Add deleted_branch table fixture (#2832) 8 years ago
commit_status.go API add/generalize pagination (#9452) 5 years ago
commit_status_test.go Fix wrong hint when status checking is running on pull request view (#9886) 5 years ago
consistency.go Add migration to set IsArchived false if it is null (#11853) 5 years ago
context.go Upgrade xorm to v1.0.2 (#11900) 5 years ago
convert.go Whilst changing the character set to utf8mb4 we should set ROW_FORMAT=dynamic too (#12804) 5 years ago
error.go Adopt repositories (#12920) 5 years ago
error_oauth2.go gofmt (#1662) 8 years ago
external_login_user.go Migrate reviews when migrating repository from github (#9463) 5 years ago
fixture_generation.go Move fixture generation to contrib and add test (#10277) 5 years ago
fixture_test.go Move fixture generation to contrib and add test (#10277) 5 years ago
gpg_key.go Add configurable Trust Models (#11712) 5 years ago
gpg_key_test.go Allow addition of gpg keyring with multiple keys (#12487) 5 years ago
helper.go Add reactions to issues/PR and comments (#2856) 7 years ago
helper_directory.go Re-attempt to delete temporary upload if the file is locked by another process (#12447) 5 years ago
helper_environment.go Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes (#12752) 5 years ago
issue.go (Re)Load issue labels when changing them (#13007) 5 years ago
issue_assignees.go Remove Unused Functions (#10516) 5 years ago
issue_assignees_test.go Fix API Bug (fail on empty assignees) (#8873) 5 years ago
issue_comment.go Kanban board (#8346) 5 years ago
issue_comment_list.go Fixed repo link in generated comment for cross repository dependency (#9863) 5 years ago
issue_comment_test.go Pull request review/approval and comment on code (#3748) 7 years ago
issue_dependency.go Display ui time with customize time location (#7792) 6 years ago
issue_dependency_test.go Refactor comment (#9330) 5 years ago
issue_label.go (Re)Load issue labels when changing them (#13007) 5 years ago
issue_label_test.go BugFix: updateLabel can updated not allowed fields #11242 (#11242) 5 years ago
issue_list.go [BugFix] ReviewCount: GetApprovalCounts func sorted wrong (#11086) 5 years ago
issue_list_test.go Add Organization Wide Labels (#10814) 5 years ago
issue_lock.go remove unused method and rename createcommentWithNoAction (#9367) 5 years ago
issue_milestone.go Add Created & Updated to Milestone (#12662) 5 years ago
issue_milestone_test.go Add name filter to API for GetMilestoneList (#12336) 5 years ago
issue_reaction.go API add/generalize pagination (#9452) 5 years ago
issue_reaction_test.go Migrate reactions when migrating repository from github (#9599) 5 years ago
issue_stopwatch.go Refactor: move Commit To APIFormat Code & Lot of StopWatch related things (#12729) 5 years ago
issue_stopwatch_test.go Add gitea-vet (#10948) 5 years ago
issue_test.go issue search on my related repositories (#9758) 5 years ago
issue_tracked_time.go Fix tracked time issues (#11349) 5 years ago
issue_tracked_time_test.go [API] Extend times API (#9200) 5 years ago
issue_user.go Mail assignee when issue/pull request is assigned (#8546) 6 years ago
issue_user_test.go Add "Update Branch" button to Pull Requests (#9784) 5 years ago
issue_watch.go Add issue subscription check to API (#10967) 5 years ago
issue_watch_test.go API add/generalize pagination (#9452) 5 years ago
issue_xref.go remove unused method and rename createcommentWithNoAction (#9367) 5 years ago
issue_xref_test.go Refactor comment (#9330) 5 years ago
lfs.go LFS support to be stored on minio (#12518) 5 years ago
lfs_lock.go Make repository management section handle lfs locks (#8726) 5 years ago
list_options.go Add cron running API (#12421) 5 years ago
log.go Upgrade xorm to v1.0.0 (#10646) 5 years ago
login_source.go Use ID or Where to instead directly use Get when load object from database (#11925) 5 years ago
main_test.go Add gitea-vet (#10948) 5 years ago
migrate.go [BugFix] remove nil inserts in models (#11096) 5 years ago
models.go Add postgres schema to the search_path on database connection (#12634) 5 years ago
models_test.go gitea dump: include version & Check InstallLock (#12760) 5 years ago
notification.go API: NotificationSubject show Issue/Pull State (#12901) 5 years ago
notification_test.go add request review from specific reviewers feature in pull request (#10756) 5 years ago
oauth2.go Changed image of openid-connect logo for better look on arc-green theme (#11312) 5 years ago
oauth2_application.go Use google/uuid to instead satori/go.uuid (#11943) 5 years ago
oauth2_application_test.go OAuth2 Grant UI (#6625) 6 years ago
org.go Fix bug preventing transfer to private organization (#12497) 5 years ago
org_team.go Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team (#10997) 5 years ago
org_team_test.go API add/generalize pagination (#9452) 5 years ago
org_test.go Ensure DeleteUser is not allowed to Delete Orgs and visa versa (#10134) 5 years ago
project.go Kanban board (#8346) 5 years ago
project_board.go Kanban board (#8346) 5 years ago
project_issue.go Kanban board (#8346) 5 years ago
project_test.go Kanban board (#8346) 5 years ago
pull.go Cache PullRequest Divergence (#10914) 5 years ago
pull_list.go API add/generalize pagination (#9452) 5 years ago
pull_sign.go Add configurable Trust Models (#11712) 5 years ago
pull_test.go Display pull request head branch even the branch deleted or repository deleted (#10413) 5 years ago
release.go Add email notify for new release (#12463) 5 years ago
repo.go Add default storage configurations (#12813) 5 years ago
repo_activity.go Add top author stats to activity page (#9615) 5 years ago
repo_branch.go Move newbranch to standalone package (#9627) 5 years ago
repo_collaboration.go Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team (#10997) 5 years ago
repo_collaboration_test.go API add/generalize pagination (#9452) 5 years ago
repo_generate.go API add/generalize pagination (#9452) 5 years ago
repo_generate_test.go Variable expansion in repository templates (#9163) 5 years ago
repo_indexer.go Index code and stats only for non-empty repositories (#10251) 5 years ago
repo_issue.go Add EnableTimetracking option to app settings (#3719) 7 years ago
repo_language_stats.go Increase size of the language column in language_stat (#12396) 5 years ago
repo_list.go Adopt repositories (#12920) 5 years ago
repo_list_test.go API add/generalize pagination (#9452) 5 years ago
repo_mirror.go Move some repository methods from models to modules/repository (#9353) 5 years ago
repo_permission.go Fix deadlock when deleting team user (#13092) 5 years ago
repo_permission_test.go fix bug when update owner team then visit team's repo return 404 (#6119) 6 years ago
repo_redirect.go Move repoWorkPool outside rename/transfer repository (#9086) 5 years ago
repo_redirect_test.go Move repoWorkPool outside rename/transfer repository (#9086) 5 years ago
repo_sign.go Add configurable Trust Models (#11712) 5 years ago
repo_test.go Decrease the num_stars when deleting a repo (#11954) 5 years ago
repo_unit.go Kanban board (#8346) 5 years ago
repo_watch.go Add action feed for new release (#12324) 5 years ago
repo_watch_test.go API add/generalize pagination (#9452) 5 years ago
review.go Update Octicons to v10 (#12240) 5 years ago
review_test.go Update Octicons to v10 (#12240) 5 years ago
ssh_key.go Add ssh certificate support (#12281) 5 years ago
ssh_key_test.go Disable DSA ssh keys by default (#13056) 5 years ago
star.go API add/generalize pagination (#9452) 5 years ago
star_test.go API add/generalize pagination (#9452) 5 years ago
task.go [API] Migration: Change ServiceType String (#12672) 5 years ago
test_fixtures.go upgrade to use testfixtures v3 (#11904) 5 years ago
token.go [API] Delete Token accept names too (#12366) 5 years ago
token_test.go [API] Delete Token accept names too (#12366) 5 years ago
topic.go Add Primary Key to Topic and RepoTopic (#12639) 5 years ago
topic_test.go API add/generalize pagination (#9452) 5 years ago
twofactor.go Attachments: Add extension support, allow all types for releases (#12465) 5 years ago
u2f.go Display ui time with customize time location (#7792) 6 years ago
u2f_test.go Add gitea-vet (#10948) 5 years ago
unit.go Kanban board (#8346) 5 years ago
unit_tests.go Add default storage configurations (#12813) 5 years ago
update.go Remove Unused Functions (#10516) 5 years ago
upload.go Re-attempt to delete temporary upload if the file is locked by another process (#12447) 5 years ago
user.go Add ssh certificate support (#12281) 5 years ago
user_follow.go Refactor session close as xorm already does everything needed internally (#2020) 8 years ago
user_follow_test.go Add gitea-vet (#10948) 5 years ago
user_heatmap.go Add hide activity option (#11353) 5 years ago
user_heatmap_test.go Restricted users (#6274) 5 years ago
user_mail.go Use ID or Where to instead directly use Get when load object from database (#11925) 5 years ago
user_mail_test.go Admin page for managing user e-mail activation (#10557) 5 years ago
user_openid.go Use ID or Where to instead directly use Get when load object from database (#11925) 5 years ago
user_openid_test.go Add golangci (#6418) 6 years ago
user_test.go Fix "only mail on mention" bug (#12775) 5 years ago
userlist.go API add/generalize pagination (#9452) 5 years ago
userlist_test.go Team permission to create repository in organization (#8312) 5 years ago
webhook.go Use google/uuid to instead satori/go.uuid (#11943) 5 years ago
webhook_test.go Granular webhook events (#9626) 5 years ago
wiki.go Add owner_name column for table repository for maintaince reason (#9717) 5 years ago
wiki_test.go Move wiki related funtions from models to services/wiki (#9355) 5 years ago