Documentation ¶
Overview ¶
Package oauth provides oauth capabilities to barista and modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InteractiveSetup ¶
func InteractiveSetup()
InteractiveSetup checks each registered config and guides the user through a command-line interactive auth process for each config that doesn't have a valid token. Only intended for use by barista's Run() method, calling it at the wrong time can leave you unable to save tokens for some configs.
func SetEncryptionKey ¶
func SetEncryptionKey(key []byte)
SetEncryptionKey sets the global encryption key for the oauth package. All site-specific encryption keys are derived from the global encryption key. For that reason this is a very high-value key, and should be stored properly, for example, using libsecret.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents a oauth configuration for use in barista. It can be used to create an authenticated client after the user has setup oauth for barista using the InteractiveSetup() method.
func Register ¶
Register registers an oauth2 configuration with barista's oauth package. Only configurations that are registered *before* Run() is called will be added to the interactive oauth setup, so modules should usually call this either in init() or in their New() functions.