mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
feat(api): add OIDC session service (#6157)
This PR starts the OIDC implementation for the API V2 including the Implicit and Code Flow. Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Tim Möhlmann <[email protected]> Co-authored-by: Stefan Benz <[email protected]>
This commit is contained in:
co-authored by
Tim Möhlmann
Stefan Benz
parent
be1fe36776
commit
14b8cf4894
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -18,9 +19,11 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/query/projection"
|
||||
"github.com/zitadel/zitadel/internal/repository/action"
|
||||
"github.com/zitadel/zitadel/internal/repository/authrequest"
|
||||
"github.com/zitadel/zitadel/internal/repository/idpintent"
|
||||
iam_repo "github.com/zitadel/zitadel/internal/repository/instance"
|
||||
"github.com/zitadel/zitadel/internal/repository/keypair"
|
||||
"github.com/zitadel/zitadel/internal/repository/oidcsession"
|
||||
"github.com/zitadel/zitadel/internal/repository/org"
|
||||
"github.com/zitadel/zitadel/internal/repository/project"
|
||||
"github.com/zitadel/zitadel/internal/repository/session"
|
||||
@@ -88,6 +91,8 @@ func StartQueries(
|
||||
usergrant.RegisterEventMappers(repo.eventstore)
|
||||
session.RegisterEventMappers(repo.eventstore)
|
||||
idpintent.RegisterEventMappers(repo.eventstore)
|
||||
authrequest.RegisterEventMappers(repo.eventstore)
|
||||
oidcsession.RegisterEventMappers(repo.eventstore)
|
||||
|
||||
repo.idpConfigEncryption = idpConfigEncryption
|
||||
repo.multifactors = domain.MultifactorConfigs{
|
||||
@@ -115,3 +120,19 @@ func (q *Queries) Health(ctx context.Context) error {
|
||||
type prepareDatabase interface {
|
||||
Timetravel(d time.Duration) string
|
||||
}
|
||||
|
||||
// cleanStaticQueries removes whitespaces,
|
||||
// such as ` `, \t, \n, from queries to improve
|
||||
// readability in logs and errors.
|
||||
func cleanStaticQueries(qs ...*string) {
|
||||
regex := regexp.MustCompile(`\s+`)
|
||||
for _, q := range qs {
|
||||
*q = regex.ReplaceAllString(*q, " ")
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
cleanStaticQueries(
|
||||
&authRequestByIDQuery,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user