William Petit
de70fa89f7
Some checks are pending
Cadoles/bouncer/pipeline/pr-develop Build started...
30 lines
978 B
Go
30 lines
978 B
Go
package setup
|
|
|
|
import (
|
|
"forge.cadoles.com/cadoles/bouncer/internal/config"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/proxy/director"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/proxy/director/layer/authn"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/proxy/director/layer/authn/oidc"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/schema"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/session"
|
|
"forge.cadoles.com/cadoles/bouncer/internal/session/adapter/redis"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func init() {
|
|
extended, err := schema.Extend(authn.RawLayerOptionsSchema, oidc.RawLayerOptionsSchema)
|
|
if err != nil {
|
|
panic(errors.Wrap(err, "could not extend authn base layer options schema"))
|
|
}
|
|
|
|
RegisterLayer(oidc.LayerType, setupAuthnOIDCLayer, extended)
|
|
}
|
|
|
|
func setupAuthnOIDCLayer(conf *config.Config) (director.Layer, error) {
|
|
rdb := newRedisClient(conf.Redis)
|
|
adapter := redis.NewStoreAdapter(rdb)
|
|
store := session.NewStore(adapter)
|
|
|
|
return oidc.NewLayer(store), nil
|
|
}
|