oauthext

package
v0.0.0-...-f3262af Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientIDDoc

type ClientIDDoc struct {
	Context                []string `json:"@context"`
	ClientID               string   `json:"client_id"`
	ClientName             string   `json:"client_name"`
	RedirectURIs           []string `json:"redirect_uris"`
	PostLogoutRedirectURIs []string `json:"post_logout_redirect_uris"`
	ClientURI              string   `json:"client_uri"`
	LogoURI                string   `json:"logo_uri"`
	TosURI                 string   `json:"tos_uri"`
	Scope                  string   `json:"scope"`
	GrantTypes             []string `json:"grant_types"`
	ResponseTypes          []string `json:"response_types"`
	DefaultMaxAge          int      `json:"default_max_age"`
	RequireAuthTime        bool     `json:"require_auth_time"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server creates a server to be used as part of client registration in the solid-oidc protocol. As discussed in https://solid.github.io/solid-oidc/#clientids the client identifies itself to the OIDC provider by presenting a URL

func NewServer

func NewServer(config oauth2.Config, verifier *oidc.IDTokenVerifier, listener net.Listener, log logr.Logger) (*Server, error)

func (*Server) Address

func (s *Server) Address() string

func (*Server) AuthStartURL

func (s *Server) AuthStartURL() string

AuthStartURL returns the URL to kickoff the oauth login flow.

func (*Server) HealthCheck

func (s *Server) HealthCheck(w http.ResponseWriter, r *http.Request)

func (*Server) NotFoundHandler

func (s *Server) NotFoundHandler(w http.ResponseWriter, r *http.Request)

func (*Server) StartAndBlock

func (s *Server) StartAndBlock() error

StartAndBlock starts the server and blocks.

func (*Server) TokenSource

func (s *Server) TokenSource() oauth2.TokenSource

type SolidOIDCHelper

type SolidOIDCHelper struct {
	Log logr.Logger
	// contains filtered or unexported fields
}

SolidOIDCHelper implements the CredentialHelper interface defined in https://github.com/kubeflow/internal-acls/blob/master/google_groups/pkg/gcp/credentials.go#L28

func NewSolidOIDCHelper

func NewSolidOIDCHelper(clientID string, oidcProviderUri string, log logr.Logger) (*SolidOIDCHelper, error)

NewSolidOIDCHelper creates a new instance of the helper to obtain solid OIDC credentaisl. clientID: This should be the URI hosting the client id document describing the application. oidcProviderUri: The URI of the OIDC provider

This will start a server to accept the callbacks that will contain the credentials.

func (*SolidOIDCHelper) GetOAuthConfig

func (h *SolidOIDCHelper) GetOAuthConfig() *oauth2.Config

func (*SolidOIDCHelper) GetTokenSource

func (h *SolidOIDCHelper) GetTokenSource(ctx context.Context) (oauth2.TokenSource, error)

GetTokenSource requests a token from the web, then returns the retrieved token.

Jump to

Keyboard shortcuts

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