mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-14 15:28:28 +02:00
move directory providers (#3633)
* remove directory providers and support for groups * idp: remove directory providers * better error messages * fix errors * restore postgres * fix test
This commit is contained in:
parent
bb5c80bae9
commit
c178819875
78 changed files with 723 additions and 8703 deletions
|
@ -3,24 +3,18 @@ package manager
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/directory"
|
||||
"github.com/pomerium/pomerium/internal/events"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
)
|
||||
|
||||
var (
|
||||
defaultGroupRefreshInterval = 15 * time.Minute
|
||||
defaultGroupRefreshTimeout = 10 * time.Minute
|
||||
defaultSessionRefreshGracePeriod = 1 * time.Minute
|
||||
defaultSessionRefreshCoolOffDuration = 10 * time.Second
|
||||
)
|
||||
|
||||
type config struct {
|
||||
authenticator Authenticator
|
||||
directory directory.Provider
|
||||
dataBrokerClient databroker.DataBrokerServiceClient
|
||||
groupRefreshInterval time.Duration
|
||||
groupRefreshTimeout time.Duration
|
||||
sessionRefreshGracePeriod time.Duration
|
||||
sessionRefreshCoolOffDuration time.Duration
|
||||
now func() time.Time
|
||||
|
@ -29,8 +23,6 @@ type config struct {
|
|||
|
||||
func newConfig(options ...Option) *config {
|
||||
cfg := new(config)
|
||||
WithGroupRefreshInterval(defaultGroupRefreshInterval)(cfg)
|
||||
WithGroupRefreshTimeout(defaultGroupRefreshTimeout)(cfg)
|
||||
WithSessionRefreshGracePeriod(defaultSessionRefreshGracePeriod)(cfg)
|
||||
WithSessionRefreshCoolOffDuration(defaultSessionRefreshCoolOffDuration)(cfg)
|
||||
WithNow(time.Now)(cfg)
|
||||
|
@ -50,13 +42,6 @@ func WithAuthenticator(authenticator Authenticator) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithDirectoryProvider sets the directory provider in the config.
|
||||
func WithDirectoryProvider(directoryProvider directory.Provider) Option {
|
||||
return func(cfg *config) {
|
||||
cfg.directory = directoryProvider
|
||||
}
|
||||
}
|
||||
|
||||
// WithDataBrokerClient sets the databroker client in the config.
|
||||
func WithDataBrokerClient(dataBrokerClient databroker.DataBrokerServiceClient) Option {
|
||||
return func(cfg *config) {
|
||||
|
@ -64,20 +49,6 @@ func WithDataBrokerClient(dataBrokerClient databroker.DataBrokerServiceClient) O
|
|||
}
|
||||
}
|
||||
|
||||
// WithGroupRefreshInterval sets the group refresh interval used by the manager.
|
||||
func WithGroupRefreshInterval(interval time.Duration) Option {
|
||||
return func(cfg *config) {
|
||||
cfg.groupRefreshInterval = interval
|
||||
}
|
||||
}
|
||||
|
||||
// WithGroupRefreshTimeout sets the group refresh timeout used by the manager.
|
||||
func WithGroupRefreshTimeout(timeout time.Duration) Option {
|
||||
return func(cfg *config) {
|
||||
cfg.groupRefreshTimeout = timeout
|
||||
}
|
||||
}
|
||||
|
||||
// WithSessionRefreshGracePeriod sets the session refresh grace period used by the manager.
|
||||
func WithSessionRefreshGracePeriod(dur time.Duration) Option {
|
||||
return func(cfg *config) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue