Documentation
¶
Index ¶
Constants ¶
View Source
const AuthRequestCallbackParameter = "redirect"
View Source
const AuthRequestCopyParameter = "sessioncopy"
View Source
const AuthRequestCopyParameterValue = "true"
View Source
const CallbackPath = "/"
View Source
const CallbackQueryParameter = "session"
View Source
const CallbackSuccessPage = `` /* 236-byte string literal not displayed */
Variables ¶
View Source
var PromptOpenBrowserURL = "You will now be taken to your browser for authentication. Or browse this URL {{.url}}\n"
View Source
var PromptPasteToken = "Please paste the displayed token"
View Source
var PromptPleaseOpen = "Please open {{.url}} in your Browser\n"
Functions ¶
func DefaultAuthRequestCallbackParameterValueFunc ¶
DefaultAuthRequestCallbackParameterValueFunc build the callback parameter from net.Listener example: "http://127.0.0.1:12345"
Types ¶
type AuthRequestCallbackValueFunc ¶
AuthRequestCallbackValueFunc gets the net.Listener from callback server and returns the callback parameter value
type CLIAuthToken ¶
type CLIAuthToken struct { // AuthRequestURL is the url to be opened in users browser AuthRequestURL string // AuthRequestCopyParameter is the parameter to signal the auth server to show // copy paste dialog AuthRequestCopyParameter string // AuthRequestCopyParameterValue AuthRequestCopyParameterValue string // The AuthRequestCallbackParameter defining the url parameter for redirect callback AuthRequestCallbackParameter string // AuthRequestCallbackParameterValueFunc is a function receiving net.Listener to return // a value for `AuthRequestCallbackParameter`. // By default DefaultAuthRequestCallbackParameterValueFunc is being used returning the // local server URL AuthRequestCallbackParameterValueFunc AuthRequestCallbackValueFunc // CallbackQueryParameter is the query paramter we expect the token as a value CallbackQueryParameter string // Use a different path than `/` for expecting the callback CallbackPath string // Define the returned html after successfull callback. CallbackSuccessPage string TokenTimeout time.Duration // Should be 127.0.0.1 ListenAddr string // Log specifies the logger to be used. `logrus.New()` is default Log *log.Logger }
func NewCLIAuthToken ¶
func NewCLIAuthToken(authRequestURL string) (clia *CLIAuthToken)
NewCLIAuthToken creates a new *CLIAuthToken with defaults
func (*CLIAuthToken) RequestTokenPasteable ¶
func (clia *CLIAuthToken) RequestTokenPasteable() string
func (*CLIAuthToken) RequestTokenRedirected ¶
func (clia *CLIAuthToken) RequestTokenRedirected() string
RequestTokenRedirected starts a local callback server and tries to open the users browser starting the callback procedure
Click to show internal directories.
Click to hide internal directories.