asymkey

package
v0.0.0-...-d559fe2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrincipalKey

func AddPrincipalKey(ctx context.Context, ownerID int64, content string, authSourceID int64) (*asymkey_model.PublicKey, error)

AddPrincipalKey adds new principal to database and authorized_principals file.

func DeleteDeployKey

func DeleteDeployKey(ctx context.Context, repo *repo_model.Repository, id int64) error

DeleteDeployKey deletes deploy key from its repository authorized_keys file if needed. Permissions check should be done outside.

func DeletePublicKey

func DeletePublicKey(ctx context.Context, doer *user_model.User, id int64) (err error)

DeletePublicKey deletes SSH key information both in database and authorized_keys file.

func DeleteRepoDeployKeys

func DeleteRepoDeployKeys(ctx context.Context, repoID int64) (int, error)

DeleteRepoDeployKeys deletes all deploy keys of a repository. permissions check should be done outside

func IsErrWontSign

func IsErrWontSign(err error) bool

IsErrWontSign checks if an error is a ErrWontSign

func PublicSigningKey

func PublicSigningKey(ctx context.Context, repoPath string) (string, error)

PublicSigningKey gets the public signing key within a provided repository directory

func RewriteAllPrincipalKeys

func RewriteAllPrincipalKeys(ctx context.Context) error

RewriteAllPrincipalKeys removes any authorized principal and rewrite all keys from database again. Note: db.GetEngine(ctx).Iterate does not get latest data after insert/delete, so we have to call this function outside any session scope independently.

func RewriteAllPublicKeys

func RewriteAllPublicKeys(ctx context.Context) error

RewriteAllPublicKeys removes any authorized key and rewrite all keys from database again. Note: db.GetEngine(ctx).Iterate does not get latest data after insert/delete, so we have to call this function outside any session scope independently.

func SignCRUDAction

func SignCRUDAction(ctx context.Context, repoPath string, u *user_model.User, tmpBasePath, parentCommit string) (bool, string, *git.Signature, error)

SignCRUDAction determines if we should sign a CRUD commit to this repository

func SignInitialCommit

func SignInitialCommit(ctx context.Context, repoPath string, u *user_model.User) (bool, string, *git.Signature, error)

SignInitialCommit determines if we should sign the initial commit to this repository

func SignMerge

func SignMerge(ctx context.Context, pr *issues_model.PullRequest, u *user_model.User, tmpBasePath, baseCommit, headCommit string) (bool, string, *git.Signature, error)

SignMerge determines if we should sign a PR merge commit to the base repository

func SignWikiCommit

func SignWikiCommit(ctx context.Context, repo *repo_model.Repository, u *user_model.User) (bool, string, *git.Signature, error)

SignWikiCommit determines if we should sign the commits to this repository wiki

func SigningKey

func SigningKey(ctx context.Context, repoPath string) (string, *git.Signature)

SigningKey returns the KeyID and git Signature for the repo

Types

type ErrWontSign

type ErrWontSign struct {
	Reason signingMode
}

ErrWontSign explains the first reason why a commit would not be signed There may be other reasons - this is just the first reason found

func (*ErrWontSign) Error

func (e *ErrWontSign) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL