saml

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenTypeBearer = "Bearer"
)

Variables

This section is empty.

Functions

func NewSAMLMiddleware

func NewSAMLMiddleware(ctx context.Context, opts *Opts, client *http.Client) (*samlsp.Middleware, error)

Types

type AuthorizationRequest

type AuthorizationRequest struct {
	ClientID string
	Scopes   string
	State    string
}

func (*AuthorizationRequest) Parse

func (r *AuthorizationRequest) Parse(req *http.Request)

type BackendToken

type BackendToken struct {
	Expiry    time.Time
	Email     string
	FirstName string
	LastName  string
	Raw       string
}

type Handler

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

func NewHandler

func NewHandler(runner *model.Runner, deepsource *model.DeepSource, middleware *samlsp.Middleware, tokenService *token.Service, store store.Store) *Handler

func (*Handler) AuthorizationHandler

func (h *Handler) AuthorizationHandler() echo.HandlerFunc

func (*Handler) HandleRefresh

func (h *Handler) HandleRefresh(c echo.Context) error

func (*Handler) HandleSession

func (h *Handler) HandleSession(c echo.Context) error

func (*Handler) HandleToken

func (h *Handler) HandleToken(c echo.Context) error

func (*Handler) SAMLHandler

func (h *Handler) SAMLHandler() echo.HandlerFunc

type Opts

type Opts struct {
	Certificate *tls.Certificate
	MetadataURL url.URL
	RootURL     url.URL
}

type RefreshRequest

type RefreshRequest struct {
	AppID        string `param:"app_id"`
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RefreshToken string `json:"refresh_token"`
}

type Session

type Session struct {
	ID               string
	AccessCode       string
	AccessCodeExpiry time.Time
	BackendToken     *BackendToken
	RunnerToken      *oauth2.Token
}

func NewSession

func NewSession() *Session

func (*Session) GenerateRunnerToken

func (s *Session) GenerateRunnerToken(expiry time.Time)

func (*Session) SetAccessCode

func (s *Session) SetAccessCode(code string)

func (*Session) SetBackendToken

func (s *Session) SetBackendToken(raw string) error

func (*Session) UnsetAccessCode

func (s *Session) UnsetAccessCode()

type SessionRequest

type SessionRequest struct {
	State string `query:"state"`
}

type SessionStore

type SessionStore interface {
	Create(*Session) error
	Update(*Session) error
	Delete(string) error
	GetByID(string) (*Session, error)
	GetByAccessToken(string) (*Session, error)
	GetByRefreshToken(string) (*Session, error)
	GetByAccessCode(string) (*Session, error)
}

type TokenRequest

type TokenRequest struct {
	Code         string `query:"code" json:"code"`
	ClientID     string `query:"client_id" json:"client_id"`
	ClientSecret string `query:"client_secret" json:"client_secret"`
}

Directories

Path Synopsis
persistence

Jump to

Keyboard shortcuts

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