oidcclient

package
v1.16.2-pipedrive Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package oidcclient provides a client of OpenID Connect.

Index

Constants

This section is empty.

Variables

Set provides an implementation and interface for OIDC.

Functions

This section is empty.

Types

type AuthCodeURLInput

type AuthCodeURLInput struct {
	State               string
	Nonce               string
	CodeChallenge       string
	CodeChallengeMethod string
	RedirectURI         string
}

type Config

type Config struct {
	IssuerURL     string
	ClientID      string
	ClientSecret  string
	ExtraScopes   []string // optional
	CertPool      certpool.Interface
	SkipTLSVerify bool
}

Config represents a configuration of OpenID Connect client.

type ExchangeAuthCodeInput

type ExchangeAuthCodeInput struct {
	Code         string
	CodeVerifier string
	Nonce        string
	RedirectURI  string
}

type Factory

type Factory struct {
	Logger logger.Interface
}

func (*Factory) New

func (f *Factory) New(ctx context.Context, config Config) (Interface, error)

New returns an instance of adaptors.Interface with the given configuration.

type FactoryInterface

type FactoryInterface interface {
	New(ctx context.Context, config Config) (Interface, error)
}

type GetTokenByAuthCodeInput

type GetTokenByAuthCodeInput struct {
	BindAddress         []string
	Nonce               string
	CodeChallenge       string
	CodeChallengeMethod string
	CodeVerifier        string
}

type Interface

type Interface interface {
	GetAuthCodeURL(in AuthCodeURLInput) string
	ExchangeAuthCode(ctx context.Context, in ExchangeAuthCodeInput) (*TokenSet, error)
	GetTokenByAuthCode(ctx context.Context, in GetTokenByAuthCodeInput, localServerReadyChan chan<- string) (*TokenSet, error)
	GetTokenByROPC(ctx context.Context, username, password string) (*TokenSet, error)
	Refresh(ctx context.Context, refreshToken string) (*TokenSet, error)
}

type TokenSet

type TokenSet struct {
	IDToken        string
	RefreshToken   string
	IDTokenSubject string
	IDTokenExpiry  time.Time
	IDTokenClaims  map[string]string // string representation of claims for logging
}

TokenSet represents an output DTO of Interface.GetTokenByAuthCode, Interface.GetTokenByROPC and Interface.Refresh.

Directories

Path Synopsis
Package mock_oidcclient is a generated GoMock package.
Package mock_oidcclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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