Documentation ¶
Index ¶
Constants ¶
View Source
const (
PKCEChallengeMethodS256 = "S256"
)
Variables ¶
View Source
var ErrNotLoggedIn = errors.New("not logged in")
Functions ¶
func EnsureLoggedIn ¶
func EnsureLoggedIn(ctx context.Context, executor LoginExecutor) (connector.LoginResult_Code, error)
EnsureLoggedIn will check if the user is logged in and if not initiate the login flow.
Types ¶
type CodeVerifier ¶
type CodeVerifier string
func NewCodeVerifier ¶
func NewCodeVerifier() (CodeVerifier, error)
func (CodeVerifier) CodeChallengePlain ¶
func (v CodeVerifier) CodeChallengePlain() string
func (CodeVerifier) CodeChallengeS256 ¶
func (v CodeVerifier) CodeChallengeS256() string
func (CodeVerifier) String ¶
func (v CodeVerifier) String() string
type LoginExecutor ¶
type LoginExecutor interface { Worker(ctx context.Context) error Login(ctx context.Context) error Logout(ctx context.Context) error GetToken(ctx context.Context) (string, error) GetAPIKey(ctx context.Context, description string) (string, error) GetUserInfo(ctx context.Context) (*authdata.UserInfo, error) }
LoginExecutor controls the execution of a login flow
func NewLoginExecutor ¶
func NewLoginExecutor( env client.Env, saveTokenFunc func(context.Context, *oauth2.Token) error, saveUserInfoFunc func(context.Context, *authdata.UserInfo) error, openURLFunc func(string) error, stdout io.Writer, scout chan<- scout.ScoutReport, ) LoginExecutor
NewLoginExecutor returns an instance of LoginExecutor
func NewStandardLoginExecutor ¶
func NewStandardLoginExecutor(env client.Env, stdout io.Writer, scout chan<- scout.ScoutReport) LoginExecutor
Click to show internal directories.
Click to hide internal directories.