publisher

package
v0.0.0-...-d101fb3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotDetermineUser = ihttp.NewError("cannot determine user", http.StatusInternalServerError)
	ErrRenderFailure       = ihttp.NewError("failed to render page", http.StatusInternalServerError)
)

Functions

This section is empty.

Types

type OIDCClientConfig

type OIDCClientConfig struct {
	URL          config.URL
	ClientID     string
	ClientSecret string
}

type Options

type Options struct {
	Development  bool `conf:"-"`
	OIDC         OIDCClientConfig
	BaseURL      *config.URL
	VCSRemoteURL *config.URL `conf:"default:https://git.alin.ovh/website"`
}

type Service

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

func New

func New(opts *Options, log *log.Logger) (*Service, error)

func (*Service) Callback

func (s *Service) Callback(w http.ResponseWriter, r *http.Request) error

Callback handles the OIDC provider's redirect after authentication. It verifies the state parameter (CSRF protection), exchanges the authorization code for tokens using the PKCE verifier, validates the ID token, and creates a session.

func (*Service) Index

func (s *Service) Index(w http.ResponseWriter, r *http.Request) error

func (*Service) Login

func (s *Service) Login(w http.ResponseWriter, r *http.Request) error

Login initiates the OIDC authentication flow with PKCE S256. PKCE (Proof Key for Code Exchange) protects against authorization code interception attacks by using a cryptographically random verifier and its SHA256 hash challenge. See: https://www.rfc-editor.org/rfc/rfc7636

func (*Service) Logout

func (s *Service) Logout(w http.ResponseWriter, r *http.Request) error

func (*Service) RegisterHandlers

func (s *Service) RegisterHandlers(mux *ihttp.ServeMux)

func (*Service) Style

func (s *Service) Style(w http.ResponseWriter, r *http.Request) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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