shared

package
v0.0.0-...-1b8ee3a Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AckRequestPrefix = "AckRequest--"
View Source
const SSHCAConfigKey = "kssh_config"

The name of the KV store entry key for the kssh client config

View Source
const SSHCANamespace = "__sshca"

The name of the KV store namespace for all bot-sshca-related data

View Source
const SignatureRequestPreamble = "Signature_Request:"

The preamble used at the start of signature request messages

View Source
const SignatureResponsePreamble = "Signature_Response:"

The preamble used at the start of signature response messages

Variables

This section is empty.

Functions

func CanRoleReadTeam

func CanRoleReadTeam(role keybase1.TeamRole) bool

CanRoleReadTeam checks if given role can access team data. User has to be an actual team member (not implicit admin) to be able to access data, and cannot be a RESTRICTED BOT.

func ExpandPathWithTilde

func ExpandPathWithTilde(path string) string

Expand out a path that starts with a tilde to be an absolute path

func GenerateAckRequest

func GenerateAckRequest(username string) string

Generate an AckRequest for the given username

func GenerateAckResponse

func GenerateAckResponse(ackRequest string) string

Generate an AckResponse in response to the given ack request

func GeneratePingRequest

func GeneratePingRequest(username string) string

Generate a ping request message

func GeneratePingResponse

func GeneratePingResponse(username string) string

Generate a ping response message

func GetAllTeams

func GetAllTeams(api *kbchat.API) (teams []string, err error)

GetAllTeams makes an API call and returns list of team names readable for current user.

func IsAckRequest

func IsAckRequest(msg string) bool

Returns whether the given message is an ack request

func IsAckResponse

func IsAckResponse(msg string) bool

Returns whether the given message is an ack response

func IsPingRequest

func IsPingRequest(msg, botUsername string) bool

Returns whether the given message is a ping request

func IsPingResponse

func IsPingResponse(msg, localUsername string) bool

Returns whether the given message is a ping response

func KeyPathToCert

func KeyPathToCert(keyPath string) string

Returns the location of the signature associated with the given private key

func KeyPathToPubKey

func KeyPathToPubKey(keyPath string) string

Returns the location of the public key associated with the given private key

func PubKeyPathToKeyPath

func PubKeyPathToKeyPath(pubKeyPath string) string

Returns the location of the private key associated with the given public key

Types

type SignatureRequest

type SignatureRequest struct {
	SSHPublicKey string `json:"ssh_public_key"`
	UUID         string `json:"uuid"`
	Username     string `json:"-"`
	DeviceName   string `json:"-"`
}

The body of signature request messages sent over KB chat

func ParseSignatureRequest

func ParseSignatureRequest(body string) (SignatureRequest, error)

Parse the given string as a serialized SignatureRequest

type SignatureResponse

type SignatureResponse struct {
	SignedKey string `json:"signed_key"`
	UUID      string `json:"uuid"`
}

The body of signature response messages sent over KB chat

func ParseSignatureResponse

func ParseSignatureResponse(body string) (SignatureResponse, error)

Parse the given string as a serialized SignatureResponse

Jump to

Keyboard shortcuts

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