cmd

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogAction

func LogAction(msg string) func(string)

func LogAssertion

func LogAssertion(request oauth2.Request, title string, name string)

func LogAuthMethod

func LogAuthMethod(config oauth2.ClientConfig)

func LogBox

func LogBox(title string, msg string, args ...interface{})

func LogError

func LogError(err error)

func LogHeader

func LogHeader(msg string)

func LogInputData

func LogInputData(cc oauth2.ClientConfig)

func LogJARM

func LogJARM(request oauth2.Request)

func LogJson

func LogJson(value interface{})

func LogKey

func LogKey(name string, key interface{})

func LogRequest

func LogRequest(r oauth2.Request)

func LogRequestAndResponse

func LogRequestAndResponse(request oauth2.Request, response interface{})

func LogRequestAndResponseln

func LogRequestAndResponseln(request oauth2.Request, response interface{})

func LogRequestObject

func LogRequestObject(r oauth2.Request)

func LogRequestln

func LogRequestln(request oauth2.Request)

func LogSection

func LogSection(msg string)

func LogSubjectTokenAndActorToken

func LogSubjectTokenAndActorToken(request oauth2.Request)

func LogTokenPayload

func LogTokenPayload(response oauth2.TokenResponse)

func LogTokenPayloadln

func LogTokenPayloadln(response oauth2.TokenResponse)

func LogWarning

func LogWarning(msg string)

func Logfln

func Logfln(msg string, args ...interface{})

func Logln

func Logln()

func PromptBool

func PromptBool(name string) (ret bool)

func PromptForClientConfig

func PromptForClientConfig(client oauth2.ClientConfig, server oauth2.ServerConfig) oauth2.ClientConfig

func PromptMultiStringSlice

func PromptMultiStringSlice(name string, options []string) (ret []string)

func PromptString

func PromptString(name string) (ret string)

func PromptStringSlice

func PromptStringSlice(name string, options []string) (ret string)

Types

type Config

type Config struct {
	ClientID                string `json:"client_id"`
	ClientSecret            string `json:"client_secret"`
	OpenIDDiscoveryEndpoint string `json:"openid_discovery_endpoint"`
}

func (Config) ToClientConfig

func (c Config) ToClientConfig() oauth2.ClientConfig

type OAuth2Cmd

type OAuth2Cmd struct {
	*cobra.Command
}

func NewOAuth2Cmd

func NewOAuth2Cmd() (cmd *OAuth2Cmd)

func (*OAuth2Cmd) AuthorizationCodeGrantFlow

func (c *OAuth2Cmd) AuthorizationCodeGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) Authorize

func (c *OAuth2Cmd) Authorize(clientConfig oauth2.ClientConfig, hc *http.Client) error

func (*OAuth2Cmd) ClientCredentialsGrantFlow

func (c *OAuth2Cmd) ClientCredentialsGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) DeviceGrantFlow

func (c *OAuth2Cmd) DeviceGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) ImplicitGrantFlow

func (c *OAuth2Cmd) ImplicitGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) JWTBearerGrantFlow

func (c *OAuth2Cmd) JWTBearerGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) PasswordGrantFlow

func (c *OAuth2Cmd) PasswordGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) PrintResult

func (c *OAuth2Cmd) PrintResult(result interface{})

func (*OAuth2Cmd) RefreshTokenGrantFlow

func (c *OAuth2Cmd) RefreshTokenGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

func (*OAuth2Cmd) Run

func (c *OAuth2Cmd) Run(cconfig *oauth2.ClientConfig) func(cmd *cobra.Command, args []string)

func (*OAuth2Cmd) TokenExchangeGrantFlow

func (c *OAuth2Cmd) TokenExchangeGrantFlow(clientConfig oauth2.ClientConfig, serverConfig oauth2.ServerConfig, hc *http.Client) error

Jump to

Keyboard shortcuts

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