Documentation ¶
Index ¶
- Constants
- func EncodePluginData(data PluginData) (map[string]string, error)
- func MsgFields(reqID string, reqData pd.AccessRequestData, clusterName string, ...) string
- func MsgReview(review types.AccessReview) (string, error)
- func MsgStatusText(tag pd.ResolutionTag, reason string) string
- func NewApp(bot MessagingBot) common.App
- type App
- type MessageData
- type MessagingBot
- type PluginData
- type SentMessages
Constants ¶
const (
ReviewReasonLimit
)
Slack has a 4000 character limit for message texts and 3000 character limit for message section texts, so we truncate all reasons to a generous but conservative limit
Variables ¶
This section is empty.
Functions ¶
func EncodePluginData ¶
func EncodePluginData(data PluginData) (map[string]string, error)
EncodePluginData serializes a PluginData struct into a string map.
func MsgStatusText ¶
func MsgStatusText(tag pd.ResolutionTag, reason string) string
func NewApp ¶
func NewApp(bot MessagingBot) common.App
NewApp will create a new access request application.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the access request application for plugins. This will notify when access requests are created and reviewed.
func (*App) WaitForDone ¶
func (a *App) WaitForDone()
WaitForDone will wait until the job has completed.
type MessageData ¶
type MessageData struct { // ChannelID identifies a channel. ChannelID string // MessageID identifies a specific message in the channel. // For example: on Discord this is an ID while on Slack this is a timestamp. MessageID string }
MessageData contains all the required information to identify and edit a message.
type MessagingBot ¶
type MessagingBot interface { common.MessagingBot // BroadcastAccessRequestMessage sends an access request message to a list of Recipient BroadcastAccessRequestMessage(ctx context.Context, recipients []common.Recipient, reqID string, reqData pd.AccessRequestData) (data SentMessages, err error) // PostReviewReply posts in thread an access request review. This does nothing if the messaging service // does not support threaded replies. PostReviewReply(ctx context.Context, channelID string, threadID string, review types.AccessReview) error // UpdateMessages updates access request messages that were previously sent via Broadcast // This is used to change the access-request status and number of required approval remaining UpdateMessages(ctx context.Context, reqID string, data pd.AccessRequestData, messageData SentMessages, reviews []types.AccessReview) error }
type PluginData ¶
type PluginData struct { plugindata.AccessRequestData SentMessages }
PluginData is a data associated with access request that we store in Teleport using UpdatePluginData API.
func DecodePluginData ¶
func DecodePluginData(dataMap map[string]string) (PluginData, error)
DecodePluginData deserializes a string map to PluginData struct.
type SentMessages ¶
type SentMessages []MessageData