Remove fmt.Println and add Zerolog logging system
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m2s

This commit is contained in:
2024-11-11 20:35:17 +01:00
parent 4ae6aa7a90
commit 5e4cea0bb3
11 changed files with 88 additions and 55 deletions

View File

@@ -4,7 +4,9 @@ import (
"context"
"crypto/rsa"
"errors"
"net/url"
"reflect"
"strings"
"time"
"git.coopgo.io/coopgo-platform/mobility-accounts/handlers"
@@ -18,7 +20,14 @@ import (
func NewProvider(c OIDCNamespaceConfig, h handlers.MobilityAccountsHandler, s storage.Storage, privateKey *rsa.PrivateKey) fosite.OAuth2Provider {
config := &compose.Config{}
config := &compose.Config{
RedirectSecureChecker: func(checkUrl *url.URL) bool {
if strings.HasSuffix(checkUrl.Host, "svc.cluster.local") || strings.HasSuffix(checkUrl.Host, "localhost") {
return true
}
return false
},
}
storage := NewOIDCProviderStore(c, h, s.KV)
secret := []byte(c.SecretKey)
return compose.ComposeAllEnabled(config, storage, secret, privateKey)