git

package
v0.0.0-...-48c56db Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMetadata

func DeleteMetadata(ctx context.Context, g *libkb.GlobalContext, folder keybase1.FolderHandle, repoName keybase1.GitRepoName) error

func HumanizeGitErrors

func HumanizeGitErrors(ctx context.Context, g *libkb.GlobalContext, err error) error

For errors that expect, replace them with nice strings for the user. The GUI will show these directly.

Types

type ByRepoMtime

type ByRepoMtime []keybase1.GitRepoResult

func (ByRepoMtime) Len

func (c ByRepoMtime) Len() int

func (ByRepoMtime) Less

func (c ByRepoMtime) Less(i, j int) bool

func (ByRepoMtime) Swap

func (c ByRepoMtime) Swap(i, j int)

type Crypto

type Crypto struct {
	libkb.Contextified
}

Crypto implements Cryptoer interface.

func NewCrypto

func NewCrypto(g *libkb.GlobalContext) *Crypto

NewCrypto returns a Crypto object.

func (*Crypto) Box

Box encrypts the plaintext with the most current key for the given team. It yields a NaCl ciphertext and nonce, and also says which generation of the key it used.

func (*Crypto) Unbox

func (c *Crypto) Unbox(ctx context.Context, teamSpec keybase1.TeamIDWithVisibility, metadata *keybase1.EncryptedGitMetadata) (plaintext []byte, err error)

Unbox decrypts the given ciphertext with the given nonce, for the given generation of the given team. Can return an error. Will return a non-nil plaintext on success.

type Cryptoer

type Cryptoer interface {
	// Box encrypts the plaintext with the most current key for the given team. It yields a NaCl
	// ciphertext and nonce, and also says which generation of the key it used.
	Box(ctx context.Context, plaintext []byte, team keybase1.TeamIDWithVisibility) (*keybase1.EncryptedGitMetadata, error)
	// Unbox decrypts the given ciphertext with the given nonce, for the given generation of the
	// given team. Can return an error. Will return a non-nil plaintext on success.
	Unbox(ctx context.Context, team keybase1.TeamIDWithVisibility, metadata *keybase1.EncryptedGitMetadata) (plaintext []byte, err error)
}

Cryptoer handles crypto operations to encrypt and decrypt data as it is sent to or received from the server-side Git index.

type ServerResponse

type ServerResponse struct {
	Repos  []ServerResponseRepo `json:"repos"`
	Status libkb.AppStatus      `json:"status"`
}

func (*ServerResponse) GetAppStatus

func (r *ServerResponse) GetAppStatus() *libkb.AppStatus

For GetDecode.

type ServerResponseRepo

type ServerResponseRepo struct {
	TeamID                keybase1.TeamID               `json:"team_id"`
	RepoID                keybase1.RepoID               `json:"repo_id"`
	CTime                 time.Time                     `json:"ctime"`
	MTime                 time.Time                     `json:"mtime"`
	EncryptedMetadata     string                        `json:"encrypted_metadata"`
	EncryptionVersion     int                           `json:"encryption_version"`
	Nonce                 string                        `json:"nonce"`
	KeyGeneration         keybase1.PerTeamKeyGeneration `json:"key_generation"`
	LastModifyingUID      keybase1.UID                  `json:"last_writer_uid"`
	LastModifyingDeviceID keybase1.DeviceID             `json:"last_writer_device_id"`
	ChatConvID            string                        `json:"chat_conv_id"`
	ChatDisabled          bool                          `json:"chat_disabled"`
	IsImplicit            bool                          `json:"is_implicit"`
	Role                  keybase1.TeamRole             `json:"role"`
}

type Teamer

type Teamer interface {
	// LookupOrCreate either lookups or creates a team that corresponds to the given Folder
	// Does not create new named teams.
	LookupOrCreate(ctx context.Context, folder keybase1.FolderHandle) (teamID keybase1.TeamIDWithVisibility, err error)
}

Teamer handles teams for use with the Git index

func NewTeamer

func NewTeamer(g *libkb.GlobalContext) Teamer

type TeamerImpl

type TeamerImpl struct {
	libkb.Contextified
}

func (*TeamerImpl) LookupOrCreate

func (t *TeamerImpl) LookupOrCreate(ctx context.Context, folder keybase1.FolderHandle) (res keybase1.TeamIDWithVisibility, err error)

Jump to

Keyboard shortcuts

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