mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-11 00:25:12 +00:00
feat: add delete session on relation tables (#11334)
# Which Problems Are Solved As part of moving the session API to the relational database, this PR adds the functionality to delete sessions through the session API v2 and the OIDC end_session endpoint. # How the Problems Are Solved - added `SessionDeleteCommand` in domain package - added possibility to pass the session token verifier to the domain package - use feature flag to switch API and OIDC usage from CQRS to relation table - added a `permissionCheck` condition to let permissions be checked directly in the repository / sql - part of it is still a placeholder until actual permission tables are done - added a `session_deleted` table to store (recently) deleted sessions to handle necessary checks / cases like delete my own session, which needs to be idempotent # Additional Changes Fixed `Matches` function of `existsCondition` (as missing an implementation) # Additional Context - closes #11037 --------- Co-authored-by: Stefan Benz <[email protected]>
This commit is contained in:
co-authored by
Stefan Benz
parent
ae32508225
commit
ca4bba3992
@@ -10,6 +10,10 @@ import (
|
||||
"github.com/zitadel/zitadel/backend/v3/storage/database"
|
||||
)
|
||||
|
||||
const (
|
||||
ZIT01 = "ZIT01" // custom error code to express missing permissions by the end-user
|
||||
)
|
||||
|
||||
func wrapError(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
@@ -54,6 +58,9 @@ func wrapPgError(err *pgconn.PgError) error {
|
||||
// 22P02: integrity violation - A value is being inserted into a enum that is not valid
|
||||
case "22P02":
|
||||
return database.NewCheckError(err.TableName, err.ConstraintName, err)
|
||||
// ZIT01: missing permissions by the end-user
|
||||
case ZIT01:
|
||||
return database.NewPermissionError(err)
|
||||
default:
|
||||
return database.NewUnknownError(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user