Documentation ¶
Index ¶
Constants ¶
View Source
const ( /* #nosec */ SigstoreDeviceURL = "https://oauth2.sigstore.dev/auth/device/code" /* #nosec */ SigstoreTokenURL = "https://oauth2.sigstore.dev/auth/device/token" )
View Source
const (
PKCES256 = "S256"
)
Variables ¶
View Source
var DefaultIDTokenGetter = &InteractiveIDTokenGetter{ MessagePrinter: func(url string) { fmt.Fprintf(os.Stderr, "Your browser will now be opened to:\n%s\n", url) }, HTMLPage: htmlPage, }
DefaultIDTokenGetter is the default implementation. The HTML page and message printed to the terminal can be customized.
Functions ¶
Types ¶
type DeviceFlowTokenGetter ¶
type DeviceFlowTokenGetter struct { MessagePrinter func(string) Sleeper func(time.Duration) Issuer string CodeURL string TokenURL string }
func NewDeviceFlowTokenGetter ¶
func NewDeviceFlowTokenGetter(issuer, codeURL, tokenURL string) *DeviceFlowTokenGetter
func (*DeviceFlowTokenGetter) GetIDToken ¶
func (d *DeviceFlowTokenGetter) GetIDToken(p *oidc.Provider, cfg oauth2.Config) (*OIDCIDToken, error)
type InteractiveIDTokenGetter ¶
InteractiveIDTokenGetter is a type to get ID tokens for oauth flows
func (*InteractiveIDTokenGetter) GetIDToken ¶
func (i *InteractiveIDTokenGetter) GetIDToken(p *oidc.Provider, cfg oauth2.Config) (*OIDCIDToken, error)
type OIDCIDToken ¶
func OIDConnect ¶
func OIDConnect(issuer string, id string, secret string, tg TokenGetter) (*OIDCIDToken, error)
type PKCE ¶
func (*PKCE) AuthURLOpts ¶
func (p *PKCE) AuthURLOpts() []oauth2.AuthCodeOption
func (*PKCE) TokenURLOpts ¶
func (p *PKCE) TokenURLOpts() []oauth2.AuthCodeOption
type StaticTokenGetter ¶
type StaticTokenGetter struct {
RawToken string
}
func (*StaticTokenGetter) GetIDToken ¶
func (stg *StaticTokenGetter) GetIDToken(_ *oidc.Provider, _ oauth2.Config) (*OIDCIDToken, error)
type TokenGetter ¶
Click to show internal directories.
Click to hide internal directories.